1

how can I write just a simple disassembler for linux from scratches? Are there any libs to use? I need something that "just works".

2
  • What architecture(s) are you targeting, as this is significantly more relevent than the OS. Commented Jul 8, 2009 at 23:03
  • Sorry I've omitted which architecture, I'm tryng disassembling under x86 Commented Jul 9, 2009 at 15:59

4 Answers 4

8

Instead of writing one, try Objdump.

Based on your comment, and your desire to implement from scratch, I take it this is a school project. You could get the source for objdump and see what libraries and techniques it uses. The BFD library might be of use.

Sign up to request clarification or add additional context in comments.

1 Comment

I't not the aim of my project, i usually use any kind of debugger and disassembler.
5

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.

Comments

1

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.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.