Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- BOOL InjectDLL(HANDLE hProcess, const char *dll_path) {
- LPVOID alloc = VirtualAllocEx(hProcess, NULL, 0x1000, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
- WriteProcessMemory(hProcess, alloc, dll_path, MAX_PATH, NULL);
- return (BOOL)CreateRemoteThread(hProcess, 0, 0, (LPTHREAD_START_ROUTINE)LoadLibraryA, alloc, 0, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement