archinfo

9.2.209 · active · verified Mon Apr 13

archinfo is a Python library providing classes with architecture-specific information essential for cross-architecture tools. It serves as a foundational component within the larger angr binary analysis framework, defining architectural details like register mappings, endianness, and instruction set properties. The library is actively maintained, with frequent minor updates, and is currently at version 9.2.209.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to obtain the host system's architecture information and how to instantiate a specific architecture class, such as AMD64. It then prints basic properties of these architecture objects, including name, bitness, endianness, and key register names.

from archinfo import get_host_arch, ArchAMD64

# Get the architecture of the host machine
host_arch = get_host_arch()
print(f"Host Architecture: {host_arch.name} ({host_arch.bits}-bit, {host_arch.memory_endness.name} endian)")

# Instantiate a specific architecture (e.g., AMD64)
x86_64_arch = ArchAMD64()
print(f"AMD64 Architecture: {x86_64_arch.name} ({x86_64_arch.bits}-bit, {x86_64_arch.memory_endness.name} endian)")
print(f"Instruction Pointer Register: {x86_64_arch.ip_name}")
print(f"Stack Pointer Register: {x86_64_arch.sp_name}")

view raw JSON →