|
- '说明: dll远程注入
- '那个DLL是我随便找的一个 在QQ文件中随便找的一个
- '因为该源码的重点是 掩饰注入 而不是其他 至于怎么运行DLL中的函数 大家可以先研究下。。。
- 'by 尘粒 QQ:550702953
- Private Sub Command1_Click()
- Dim dllfile As String
- Dim hprosess As Long, l As Integer, hvir As Long, hmod As Long, hthread As Long
- Dim intstep As Integer
- dllfile = App.Path + "\mydll.dll" 'dll的文件名
- If Val(Text1.Text) <= 0 Then '如果进程的PID 小于等于0 说明用户输入的PID不正确
- intstep = 1 '说明是第一步 获取PID这步的。。。
- GoTo myerror '跳到处理错误上面
- Else
- hprosess = OpenProcess(2035711, 0, Val(Text1.Text)) '打开进程
- intstep = 2 '说明是第二步 打开进程这一步的
- If hprosess = 0 Then GoTo myerror '打开进程失败 跳到处理错误上面
- l = Len(dllfile) + 1 '取dll文件名的长度+1
- hvir = VirtualAllocEx(hprosess, 0, l, 4096, 4)
- WriteProcessMemory hprosess, hvir, dllfile, l, 0
- hmod = GetProcAddress(GetModuleHandle("Kernel32"), "LoadLibraryA")
- intstep = 3
- If hmod = 0 Then GoTo myerror
- hthread = CreateRemoteThread(hprosess, 0, 0, hmod, hvir, 0, 0) '这个就是关键了 远程线程
-
- If hthread <> 0 Then MsgBox "恭喜 注入成功咯" '成功 弹出信息
- intstep = 0 '因为成功了 所以把这个赋值为0 不然后面就会按错误信息处理了。。。
- '下面就是处理后事了
- VirtualFreeEx hprosess, hvir, 0, 32768
- CloseHandle hthread
- CloseHandle hprosess
- End If
- myerror: '错误的处理?????
- Select Case inttype
- Case 1 '输入的PID错误
- MsgBox "请输入正确的PID````````````"
- Case 2 '打开进程失败
- MsgBox "打开进程失败!!!!````````````"
- Case 3 '获取函数地址失败??
- MsgBox "获取函数地址失败!!!"
- End Select
- End Sub
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
评分
-
查看全部评分
|