Похожие чаты

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

64 просмотра

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

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

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

30500 за редактор? )
Владимир
47
any reference of this implementation?
BitBuddha
29
Ⓐrtto, [4/23/24 7:02 PM] Please explain more fully how it is not working exactly, and what are the steps you are taking, and what error messages come or what happens. Ⓐrtto, ...
Ezza Kezza
2
sounds like people have lost their kaspa on tradeogre... does this mean tradeogre not trustworthy?
Ezza Kezza
15
Страшнейшая правда про списки ЦБ. С первых дней жизни P2P сферы, молодые человеки, начитавшись законодательной базы и "внутренних" документов, решили, что им противостоит сер...
Foxcool
3
Недавно Google Project Zero нашёл багу в SQLite с помощью LLM, о чём достаточно было шумно в определённых интернетах, которые сопровождались рассказами, что скоро всех "ибешни...
Alex Sherbakov
5
So much speculation in the last week. So much volatility in price. This is because Hedera has a GC that isn't using the network it's governing. Why aren't people asking why a...
Summit Seeker R
8
Anyone else having this error when trying to make transactions?
Datzel
11
Question: How viable is it to use Anvil as the backend infrastructure for managing a TradFi portfolio, while integrating Flexa for instant liquidity and payment solutions? Cou...
Kevin
2
вы делали что-то подобное и как? может есть либы готовые? увидел картинку нокода, где всё линиями соединено и стало интересно попробовать то же в ddl на lua сделать. решил с ч...
Victor
8
Карта сайта