windbg反汇编函数命令(uf)需要一些格式

windbg反汇编函数命令(uf)需要一些格式,windbg,Windbg,在连接notepad.exe后,我在windbg中执行了一个uf命令 命令是uf记事本!我得到了以下输出 0:000> uf notepad!WinMain notepad!WinMain: 0021138d mov edi,edi 0021138f push ebp 00211390 mov ebp,esp 00211392 sub esp,1Ch 00211395 push esi 00211396 push edi 00211397 push

在连接notepad.exe后,我在windbg中执行了一个uf命令 命令是uf记事本!我得到了以下输出

0:000> uf notepad!WinMain
notepad!WinMain:
0021138d mov     edi,edi
0021138f push    ebp
00211390 mov     ebp,esp
00211392 sub     esp,1Ch
00211395 push    esi
00211396 push    edi
00211397 push    6
002113c8 test    eax,eax
002113ca jl      notepad!WinMain+0x118 (00211c93)

notepad!WinMain+0x43:
002113d0 push    ebx
002113d1 push    dword ptr [ebp+14h]
002113d4 push    edi
002113d5 call    notepad!SkipProgramName (00213170)
002113e5 je      notepad!WinMain+0x10e (00211ca9)

notepad!WinMain+0x5e:
002113eb push    esi
002113ec push    esi
002113ed call    dword ptr [notepad!_imp__GetCurrentProcessId (00211084)]
等等。。如果您注意到在每个跳转指令之后,它都会创建一个新的块,如

002113ca jl      notepad!WinMain+0x118 (00211c93)

notepad!WinMain+0x43:

002113e5 je      notepad!WinMain+0x10e (00211ca9)

notepad!WinMain+0x5e:
所以我想知道的是WinDbg中的一个设置,在这个设置中,我可以在函数反汇编的每次跳转中忽略创建新块。为什么我不能用U命令获得输出

所以我在寻找这样的选择

002113c8 test    eax,eax002113ca 
jl      notepad!WinMain+0x118 (00211c93)
**blank line omitted**
**notepad!WinMain+0x43:** omitted**
002113d0 push    ebx002113d1 push    dword ptr [ebp+14h]

有什么帮助吗?

因为函数代码可能分散在整个代码部分(由链接器决定放什么,通常,它会将执行最多的部分移到顶部) 现在,u不关心您是否对某个特定函数感兴趣——它只会按顺序转储指令,而uf必须查找所有相关的代码块,并将它们一起格式化,使其看起来像一个完整的函数。
编辑:不幸的是(据我所知),windbg没有即时设置来满足您的需求-在这里,您可能需要求助于某种后处理(漂亮的打印脚本来删除空行和任何您需要的内容)。

因为函数代码可能分散在您的代码部分中(由链接器决定将什么放在哪里,通常情况下,它会将执行最多的部分移动到顶部) 现在,u不关心您是否对某个特定函数感兴趣——它只会按顺序转储指令,而uf必须查找所有相关的代码块,并将它们一起格式化,使其看起来像一个完整的函数。 编辑:不幸的是(据我所知),windbg没有即时设置来满足您的需求-在这里,您可能必须求助于某种后处理(使用漂亮的打印脚本来删除空行和其他您需要的内容)