Похожие чаты

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 ответов

67 просмотров

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

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

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

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта