进程注入程序例程

易语言 2020-10-26 18:32:11

进程注入程序例程

shellcode = 到字节集 (m2) + { 0 } + 到字节集 (m1) + { 0 } + { 96, 184 } + 到字节集 (messageaddr) + { 106, 0, 104 } + 到字节集 (lpbuf) + { 104 } + 到字节集 (到整数 (lpbuf + 取文本长度 (m2) + 1)) + { 106, 0, 255, 208, 97, 195, 144 }
dwsize = 取字节集长度 (shellcode)
ret = WriteProcessMemory (phandle, lpbuf, shellcode, dwsize, 0)
.如果真 (ret = 0)
信息框 (“写内存失败!”, 0, )
VirtualFreeEx (phandle, lpbuf, 100, 16384)
返回 ()
.如果真结束
hthread = API_CreateRemoteThread (phandle, sa, 0, lpbuf + 取文本长度 (m1) + 取文本长度 (m2) + 2, 0, 0, 0)
WaitForSingleObject (hthread, -1)
VirtualFreeEx (phandle, lpbuf, 100, 16384)
CloseHandle (hthread)
CloseHandle (phandle)