Skip to content

Add binary name retrieval for project files#63

Open
jeffmcjunkin wants to merge 2 commits into
fosdickio:mainfrom
jeffmcjunkin:add-binary-name-retrieval
Open

Add binary name retrieval for project files#63
jeffmcjunkin wants to merge 2 commits into
fosdickio:mainfrom
jeffmcjunkin:add-binary-name-retrieval

Conversation

@jeffmcjunkin
Copy link
Copy Markdown

@jeffmcjunkin jeffmcjunkin commented Feb 5, 2026

Summary

  • Extract original binary name from BinaryView.file.project_file.name, stripping .bndb suffix when present
  • Fixes display issues when using Binary Ninja projects (.bnpr) where file.filename returns internal project paths instead of the original binary name (e.g., notepad.exe instead of C:\Users...\project.bnpr\data\a5\d7a69c-...)

Changes

  • Add _get_binary_name() helper in plugin/core/binary_operations.py
  • Include binary_name in get_status() and list_open_binaries() responses
  • Update _format_binary_listing() to include binary name in selectors
  • Update MCP tools (get_binary_status, list_binaries) to prominently display binary names

Test plan

  • Call get_binary_status MCP tool with a project file open - should show original binary name
  • Call list_binaries - should show binary names for all loaded binaries
  • Verify ruff check and ruff format --check pass

Generated with Claude Code (https://claude.ai/claude-code)

Extract original binary name from BinaryView.file.project_file.name,
stripping .bndb suffix when present. This fixes display issues when
using Binary Ninja projects (.bnpr) where file.filename returns
internal project paths instead of the original binary name.

Changes:
- Add _get_binary_name() helper in binary_operations.py
- Include binary_name in get_status() and list_open_binaries()
- Update MCP tools to prominently display binary names

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 5, 2026 04:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds functionality to extract and display original binary names from Binary Ninja project files, fixing display issues where internal project paths (ending in .bndb) were shown instead of the original binary names.

Changes:

  • Added _get_binary_name() helper method that extracts original binary names from project files by stripping .bndb suffix
  • Updated status and binary listing endpoints to include binary_name field
  • Enhanced MCP tools to prominently display original binary names instead of project file paths

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
plugin/core/binary_operations.py Added _get_binary_name() method and updated list_open_binaries() to include binary_name in returned data
plugin/api/endpoints.py Updated get_status() to include binary_name and added binary_name to binary listing selectors
bridge/binja_mcp_bridge.py Enhanced get_binary_status() and list_binaries() MCP tools to display binary names prominently

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugin/core/binary_operations.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jeffmcjunkin
Copy link
Copy Markdown
Author

The Copilot suggestion is reasonable, I suppose. @fosdickio , are you open to this small PR? When doing agentic workflows it seems odd that, for example, Claude Code can't reliably determine the binary's name.

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.

2 participants