1

Is there any x86 disassembler framework that can be used to analyze code from a specific address in a program, as in:

info = disassemble( startAddress , stopAddress) 

It should show every instruction and its operands and any other info that is good for analysis but it should have also fast mode where it isn't so important to obtain that much info for each instruction, but only for some of them that can be specified.

6
  • 2
    What OS and/or IDE are you using? Commented Jan 22, 2011 at 17:54
  • IDA Pro seemed to have some API, but I am not sure. Commented Jan 22, 2011 at 17:56
  • I think it was IDA Pro that i used, that would make an effort to only disassemble bytes that were being executed. It had its flaws, as there's a halting problem hiding in there -- the only way to know for sure some bytes are code is to trace through the program and see if they ever get jumped to. But it usually guessed pretty well. Commented Jan 22, 2011 at 18:00
  • If you are using *nux than gdb is quite good for analyzing and debugging you code Commented Jan 22, 2011 at 18:03
  • windows 7 / visual studio 2010 but I want to do croscompiling in the future so if you have any advise for that also thanks Commented Jan 22, 2011 at 18:39

5 Answers 5

4

Is GNU binutils not good enough? Here's how to do that with the objdump utility:

# Disassemble from virtual addresses 0x80000000 to 80000100 objdump -d program --start-address=0x80000000 --stop-address=0x80000100 
Sign up to request clarification or add additional context in comments.

1 Comment

Also, the binutils use a library, I believe libbfd, to perform this task. So maybe use it directly.
0

Google's protobuf uses libdisasm for that matter. Sad thing is that (judging from source code) it only supports ia32 and x86 and homepage states that "it is x86 specific and will not be expanded to include other CPU architectures". But since you didn't mention other archs, this library may be sufficient.

Comments

0

The cross-platform InstructionAPI suits this purpose, it will analyze the code and can print out the disassembly or provide a machine-independent view of the instructions for you to query. InstructionAPI is a shared library that you would link your code against.

http://www.paradyn.org/html/manuals.html

Comments

0

I would debug to the start point and look at the disassembly output of the debugger. A more brutal method is to disassemble it all and search for the function name in the disassembly file. objconv can do this, but it is slow on very big files.

Comments

0

Try BeaEngine

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.