gpt4 book ai didi

debugging - 显示 "No function contains program counter for selected frame"时如何强制 GDB 反汇编代码?

转载 作者:行者123 更新时间:2023-12-04 03:10:51 32 4
gpt4 key购买 nike

How to force GDB to disassemble code when it says "No function contains program counter for selected frame"?



调试程序,从绝对地址 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在地址开始反汇编?否则,我的替代品是什么(即其他工具)?

最佳答案

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 .

希望这可以帮助!

关于debugging - 显示 "No function contains program counter for selected frame"时如何强制 GDB 反汇编代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39016138/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com