1

I am trying to batch disassemble and decompile 500 binaries using the IDA Pro 7.5 disassember and Hex rays decompiler. I can get the .i64 output from the disassembler, but I do not have a way to batch decompile this. Does anyone have an easy way to get the .c pseudocode directly from a binary, like one can do with Ghidra?

3

Please see Batch Operation In the decompiler’s manual.

| improve this answer | |
0

@cal_decom hello, I wrote this script which may help you in your what you want to achieve.

import os
import sys
sys.path.append(os.getcwd())

pwd = os.getcwd()
for dirpath, dirnames, filenames in sorted(os.walk(pwd)):
    for file in filenames:
        ext = os.path.splitext(file)[-1]
        name = os.path.splitext(file)[0]
        if os.path.splitext(file)[-1] == ".out":
            os.system(f"/mnt/d/idapro-7.5/idat64 -Ohexrays:{os.path.join(dirpath, name)}:ALL  -A {os.path.join(dirpath, file)} -nosave")
# you might want to change this for sub directories
os.system("rm *.i64")

You can change the path accordingly. This script scans through current directory and sub directories to find binaries with "out" extension and generates pseudocode if found. You can read the link provided by @Igor Skochinsky for other options available.

| improve this answer | |

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.