Answer the question
In order to leave comments, you need to log in
Debugging denied. The process is rejecting the dll. What to do?
Good day to all.
Please help.
The goal is to call the functions of a foreign process (from the process itself, of course).
When DLL injection using CreateRemoteThread (code below), the injection succeeds, but it does not exist in loaded DLLs (check Process Explorer ).
The code itself is working (injected anywhere)
DLL is empty - does nothing, created through DillMain
bool Inject(DWORD pID, char* path) {
HANDLE proc_handle;
LPVOID RemoteString;
LPVOID LoadLibAddy;
if (pID == 0) {
return false;
}
proc_handle = OpenProcess(PROCESS_ALL_ACCESS, false, pID);
if (proc_handle == 0) {
return false;
}
RemoteString = VirtualAllocEx(proc_handle, NULL, strlen(path), MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
WriteProcessMemory(proc_handle, RemoteString, path, strlen(path), NULL);
LoadLibAddy = (LPVOID)GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA");
CreateRemoteThread(proc_handle, NULL, NULL, (LPTHREAD_START_ROUTINE)LoadLibAddy, RemoteString, NULL, NULL);
CloseHandle(proc_handle);
return true;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question