ndisasm手册中提到的二进制文件和可执行文件有什么区别? [英] What's the difference between binary and executable files mentioned in ndisasm's manual?

查看:78
本文介绍了ndisasm手册中提到的二进制文件和可执行文件有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用 clang 编译我的C文件,然后用 ndisasm 进行反编译(出于教育目的).但是, ndisasm 在其手册中说,它仅适用于 binary ,而不适用于 executable 文件:

I want to compile my C file with clang and then decompile it with with ndisasm (for educational purposes). However, ndisasm says in it's manual that it only works with binary and not executable files:

   ndisasm only disassembles binary files: it  has
   no  understanding  of  the  header  information
   present in object or executable files.  If  you
   want  to disassemble an object file, you should
   probably be using objdump(1).

到底有什么区别?当我使用简单的C文件,可执行文件或二进制文件运行 clang 时,输出什么?

What's the difference, exactly? And what does clang output when I run it with a simple C file, an executable or a binary?

推荐答案

目标文件包含机器语言代码,各种其他信息.听起来 ndisasm 只想要机器代码,而不想要其他东西.因此,该消息告诉您使用 objdump 实用程序从目标文件中仅提取机器代码段.然后,您可以在其上运行 ndisasm .

An object file contains machine language code, and all sorts of other information. It sounds like ndisasm wants just the machine code, not the other stuff. So the message is telling you to use the objdump utility to extract just the machine code segment(s) from the object file. Then you can presumably run ndisasm on that.

这篇关于ndisasm手册中提到的二进制文件和可执行文件有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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