{"library":"pypcode","title":"pypcode","description":"pypcode is a Python binding for Ghidra's SLEIGH library, providing machine code disassembly and intermediate representation (IR) translation. Version 3.3.3 supports Python >=3.10. Development on GitHub under the angr project, with periodic releases aligned with Ghidra updates.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install pypcode"],"cli":null},"imports":["import pypcode","from pypcode import Arch","from pypcode import Context"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pypcode\n\n# List supported architectures\nprint(pypcode.Arch.list())\n\n# Create a context for x86-64 (default little endian)\nctx = pypcode.Context.by_name(\"x86:LE:64:default\")\n\n# Set the spec (architecture specification)\nctx.set_spec(\"x86:LE:64:default\")\n\n# Disassemble some bytes\ncode = bytes([0x48, 0x89, 0xe5, 0x48, 0x83, 0xec, 0x10])\nctx.disassemble(code, base=0x4000)\n\n# Get disassembly lines\nfor line in ctx.disassembly_lines():\n    print(line)","lang":"python","description":"Initialize a disassembly context for x86-64, disassemble a few bytes, and print the disassembly.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}