冰楓論壇
標題:
關於多進程中選擇特定PID並注入DLL問題
[打印本頁]
作者:
kevin001958
時間:
2019-10-12 09:38
標題:
關於多進程中選擇特定PID並注入DLL問題
可以的話最好能附上原碼
目前小弟是用
Process.GetProcessesByName(String)
來取得程式並注入DLL
可是如果說我的程式執行的時候會有2個程序
A.exe PID:19004
A.exe PID:23472
並且可以確定我需要注入的程序的PID一定較小
有沒有辦法指定他?
目前注入的方法是:
TargetProcessHandle = OpenProcess(PROCESS_CREATE_THREAD Or PROCESS_VM_OPERATION Or PROCESS_VM_WRITE, False, TargetProcess(0).Id)
pszLibFileRemote = porcessname(儲存程式名稱)
pfnStartAddr = GetProcAddress(GetModuleHandle("Kernel32"), "LoadLibraryA")
TargetBufferSize = 1 + Len(pszLibFileRemote)
Dim Rtn As Integer
Dim LoadLibParamAdr As Integer
LoadLibParamAdr = VirtualAllocEx(TargetProcessHandle, 0, TargetBufferSize, MEM_COMMIT, PAGE_READWRITE)
Rtn = WriteProcessMemory(TargetProcessHandle, LoadLibParamAdr, pszLibFileRemote, TargetBufferSize, 0)
CreateRemoteThread(TargetProcessHandle, 0, 0, pfnStartAddr, LoadLibParamAdr, 0, 0)
CloseHandle(TargetProcessHandle)
然後設定一個Button觸發,程序跟DLL都存在的話就
call 上面那段注入
歡迎光臨 冰楓論壇 (https://bingfong.com/)
Powered by 冰楓