获取源从目标文件 [英] Getting source from object file

查看:150
本文介绍了获取源从目标文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法通过使用C中的目标文件获取源$ C ​​$ C?

例如我有一个源$ C ​​$ C simple.c


  

CC simple.c


现在我已经A.OUT(目标文件)。通过这种a.out的我是否能得到源?


  

code simple.c的



解决方案

有很多有用的工具来检索您的可执行文件的信息。他们都不是能够给你回原始出处code(其它一些网友指出,这是不可能的C),但你可以尝试一些逆向工程工具。我的preferred之一是:


  • objdump的(以下简称binutils的软件包的一部分)

  • HTE(Debian软件包为HT)

通过第一个其实你可以得到所有导出的符号和装配方面(显然这是真实的他们的相对可执行code只对的.text 部分)。第二个目的是与英特尔架构的工作,但你将能够analize每一个可执行文件并获取有关ELF段和符号信息。

Is there any way to get the source code by using object file in C?

For example I have a source code simple.c

cc simple.c

Now I have a.out (object file). By this a.out whether can I get the source?

code of simple.c

解决方案

There are many useful tools to retrieve information from your executable. None of them is able to give you back the original source code (as some other user pointed out, it's impossible for C), but you can try some reverse engineering tools. My preferred one are:

  • Objdump (part of the "binutils" package)
  • hte (debian packages it as "ht")

With the first one you can actually get all the exported symbols and their relative executable code in terms of assembly (obviously this is true only for the .text sections). The second one is aimed to work with intel architectures, but you will be able to analize every executable file and get information about the ELF sections and symbols.

这篇关于获取源从目标文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆