Vector35 / Vector35/binaryninja-api

Persistent data notifications from Rust API

Open
#7,890 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Rust API Effort: Trivial Impact: Medium
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

Current state of data notifications in Rust API:

https://github.com/Vector35/binaryninja-api/blob/6e50ceda4e65e5952e59449fad4953ea6c5aaf37/rust/tests/data_notification.rs#L16-L33

The custom is of type DataNotificationHandle which is defined as:

https://github.com/Vector35/binaryninja-api/blob/ca0e32efb1e5b9eba157e9fd2eef178d9367c578/rust/src/data_notification.rs#L414-L421

This means that we are holding a strong reference to the view (for the purposes of dropping the data notification when custom is dropped) which inhibits the ability to leak the custom handle to persist the data notifications, we need to address this somehow to make using data notifications in Rust API more user friendly and less of a footgun.

One idea would be to provide an alternate register API that does not return a handle containing a strong reference to the view, or instead hold a weak reference to the view (but that is very difficult to do).

See this example for a motivating reason.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with rust/tests/data_notification.rs#L16-L33 and rust/src/data_notification.rs#L414-L421 to understand how DataNotificationHandle retains the view, then review the linked motivating example. Define and test a persistent-notification approach that avoids the current strong-reference limitation while preserving safe cleanup behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.