普通网友 2015-03-17 07:29 采纳率: 19%
浏览 2596

手上没有源码,只有可执行程序,如何通过终端直接读写内存堆栈?

图片说明

上图说gdb不加-g参数可以看到内存地址,我试验的结果却不是这样的:

~/Desktop/hello$ gcc hello.c -o hello
~/Desktop/hello$ ls
hello hello.c
:~/Desktop/hello$ gdb hello
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/shkh/Desktop/hello/hello...(no debugging symbols found)...done.
(gdb) l
No symbol table is loaded.  Use the "file" command.
(gdb) file
No executable file now.
No symbol file now.
(gdb) r
Starting program:  
No executable file specified.
Use the "file" or "exec-file" command.
(gdb) exec-file
No executable file now.

我的结论:
gdb的使用有一个前提,就是要有源代码,编译的时候加-g参数。

问题来了:
如果我手上没有源码,只有可执行程序,如何通过终端直接读写内存堆栈?

  • 写回答

1条回答 默认 最新

  • oyljerry 2015-03-17 08:48
    关注

    没有源码就比较难了,只能反汇编,用ida,ollydbg等工具调试。类似逆向工程

    评论

报告相同问题?

悬赏问题

  • ¥15 slam rangenet++配置
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊