nefarius / Injector

Command line utility to inject and eject DLLs
MIT License
564 stars 92 forks source link

Load library from different path fails (LoadLibrary call fail). #31

Open nathan130200 opened 2 months ago

nathan130200 commented 2 months ago

Basically when attempt to inject any library from different directory than injector.exe root, the calls to LoadLibraryW always fail. I looked in the code, seems the injector load only for relative paths to injector.exe.

Same as #26

nefarius commented 2 months ago

What's your example to reproduce?

nathan130200 commented 2 months ago

The command injector.exe -p <pid of game after successful start> -i "C:\Projects\Game Helpers\bin\Debug\game-helpers.dll" and injector.exe in different path from C:\Projects\Game Helpers\bin\Debug, eg: E:\Programs\utils\injector.exe

Output same LoadLibraryW call failed in remote process.

If i place game-helpers.dll in same folder of injector.exe and call it directly -i game-helpers.dll works fine.

image

The example above is called after my launcher start game .exe file then get PID and inject that library. Since i need hook stuff in c++ functions before first call to CreateMutexA i must inject instantly into the game.

nefarius commented 2 months ago

Yeah that's definitely supposed to work like that, will investigate.