Binary Ninja Scripting

Binary Ninja Scripting is a skill for Claude Code, Codex from buzzer-re/Rikugan. It costs 17 tokens per session (2,835 once invoked), scanned A, original, MIT.

A scripting interface for Binary Ninja, a program used to inspect and reverse-engineer compiled software. It lets Python scripts work with the currently open binary and its analysis data.

In plain words
What is it for?
Use it to inspect functions and addresses, automate analysis, rename or retype items, create structures, and make other database changes in Binary Ninja.
Why use it?
It removes the need to perform repeated binary-analysis tasks manually in the user interface. Scripts can also handle searches, filtering, and larger changes more consistently.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/buzzer-re/rikugan/binja-scripting
Any agent
npx skills add buzzer-re/Rikugan --skill binja-scripting
Clone the repo
git clone --depth 1 https://github.com/buzzer-re/Rikugan

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Binary Ninja Scripting

README.md
[![agentmods](https://agentmods.dev/badge/skills/buzzer-re/rikugan/binja-scripting.svg)](https://agentmods.dev/skills/buzzer-re/rikugan/binja-scripting)
Your own site
<a href="https://agentmods.dev/skills/buzzer-re/rikugan/binja-scripting"><img src="https://agentmods.dev/badge/skills/buzzer-re/rikugan/binja-scripting.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,835 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00017 $0.02835
Opus 5 $0.00009 $0.01418
Sonnet 5 $0.00003 $0.00567
Haiku 4.5 $0.00002 $0.00283

Measured 5d ago against content hash 406542b25009, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Binary Ninja Scripting scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- Process execution (subprocess, os.system, etc.) is blocked. Static analysis only.
rikugan/skills/builtins/binja-scripting/SKILL.md · 315 lines

How it starts

The opening of the file, as written. The whole thing — 315 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Task: Help the user write Binary Ninja Python scripts. You have execute_python which runs code with bv (the current BinaryView), binaryninja module, and current_address pre-loaded.

Guidelines

  • Use print() for all output — it's captured and returned to you.
  • Prefer the Binary Ninja Python API over raw tool calls when the task requires iteration, filtering, or complex logic that a single tool can't express.
  • Always handle None returns (e.g., bv.get_function_at() returns None if no function at that address).
  • Use bv.update_analysis_and_wait() after bulk modifications (defining types, creating functions).
  • For large outputs, summarize or paginate — don't dump thousands of lines.
  • User types (define_user_*, add_user_*) persist to the database; auto types may be overwritten by analysis.
  • When modifying the database (renaming, retyping, creating structs), prefer _user_ methods.

Environment

The execute_python tool provides:

  • bv — the active BinaryView
  • binaryninja — the full binaryninja module
  • binaryninjaui — UI module (if available)
  • current_address — cursor address (int, 0 if unavailable)
  • Full Python stdlib (except subprocess/os.exec — blocked for safety)

Quick Reference

Reading Data

data = bv.read(addr, length)       # raw bytes
val = bv.read32(addr)              # 32-bit int
ptr = bv.read_pointer(addr)        # pointer-sized int
strings = bv.get_strings()         # all StringReference objects
s = bv.get_string_at(addr)         # single string

Functions

func = bv.get_function_at(addr)           # exact start
funcs = bv.get_functions_containing(addr) # containing addr
funcs = bv.get_functions_by_name("main")  # by name (list)
bv.add_user_function(addr)                # create function
func.name = "NewName"                     # rename
func.type = Type.function(ret, params)    # retype
func.set_comment_at(addr, "note")         # comment

IL Access

# Three levels: llil < mlil < hlil (prefer hlil for analysis)
for inst in func.hlil.instructions:
    print(f"{hex(inst.address)}: {inst}")

# SSA form for data flow
defn = func.hlil.ssa_form.get_ssa_var_definition(ssa_var)
uses = func.hlil.ssa_form.get_ssa_var_uses(ssa_var)

# Navigate between levels
llil_inst = func.get_llil_at(addr)
hlil_from_llil = llil_inst.hlil

Read the full file on GitHub · 315 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 315 lines · 17 tokens per session scan A 406542b25009

Subscribe to this mod's changes

Binary Ninja Scripting is a skill published in the GitHub repository buzzer-re/Rikugan (672 stars, last pushed 2mo ago), licensed MIT. It adds 17 tokens to every session and 2,835 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

python-docs

Comprehensive Python 3.13 reference covering all language features: variables, built-in types, strings, control flow, functions, lambdas, decorators, classes, inheritance, dataclasses, enums, metaclasses, collections (list, dict, set, tuple, comprehensions), modules and packages, pip, venv, exceptions, context…

pledgeandgrow/pledge-skills · 251 tokens

scripting-reference

Python for Rhino and Grasshopper (RhinoCommon, rhinoscriptsyntax, ghpythonlib), C# for Grasshopper components, Python for Revit (pyRevit, RevitPythonShell), JavaScript for web 3D (Three.js), and code patterns for AEC computational design.

Abhinavbwj/Claude-skills-for-Computational-Designers · 60 tokens

scripting-reference

Python for Rhino and Grasshopper (RhinoCommon, rhinoscriptsyntax, ghpythonlib), C# for Grasshopper components, Python for Revit (pyRevit, RevitPythonShell), JavaScript for web 3D (Three.js), and code patterns for AEC computational design.

marcinfinitesimal533/Claude-skills-for-Computational-Designers · 60 tokens

matlab

Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.

K-Dense-AI/scientific-agent-skills · 42 tokens

pennylane

Hardware-agnostic quantum ML framework with automatic differentiation. Use when training quantum circuits via gradients, building hybrid quantum-classical models, or needing device portability across IBM/Google/Rigetti/IonQ. Best for variational algorithms (VQE, QAOA), quantum neural networks, and integration with…

K-Dense-AI/scientific-agent-skills · 98 tokens

python-feature-lifecycle

Guidance for package and feature lifecycle in the Agent Framework Python codebase, including stage meanings, feature-stage decorators, feature enums, and how to move APIs from one stage to the next.

microsoft/agent-framework · 43 tokens