问题描述
我正在学习 OpenSecurityTraining 中的这些课程.
I'm following these lessons from OpenSecurityTraining.
我已经到了实验室部分,我必须在 CMU 炸弹上训练自己.他们提供了一个 x86_64 编译的 CMU Bomb,您可以在此处找到以进行训练:CMU Bomb x86-64 最初来自 CMU 实验室计算机系统:程序员的视角 (CS:APP) 第 1 版.
I've reached the lab part where I've to train myself on a CMU Bomb. They provide a x86_64 compiled CMU Bomb that you can find here to train on : CMU Bomb x86-64 originally from a 32-bit bomb from CMU Labs forComputer Systems: A Programmer's Perspective (CS:APP) 1st edition.
我有一个虚拟化的 64 位 Elementary OS 发行版,我在其中使用 GDB 毫无问题地拆卸了 CMU Bomb.现在,我有一个 64 位 Ubuntu 14.04 LTS(未虚拟化),当我尝试重现我在 Elementary OS 上这样做的原因时,我得到了著名的错误.
I had a virtualized 64 bits Elementary OS distribution where I disassembled the CMU Bomb without problems using GDB. Now, I've a 64 bits Ubuntu 14.04 LTS (not virtualized) and when I try to reproduce why I did on my Elementary OS, I get the famous error.
我运行这些命令:
gdb ./bomb-x64
(gdb) b main
Breakpoint 1 at 0x400dbd: file bomb.c, line 37. -- why bomb.c ?
(gdb) r
...
bomb.c: no such file or directory
我可以在 CMU Bomb 的其他功能上创建断点,它可以按预期工作.
示例:
Edit : I can create breakpoints on others functions of the CMU Bomb and it works as expected.
Example :
(gdb) b phase_1
Breakpoint 3 at 0x400f00
(gdb) r
Breakpoint 1, 0x0000000000400f00 in phase_1 ()
(gdb) disas
Dump of assembler code for function phase_1:
=> 0x0000000000400f00 <+0>: sub $0x8,%rsp
0x0000000000400f04 <+4>: mov $0x4023b0,%esi
0x0000000000400f09 <+9>: callq 0x401308 <strings_not_equal>
0x0000000000400f0e <+14>: test %eax,%eax
0x0000000000400f10 <+16>: je 0x400f17 <phase_1+23>
0x0000000000400f12 <+18>: callq 0x40140a <explode_bomb>
0x0000000000400f17 <+23>: add $0x8,%rsp
0x0000000000400f1b <+27>: retq
End of assembler dump.
我听说过 ia32-libs,但由于我在 64 位 Ubuntu 上并运行 64 位编译的 CMU Bomb,所以这并没有什么作用,我错了吗?
I've heard of ia32-libs but this doesn't do anything more since I'm on 64bits Ubuntu and run a 64bits compiled CMU Bomb, am I wrong ?
推荐答案
使用dir命令设置源码路径
Use dir command to set source path
dir /usr/src/debug
在上面的路径中.您的代码应该出现.
in above path. Your code should present.
这篇关于GDB 没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!