Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Inject code*/
- int Method1(DWORD ProcessID, char *dllstr)
- {
- HANDLE Proc;
- char buf[50]={0};
- LPVOID RemoteString, LoadLibAddy;
- if (!ProcessID) { return 1; }
- Proc = OpenProcess(PROCESS_CREATE_THREAD, FALSE, ProcessID);
- if (!Proc) { return 1; }
- LoadLibAddy = (LPVOID)GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA");
- RemoteString = (LPVOID)VirtualAllocEx(Proc, NULL, strlen(dllstr), MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);
- WriteProcessMemory(Proc, (LPVOID)RemoteString, dllstr, strlen(dllstr), NULL);
- CreateRemoteThread(Proc, NULL, NULL, (LPTHREAD_START_ROUTINE)LoadLibAddy, (LPVOID)RemoteString, NULL, NULL);
- CloseHandle(Proc);
- return 0;
- } /*Method1*/
Add Comment
Please, Sign In to add comment