Skip to content

Add Binja headless support, Binja MCP support and support to traverse folders (apps) - #17

Merged
buzzer-re merged 4 commits into
mainfrom
dev
Oct 14, 2026
Merged

buzzer-re merged 4 commits into
mainfrom
dev

Conversation

@buzzer-re

Copy link
Copy Markdown
Owner

No description provided.

buzzer-re and others added 4 commits October 6, 2026 11:24
`tocode <folder>` exports every binary in a directory (app folders,
macOS .app bundles, .NET publish output) in load order, one isolated
process per binary, resumable, and links them using only import/load
tables and each platform's loader rules:

- links/: pure-Python ELF, PE, Mach-O (fat, chained fixups, bind
  opcodes, export trie) and .NET metadata readers; loader-rule
  resolution (@rpath/@loader_path, RPATH/RUNPATH/SONAME, app directory,
  KnownDLLs/API sets, assembly probing, P/Invoke); symbol binding
  (two-level namespace and re-exports, ELF versions and global scope,
  PE ordinals and forwarders, .NET member refs by signature).
- folder_links: maps bound imports to the defining function's file and
  line range, finds importer call sites, writes mappings.json and
  enriches imports.json/functions.json/exports.json.
- folder_annotate: line-stable /* tocode-link: */ source comments.
- Master AGENTS.md, project.json, inventory.json, dependency-graph.json.
- CLI: directory input, --only/--exclude, --no-managed, --arch, --plan,
  --links-only; two-bar progress display, nested logs go to tocode.log.

Also: IDA records PE calls through the IAT as import calls, project.json
and export-manifest.json carry image_base, isolated export processes die
with their parent, and the .NET export can skip P/Invoke neighbours.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Headless: BinjaHeadlessSession loads the input with the binaryninja API in
  process (files, folders, APK .so, .NET native code, .bndb input), caches the
  analysis as a .bndb for re-runs and render workers, and ships it with the
  export. auto picks it after IDA and falls back when the license refuses
  headless use.
- A core that crashes in create_database is detected once in a child process;
  the export then renders in process without a .bndb. An empty or incomplete
  cached database (left by a crashed save) is discarded and rebuilt.
- --binja-license / TOCODE_BINJA_LICENSE hands a license file to the core
  (core_set_license) in every process; its contents are never logged.
- MCP: a standard-library MCP client and BinjaMcpSession over Binary Ninja 6's
  built-in server (--binja-transport, --binja-mcp-url).
- Strip Binary Ninja gutter glyphs from every rendered line.
- Tests run against a fake on-disk binaryninja API and a fake MCP server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Trim implementation detail from the Binary Ninja and APK native sections and
move the resume note out of the example's code block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@buzzer-re
buzzer-re merged commit 20e314a into main Oct 14, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant