我爱代码 - 专业游戏安全与逆向论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 3582|回复: 0

1.虚拟化调试器通道重建-调试器与被调试程序建立连接

[复制链接]

2381

主题

53

回帖

9145

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
9145
QQ
发表于 2022-4-3 12:00:41 | 显示全部楼层 |阅读模式

想要查看内容赶紧注册登陆吧!

您需要 登录 才可以下载或查看,没有账号?立即注册

x
虚拟化调试器通道重建-调试器与被调试程序建立连接
第一课上课的笔记:
        //------------XP
        【DebugActiveProcess】
          <1>.kernel32!DbgUiConnectDbg()
                ntdll!DbgUiConnectDbg()
                  ntdll!ZwCreateDebugObject()
                    ntdll!NtCreateDebugObject()
                        进入0环

          <2>.kernel32!DbgUiDebugActiveProcess(被调试进程句柄)
                  ntdll!DbgUiDebugActiveProcess(被调试进程句柄)
                    ntdll!NtDebugActivePRocess(被调试进程句柄,调试器TEB+0xF24)
                      nt!NtDebugActiveProcess(HANDLE ProcessHandle,HANDLE DebugObjectHandle)


          //------------WIN10(19043)
          【DebugActiveProcess】
          <1>.kernel32!DebugActiveProcess
              kernelBase!DebugActiveProcess(被调试进程PID)
                  ntdll!DbgUiConnectToDbg()
                    ntdll!NtCreateDebugObject(&NtCurrentTeb()->DbgSsReserved[1],...)    : [gs:30]+0x16A8     (调试器自己的TEB这个位置有值:DebugObjct的句柄)
                  被调试进程句柄 = ProcessIdToHandle(dwProcessId)
                  ntdll!DbgUiDebugActiveProcess(被调试进程句柄)

          <2>.ntdll!DbgUiDebugActiveProcess(被调试进程句柄)
              ntdll!NtDebugActiveProcess(被调试进程句柄,NtCurrentTeb()->DbgSsReserved[1]) : [gs:30]+0x16A8
                nt!进入0环的NtDebugActiveProcess
              ntdll!DbgUiIssueRemoteBreakin(被调试进程句柄)
              ntdll!ZwRemoveProcessDebug(被调试进程句柄, NtCurrentTeb()->DbgSsReserved[1]);

思考:所以X64Dbg插件需要挂钩什么?


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|我爱代码 - 专业游戏安全与逆向论坛 ( 陇ICP备17000105号-1 )

GMT+8, 2025-2-23 16:23 , Processed in 0.074354 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表