-
-
[旧帖]
[求助]DLL 注入不成功,帮着看看哪有问题
0.00雪花
-
发表于:
2011-10-8 11:19
1558
-
[旧帖] [求助]DLL 注入不成功,帮着看看哪有问题
0.00雪花
dwProcessId = GetProcessId("notepad.exe\n");
if (!dwProcessId){
return 0;
}
HANDLE hRemoteProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcessId);
if (!hRemoteProcess){
printf("Open remote process failed !\n");
return 0;
}
else printf("Open remote process ok...... !\n");
char *pszLibFileRemote="D:\\vc\\inject\\Module.dll";
char *pszLibFileName="D:\\vc\\inject\\Module.dll";
PTHREAD_START_ROUTINE pfnStartAddr = (PTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandle("Kernel32"), "LoadLibraryA");
int cb = (1 + lstrlenA(pszLibFileRemote)) * sizeof(char);
pszLibFileRemote = (char *) VirtualAllocEx( hRemoteProcess, NULL, cb, MEM_COMMIT, PAGE_READWRITE);
WriteProcessMemory(hRemoteProcess, pszLibFileRemote, (PVOID) pszLibFileName, cb, NULL);
HANDLE remoteThread = CreateRemoteThread( hRemoteProcess, NULL, 0, pfnStartAddr, pszLibFileRemote, 0, NULL);
[培训]传播安全知识、拓宽行业人脉——看雪讲师团队等你加入!