8

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.

7
  • 3
    This sounds like an XY problem. What are you actually trying to do?
    – Igor Skochinsky
    Commented Aug 12, 2013 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
    Commented Aug 12, 2013 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
    Commented Aug 12, 2013 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
    Commented Aug 12, 2013 at 22:26
  • 1
    Welcome to RE.SE. If you have a different query that is not answered here then please ask a new question.
    – David
    Commented Oct 16, 2020 at 21:58

1 Answer 1

5

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.

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

Your Answer

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

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