{"library":"pyghidra","title":"pyghidra","description":"pyghidra is a Python package that provides a native CPython interface for Ghidra, the NSA's reverse engineering framework. Current version 3.0.2 supports Ghidra 12.x and requires Python >=3.9. It enables scripting Ghidra with standard Python and accessing its API directly within the Ghidra GUI or headlessly.","language":"python","status":"active","last_verified":"Sat May 09","install":{"commands":["pip install pyghidra"],"cli":null},"imports":["import pyghidra","pyghidra.start()","from ghidra.program.model.listing import Function as GhidraFunction"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pyghidra\nimport os\n\ndef analyze_binary():\n    binary_path = os.environ.get('BINARY_PATH', '/bin/ls')\n    with pyghidra.start(binary_path) as ctx:\n        program = ctx.getCurrentProgram()\n        print(f\"Analyzing: {program.getName()}\")\n        funcs = program.getFunctionManager().getFunctions(True)\n        for func in funcs:\n            print(func.getName())\n\nif __name__ == '__main__':\n    analyze_binary()","lang":"python","description":"Start Ghidra headlessly, load a binary, and iterate over its functions.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}