{"id":5113,"library":"archinfo","title":"archinfo","description":"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.","status":"active","version":"9.2.209","language":"en","source_language":"en","source_url":"https://github.com/angr/archinfo","tags":["architecture","binary analysis","angr","reverse engineering","low-level"],"install":[{"cmd":"pip install archinfo","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required for core functionality, likely for enum backporting.","package":"backports-strenum","optional":false}],"imports":[{"note":"Import a specific architecture class.","symbol":"ArchAMD64","correct":"from archinfo import ArchAMD64"},{"note":"Utility function to detect and return the current host architecture.","symbol":"get_host_arch","correct":"from archinfo import get_host_arch"},{"note":"Import the base Arch class for custom architecture definitions or type checking.","symbol":"Arch","correct":"from archinfo.arch import Arch"}],"quickstart":{"code":"from archinfo import get_host_arch, ArchAMD64\n\n# Get the architecture of the host machine\nhost_arch = get_host_arch()\nprint(f\"Host Architecture: {host_arch.name} ({host_arch.bits}-bit, {host_arch.memory_endness.name} endian)\")\n\n# Instantiate a specific architecture (e.g., AMD64)\nx86_64_arch = ArchAMD64()\nprint(f\"AMD64 Architecture: {x86_64_arch.name} ({x86_64_arch.bits}-bit, {x86_64_arch.memory_endness.name} endian)\")\nprint(f\"Instruction Pointer Register: {x86_64_arch.ip_name}\")\nprint(f\"Stack Pointer Register: {x86_64_arch.sp_name}\")","lang":"python","description":"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."},"warnings":[{"fix":"Always ensure archinfo is installed with a compatible version of pyvex and other angr components. Consult angr's migration guides for specific breaking changes related to architecture definitions or register handling if issues arise after an upgrade.","message":"Internal architecture definitions, especially register file offsets and VEX IR assumptions, are tightly coupled with PyVEX. Major updates to PyVEX or the angr framework may introduce breaking changes to how these internal structures are defined or accessed, even if the public archinfo API remains superficially similar.","severity":"breaking","affected_versions":"All versions, particularly across major angr/pyvex releases."},{"fix":"For projects leveraging angr, install 'angr' as a whole via pip, which will pull in compatible versions of its dependencies including archinfo. If using archinfo standalone, carefully manage its version to match the expectations of any dependent libraries.","message":"archinfo is a core library within the angr ecosystem. Using mismatched versions of archinfo with other angr components (like pyvex, cle, or claripy) can lead to subtle runtime errors, incorrect architectural interpretations, or crashes due to inconsistent internal representations.","severity":"gotcha","affected_versions":"All versions, especially when used outside of a unified angr installation."}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}