如何强制GDB反汇编代码"没有函数包含选定框架的程序计数器"?

时间:2016-08-18 10:42:56

标签: debugging assembly x86 gdb portable-executable

  

如何强制GDB反汇编代码"没有函数包含所选帧的程序计数器"?

调试程序,从绝对地址0x00402200开始,在尝试反汇编此地址的代码时,我得到以下输出:

[New Thread 65212.0x10378]

Breakpoint 1, 0x00402200 in ?? ()
(gdb) stepi
0x00402202 in ?? ()
(gdb) stepi
0x00402207 in ?? ()
(gdb) stepi
0x0040220a in ?? ()
(gdb) stepi
0x0040220f in ?? ()
(gdb) disassemble
No function contains program counter for selected frame.
(gdb) stepi
0x00401000 in start ()

正在调试的文件是用于教育目的的Win32 PE(逆向工程)。

有没有办法告诉GDB在地址开始反汇编?否则,我的替代方案(即其他工具)是什么?

2 个答案:

答案 0 :(得分:9)

disassemble的文档:(gdb) help disassemble说:

Disassemble a specified section of memory.
Default is the function surrounding the pc of the selected frame.
...
With a single argument, the function surrounding that address is dumped.
Two arguments (separated by a comma) are taken as a range of memory to dump,
  in the form of "start,end", or "start,+length".

因此,在您的情况下,由于它们不是程序计数器(PE)的函数,您应该使用双参数形式,如:

disassemble 0x00402200, +16disassemble 0x00402200, 0x00402210

希望这有帮助!

答案 1 :(得分:5)

我知道这并没有直接回答你的问题,但是因为它已经得到了解答......

您可以告诉GDB使用set disassemble-next-line on显示下一条指令。

相关问题