Overview
Thebin_info.py example shows how to:
- Load a binary with minimal analysis modes
- Extract basic metadata (architecture, entry point, start address)
- List functions and strings
- Generate formatted reports
- Properly manage BinaryView file handles
Complete Source Code
Key Concepts Explained
This loads the binary with minimal analysis for faster processing. Use
'basic' mode when you only need function boundaries and basic disassembly.contents = "## %s ##\n" % os.path.basename(bv.file.filename)
contents += "- START: 0x%x\n\n" % bv.start
contents += "- ENTRY: 0x%x\n\n" % bv.entry_point
contents += "- ARCH: %s\n\n" % bv.arch.name
bv.start - Base address where binary is loadedbv.entry_point - Entry point addressbv.arch.name - Architecture namefunctions = list(bv.functions)
for i in range(min(10, len(functions))):
contents += "| 0x%x | %s |\n" % (functions[i].start, functions[i].symbol.full_name)
for i in range(min(10, len(bv.strings))):
start = bv.strings[i].start
length = bv.strings[i].length
string = bv.strings[i].value
start - Address where string is locatedlength - String length in bytesvalue - Actual string contentRunning the Example
Command Line Mode
Plugin Mode
When loaded as a plugin, it registers a command:- Open a binary in Binary Ninja
- Run
Tools > Binary Info - View the generated markdown report
Expected Output
Use Cases
- Quick Binary Triage - Rapidly assess binaries without full analysis
- Batch Processing - Process multiple binaries and extract metadata
- Report Generation - Create formatted reports for documentation
- Malware Analysis - Quick overview of suspicious files
Related Examples
- Function Iteration - Deep dive into function analysis
- Headless Automation - Automated binary processing