Похожие чаты

Does it possible to create a wrapper loader for exe

which will inject DLLs from memory before the program load (not from filesystem) so the exe inside the wrapper can use them freely?
Just like we static link things, but with shared libraries

22 ответов

29 просмотров

this is how the most common wallhacks are loaded in memory

Jacob- Автор вопроса
void
this is how the most common wallhacks are loaded i...

Interesting. I want to use it for something good. To ship binary which depends on DLL without the DLLs

But you'll need these to be present somewhere.

Jacob- Автор вопроса
Jacob
It has to be on the disk?

Oh i see, yeah you can do that. You mean to load the file then hook up the function pointers?

Jacob- Автор вопроса
Manav | avoid unnecessary messaging me
Oh i see, yeah you can do that. You mean to load t...

Imagine a tool which easy to use as UPX you run it like that linkit.exe hello.exe hello.dll -o world.exe And it takes hello.dll and "Link" it so users can use world.exe without need hello.dll

Jacob
Imagine a tool which easy to use as UPX you run it...

Why do that when you can have your app load the dll file and tie up the necessary functions itself.

Jacob- Автор вопроса
Manav | avoid unnecessary messaging me
Why do that when you can have your app load the dl...

Because it's much simpler to ship single portable exe many times, And in terms of UX, it's easier for the user too. Download -> And open the exe

Jacob- Автор вопроса
Jacob- Автор вопроса
Jacob
.

You still don't get it what I meant. Whereever you choose to "put" your dll file, you embed it in your exe, just adding the contents at the end of your exe file or manually adding it following the elf format guidelines or shipping dll files together with yout app, you can use GetProcAddress() in windoes and dlsym in linux to get function pointers to exported functions

Jacob- Автор вопроса
Manav | avoid unnecessary messaging me
You still don't get it what I meant. Whereever you...

Oh now I understand. Does it will work if I can't change the code of hello.exe? just wrap it?

Jacob
Oh now I understand. Does it will work if I can't ...

Yeah since they are function pointers. What those exported functions need is a pointer. It could be pointing to anywhere in the memory

Jacob- Автор вопроса
Manav | avoid unnecessary messaging me
Yeah since they are function pointers. What those ...

Interesting. I'm wondering if it should work in general on every exe in windows

Jacob
Interesting. I'm wondering if it should work in ge...

here's the dumb way to do it :D, const uint8_t dll_data[] = { /* dump the raw dll file data here */ }; typedef int (*SquareFn)(int); int main() { // create a dll file from the above dll_data HANDLE hFile = CreateFileA("a.dll", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); DWORD written; BOOL writeResult = WriteFile(hFile, dll_data, sizeof(dll_data), &written, NULL); CloseHandle(hFile); HMODULE hModule = LoadLibraryA("a.dll"); SquareFn square = (SquareFn)GetProcAddress(hModule, "square"); int result = square(5); FreeLibrary(hModule); DeleteFileA("a.dll"); // Delete the temp file printf("Function result: %d\n", result); return 0; } the fun.c file which i create a dll out of, __declspec(dllexport) int square(int num) { return num * num; }

Jacob
Interesting. I'm wondering if it should work in ge...

It should unless your shared library doesn't do something which depends on the specific version of windows

²
embedded thing?

Well it is kind of embedding it, but not quite right. I am just trying to avoid manual dll initialization. To do that you'll need to deal the executable format for the particular OS.

Jacob- Автор вопроса
Manav | avoid unnecessary messaging me
Well it is kind of embedding it, but not quite rig...

Isn't there some c++ library for load dll from memory easily? Maybe even cross platform

Jacob
Isn't there some c++ library for load dll from mem...

i don't think you'll find cross platform solutions but there's this which exists https://github.com/fancycode/MemoryModule

Похожие вопросы

Обсуждают сегодня

а зачем этот вопрос для удаления из чата?
Mёdkinson Medvezhkin
63
using next image component with s3 image: "url" parameter is valid but upstream response is invalid code: <Image fill src={s...
Fasil
3
Эх кто-то пришел и весь праздник испортил :( You need complex FBX scene importing setup to change things on import? good luck with that. You need navigation and pathfinding? g...
Serg Gini
5
Friends, how can I find my Wazirx wallet address?
Silm Silm
31
Какого хера? /Sources/App/Modules/User/Models/UserLinkApple.swift:21:20: warning: stored property '_id' of 'Sendable'-conforming class 'UserLinkApple' is mutable @ID(...
Alexander Sherbakov
14
Всем привет! Подскажите. Я написал приложение на Delphi 10.2 Tokyo под Windows 10. И передо мной стал вопрос о том чтобы сделать это приложение кроссплатформенным (под Linux и...
Дмитрий Завгородний
24
How the price of ANVL is decided? The buying pressure comes just from staking which is very slow, while the selling pressure might be huge. What are the benefits for those who...
MJ Javvaji @muralijavvaji
13
My 7 year old daughter recognizes the Bitcoin symbol and knows it's currency. What are the top ,3-5 most basic important concepts to convey to a kid about BCH? I started with ...
Big Hair
24
How many Cashfusion server now?
Crypto life
22
Кто знает локации, где можно машину красиво отфоткать?
Lalalashechki Lalala
23
Карта сайта