Expand description
This crate includes Rust bindings to the Ghidra SLEIGH library libsla for translating native code to p-code.
SLEIGH is a processor specification language developed for the Ghidra used to describe microprocessors with enough detail to facilitate disassembly and decompilation. The processor-specific instructions are translated to p-code, which captures the instruction semantics independent of the specific processor. The details on how to perform this translation are captured by the compiled SLEIGH specification for the processor.
Structs§
- Address
- An address is represented by an offset into an address space
- Address
Space - Information about an address space
- Address
Space Id - Address space identifier for an address space. While this value is unique, it is NOT guaranteed to be deterministically constructed. This means different instances of Sleigh may identify the same address space with different identifiers.
- Assembly
Instruction - A disassembled native assembly instruction
- Ghidra
Sleigh - Sleigh instance that uses Ghidra libsla for its disassembly.
- Ghidra
Sleigh Builder - Builder for GhidraSleigh. The parameter
P
tracks whether the processor specification has been provided. - Native
Disassembly - Disassembly of an instruction into its native assembly
- Pcode
Disassembly - Disassembly of an instruction into pcode
- Pcode
Instruction - A pcode instruction. Interpreting the pcode instruction can require additional context in some cases. For example, the OpCode::Load operation encodes the AddressSpace using the AddressSpaceId. This identifier in particular may differ across Sleigh instances.
- Varnode
Data - A VarnodeData represents the address and size of data.
Enums§
- Address
Space Type - Types for an AddressSpace.
- Analysis
Op - Operations which are only generated by analysis programs. These operations are not permitted for use in processor specifications and therefore will never be emitted when directly translating machine instructions.
- BoolOp
- Operations for boolean, single-bit inputs.
- Error
- Errors returned by this crate. Note that APIs that may pass through FFI boundaries return String since those errors are ultimately serialized anyway.
- FloatOp
- Operations on floating-point numbers.
- HasSpec
- The sleigh or processor specification has been provided
- IntOp
- Operations on integers.
- IntSign
- Indicates whether an integer operation is operating on signed or unsigned inputs. If the
operation does not include
IntSign
as an argument, then distinguishing between signed and unsigned is not applicable for the operation. - Missing
Spec - The sleigh or processor specification has not yet been provided
- OpCode
- A representation of opcodes for p-code instructions.
- Pseudo
Op - Operations which represent black-box placeholders for some sequence of changes to the machine state.
- SlaData
Encoding - The encoding of the compiled sleigh specification (.slaspec).
Traits§
- Instruction
Loader - Interface for loading instruction bytes to be disassembled.
- Sleigh
- Interface for the Sleigh API. See GhidraSleigh for the Ghidra implementation.
Type Aliases§
- Result
- Result returned by Sleigh APIs