获取源从目标文件

编程入门 行业动态 更新时间:2024-10-26 18:18:09
本文介绍了获取源从目标文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有没有办法通过使用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.

更多推荐

获取源从目标文件

本文发布于:2023-11-12 11:36:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581394.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:目标   文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!