Here's the injector I made for my Item Manager.
How to use it in your VC++ project:
Then use it like this- on a timer message or in a separate thread loop:
Of course, this snippet lacks error handling, and you should have it, but it's up to you.
Feel free to add corrections and ask questions. Happy coding!
- Loads a DLL from resource;
- Writes a .dll with a random filename into System32 folder;
- Injects using simple LoadLibrary/CreateRemoteThread method;
- Schedules the .dll for deletion on reboot.
How to use it in your VC++ project:
- Make sure your project is set to Unicode (Solution properties -> Configuration Properties -> General -> Character Set = Use Unicode Character Set);
- Make your project require administrator privileges (Solution properties -> Configuration Properties -> Linker -> Manifest File -> UAC Execution Level = requireAdministrator);
- Create a resource in your project with type of "BINARY" and ID of "IDR_DLL" and set its path to your DLL file.
- Include 'Injection.h' in your main CPP.
Then use it like this- on a timer message or in a separate thread loop:
Code:
DWORD procId = GetTargetThreadIDFromProcName(L"S4 Client.exe");
if (procId) {
Inject(procId);
}
Feel free to add corrections and ask questions. Happy coding!