Architecture class is the base class for all CPU architectures in Binary Ninja. It provides disassembly, assembly, patching, and IL translation capabilities for a given architecture.
Class Declaration
Defined inbinaryninjaapi.h:9490
Getting Architecture Instances
Get by Name
Get All Architectures
Architecture Properties
Get Name
Get Endianness
LittleEndian- Little-endian byte orderBigEndian- Big-endian byte order
Get Address Size
Get Default Integer Size
Get Instruction Alignment
Get Max Instruction Length
Disassembly
Get Instruction Info
data- Pointer to instruction bytesaddr- Virtual address of the instructionmaxLen- Maximum number of bytes to decoderesult- Output InstructionInfo structure
Get Instruction Text
Get Instruction Low-Level IL
Registers
Get Register Name
Get All Registers
Get Register Info
fullWidthRegister- The full-width version of this registersize- Size of the register in bytesoffset- Offset within the full-width register
Special Registers
Flags
Get Flag Name
Get All Flags
Get Flag Role
SpecialFlagRoleZeroFlagRolePositiveSignFlagRoleNegativeSignFlagRoleCarryFlagRoleOverflowFlagRole
Assembly
Check Assembly Support
Assemble
Code Patching
Check Patch Availability
Apply Patches
Creating Custom Architectures
You can create custom architecture support by subclassingArchitecture:
Complete Disassembly Example
Simple command-line disassembler from the cmdline_disasm example:See Also
- BinaryView Class - Binary file interface
- Function Class - Function analysis
- IL Classes - Intermediate language representations