Windbg 查看MFC类重载虚函数
1.进入断点后,查看类的虚函数表指针:
2.编写脚本,用于反汇编虚函数表中的各个虚函数地址:
方法1:
$$usage: $$>a<script.txt address
.foreach ( tmpvar { dd ${$arg1} L64 } )
{
.if ( ${tmpvar} < ${$arg1} )
{ uf /c tmpvar }
}
方法2: $$usage: $$>a<script.txt address
r @$t1 = ${$arg1}+1000;
.for ( r @$t0=${$arg1}; @$t0 < @$t1; r @$t0=@$t0+4 )
{
.if ( 0 == poi(@$t0) )
{
.break;
}
uf /c poi(@$t0)
}
3.运行脚本:
联机帮助:
命令语法:/Debuggers/DebuggerReference/Debugger Commands
脚本语法:/Debuggers/DebuggerOperation/The Debugger Command Window/Using Debugger Command Programs
表达式语法:/Debuggers/DebuggerOperation/The Debugger Command Window/Evaluating Expressions