About
This supports calling the Ghidra SLEIGH compiler from Rust code. Processors in Ghidra are described by .slaspec files, but SLEIGH libraries operates on the compiled .sla files. Now the compiled .sla artifacts can be produced directly from Rust code.
What's New?
For latest details check out the CHANGELOG.
Usage
let mut compiler = default;
let input_file = new;
let output_file = new;
compiler.compile?;
// Success! Can now use compiled x86-64.sla file
Compiler Details
The internal SLEIGH compiler is built from Ghidra 11.4.
The SLEIGH compiler may report warnings in its response which reference command line switches. For details on any reported switches, refer to SLEIGH compiler usage.
Compatibility
In Ghidra 11.1 the .sla file format was changed to a compressed format. The uncompressed output can be obtained by setting debug_output to true in the compiler options.
let mut compiler = new;
let input_file = new;
let output_file = new;
compiler.compile?;
💥 These uncompressed files are not compatible with any tooling based on Ghidra. Later versions of the tooling do not understand this format, and the Ghidra team has no plans to add such support (#6416). Earlier versions of the tooling will reject the uncompressed file because the SLA format version has been bumped from 3 to 4.
Related Work
Check out the libsla crate for interfacing with the Ghidra SLEIGH library to disassemble native instructions into pcode!