5

Does anyone know of projects that parse the disassembly from IDA Pro using a lexer and/or parser generator library? But I would also totally be fine with JSON or XML format. So far, I have been able to produce HTML from the GUI, but I am looking for a command line tool that will parse disassembly files produced by IDA Pro.

  • 3
    This sounds like an XY problem. What are you actually trying to do? – Igor Skochinsky Aug 12 '13 at 21:41
  • I am moving to IDA Pro disassembly in order to do my own static analysis. I had used Distorm in the past, but I want to experiment with IDA Pro. I am parsing asm files produced by IDA Pro disassembler to interface with an IR translator. It's that not that big of a deal I just do not want to reinvent the wheel here. What's a XY problem? – turnersr Aug 12 '13 at 21:51
  • I am actually trying to do this: "First, the binary file is disassembled. toil currently interfaces with two disassemblers: IDA Pro, a commercial disassembler, and a linear sweep disassembler built on top of GNU libopcodes. Interfacing with other disassemblers is straight-forward." (Very old BAP documentation). – turnersr Aug 12 '13 at 21:59
  • 2
    You're going at it backwards. Instead of parsing assembler text, you should use IDA scripting or native APIs to get the instructions in nice, broken down representation. – Igor Skochinsky Aug 12 '13 at 22:26
  • I am all ears if I can get a better representation. Are you suggesting using GetDisasm? What do you mean by broken down representation? Can you please point me to the right documentation? Thanks! – turnersr Aug 12 '13 at 23:34
4

You'd be better off using IDC functions like GetMnem(), GetOpType(), GetOperandValue(), etc. to extract IDA's disassembly than exporting to JSON/XML.

You can use command-line switches to run IDA in batch-mode with your IDC script to automate the entire process.

  • Thanks! I did not know you could do that in IDA Pro. This is differently the right approach for me. – turnersr Aug 13 '13 at 15:29
  • 1
    I would recommend DecodeInstruction() which gives the most detail. – Igor Skochinsky Aug 14 '13 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.