linux disassembler
-
11-09-2019 - |
Question
how can I write just a simple disassembler for linux from scratches? Are there any libs to use? I need something that "just works".
Solution
you have to understand the ELF file format first. Then, you can start processing the various sections of code according to the opcodes of your architecture.
OTHER TIPS
You can use libbfd and libopcodes, which are libraries distributed as part of binutils.
http://www.gnu.org/software/binutils/
As an example of the power of these libraries, check out the Online Disassembler (ODA).
http://www.onlinedisassembler.com
ODA supports a myriad of architectures and provides a basic feature set. You can enter binary data in the Live View and watch the disassembly appear as you type, or you can upload a file to disassemble. A nice feature of this site is that you can share the link to the disassembly with others.
You can take a look at the code of ERESI
The ERESI Reverse Engineering Software Interface is a multi-architecture binary analysis framework with a tailored domain specific language for reverse engineering and program manipulation.