GDB 问题 - 如何逐行浏览反汇编代码?
我想逐行浏览老师给我的二进制文件来检查堆栈上的地址和不同寄存器的内容,但我对使用 gdb 不太熟悉。虽然我有 C 代码,但我们应该完全从二进制文件开始工作。以下是我到目前为止使用过的命令:
(gdb) file SomeCode
这给了我这样的消息:
Reading symbols from ../overflow/SomeCode ...(no debugging symbols found)...done.
然后我使用 :
(gdb) disas main
这给了我所有的程序集。我想设置一个断点并使用“next”命令,但我尝试过的所有命令都不起作用。有谁知道我会使用的语法?
I'd like to go through a binary file my teacher gave me line by line to check addresses on the stack and the contents of different registers, but I'm not extremely familiar with using gdb. Although I have the C code, we're supposed to work entirely from a binary file. Here are the commands I've used so far:
(gdb) file SomeCode
Which gives me this message:
Reading symbols from ../overflow/SomeCode ...(no debugging symbols found)...done.
Then I use :
(gdb) disas main
which gives me all of the assembly. I wanted to set up a break point and use the "next" command, but none of the commands I tried work. Does anyone know the syntax I would use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用
ni
,即nexti
。等价的是si
,它是步骤指令try using
ni
which isnexti
. equivalent issi
which is step instructionnexti 如果你想跳过函数调用。
stepi 如果你想进入函数调用。
以下文档非常有帮助;它有一个可以在 gdb 上使用的所有重要命令的列表。
X86-64:http://csapp.cs.cmu.edu /public/docs/gdbnotes-x86-64.pdf
IA32:http://csapp.cs.cmu.edu/public/docs/gdbnotes-ia32.pdf
nexti if you want to jump over function calls.
stepi if you want to enter a function call.
The following documentation is very helpful; it has a list of all the important commands you could use on gdb.
X86-64: http://csapp.cs.cmu.edu/public/docs/gdbnotes-x86-64.pdf
IA32: http://csapp.cs.cmu.edu/public/docs/gdbnotes-ia32.pdf