Lifting microcode (IDA IR) into LLVM IR. The script has been test in BinaryCorp small test datasets (1584 binaries). The code now is in debug version, we will improve the shitty code later.
This version has been migrated to use IDA Pro 9.0+ with the new idalib (IDA as a library) feature, allowing you to run as a standalone application without the IDA GUI.
Key Changes:
- ✅ Uses
idapromodule and idalib API - ✅ Runs as standalone Python script (no IDA GUI required)
- ✅ Migrated from deprecated APIs:
ida_idaapi.get_inf_structure().is_64bit()→ida_ida.inf_is_64bit()- Fixed invalid escape sequences for Python 3.x compatibility
- Added validation for invalid type sizes from IDA
Migration to IDA Pro 9.0:
- Removed dependency on
ida_structandida_enummodules (superseded byida_typeinf) - All type operations now use modern
ida_typeinfAPIs
-
Install IDA Pro 9.0 or newer
-
Install and configure the
idapropackage:# Navigate to IDA installation's idalib/python folder cd /path/to/IDA/idalib/python pip install . # Run the activation script python /path/to/IDA/py-activate-idalib.py
-
Install dependencies:
pip install llvmlite numpy
Run as a standalone application:
python ida2llvm.py -f <binary_file> -o <output.ll>
# Examples:
python ida2llvm.py -f ./examples/cp -o ./cp_output.ll
python ida2llvm.py -f ./examples/ls -o ./ls_output.ll -v # with verbose loggingOptions:
-f, --file: Binary file to analyze (required)-o, --output: Output LLVM IR file path (required)-v, --verbose: Enable verbose logging (optional)
idat64 -c -A -S"ida2llvm.py [binary].ll" binary- IDA Pro 9.0+ (for idalib mode) or IDA Pro 8.3 (for legacy mode)
- Python 3.x
- llvmlite
- numpy
pip install llvmlite numpy- ida2llvm: The codebase we built on, we fixing most of the bugs (float, unsupport inst, unsupport typecast and structure) and transforming it from an experimental toy to a stable tool.