如何让cgdb显示汇编代码?
我找不到 cgdb 反汇编二进制文件并在代码窗口中使用当前指令显示汇编代码的方法。这可能吗?我应该使用什么命令?我使用的是 Mac OS X 并从自制软件存储库中获取了 cgdb。
I can't find a way for cgdb to disassemble a binary and show the assembly code with the current instruction in the code window. Is this possible and what command should I use? I'm using Mac OS X and got cgdb from the homebrew repository.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
cgdb 最近的更新(2017 年 2 月)使这成为可能。您将需要 cgdb 版本 0.7.0 或更高版本。 (在撰写本文时,这是最新版本)。鉴于它是最新的,您可能需要自己从源代码编译它。
有关添加反汇编支持的更多详细信息可以在此处找到:
https://github.com/cgdb/cgdb/issues/44
查看反汇编代码在 cgdb 中,点击 esc 并输入
:set dis
enter。要返回源(如果有),请重复此操作,但键入
:set nodis
除外。A recent update (Feb 2017) to cgdb makes it possible to do this. You will need cgdb version 0.7.0 or newer. (At the time of writing this is the latest release). You may need to compile this from source yourself given how recent it is.
More details on adding disassembly support can be found here:
https://github.com/cgdb/cgdb/issues/44
To view the disassembly in cgdb hit esc and type
:set dis
enter.To go back to the source (if available), repeat this, except type
:set nodis
.display/i $pc
在控制台窗口中始终显示当前指令的反汇编。要显示更多指令的反汇编,请在
i
前面加上指令数。例如,
始终显示接下来 5 条指令的反汇编。
display/i $pc
shows disassembly always for the current instruction, in the console window.To show disassembly for more instructions, prefix
i
with the number of instructions.For example,
shows disassembly always for the next 5 instructions.
我正在 MacOS 上拆除二进制炸弹,找到 "gdb -tui" 会有所帮助。我发现“cgdb”可以让代码变得丰富多彩。但我们希望看到的是在代码窗口上显示反汇编代码,上面的答案只显示逐行代码或仅显示不变的行。
不幸的是,我发现一篇文章说“cgdb 还不支持程序集显示。”
https://groups.google.com/forum/#!topic /cgdb-users/E-jZCJiBAQQ
嗯,已经是15年12月11日了,但是似乎仍然无法像tui模式下的gdb那样在代码窗口上显示汇编代码。
I am working on MacOS to defuse a binary bomb and find "gdb -tui" will be helpful. Than I found "cgdb" can make code colorful. But what we want to see is show disassembled code on the code window, the answer above only show the code line by line or only changeless lines.
Unfortunately, I find a post said that "the cgdb does not support assembly display (yet)."
https://groups.google.com/forum/#!topic/cgdb-users/E-jZCJiBAQQ
Well, it's 12/11/15, but it seems still couldn't show the assembly code on code window like gdb in tui mode.