Vector35 / Vector35/binaryninja-api

Comments API does not have an "auto" equivelent

Open
#7,051 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Read this first: https://github.com/Vector35/binaryninja-api/issues/6742

We currently have is the ability to add comments at places in a view through these functions:

  • BinaryView::SetCommentForAddress
  • Function::SetComment
  • Function::SetCommentForAddress

These three functions not only set the comment at a location, they also add an undo action, which basically means that these apis were never designed to be called by analysis (by which i mean, a workflow activity or binary view init). We have two problems:

  1. We cannot set comments when we are initializing the view, as doing so is prohibited by the undo buffer.
  2. Function comments are not ephemeral, meaning if you have a activity add a comment they will be persisted across analysis updates, this is an issue for WARP as we set the comments within an activity, meaning they never go away if you disable the application of a WARP signature.

The resolution to this should not include consolidating view and function comments, as 2 requires that they be tied to the function object to be properly cleared.

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 by reading linked issue #6742, then inspect the existing BinaryView::SetCommentForAddress, Function::SetComment, and Function::SetCommentForAddress APIs and their undo behavior. The design is complete when analysis can create comments during view initialization without undo actions, and activity-created function comments are removed when the activity is disabled without consolidating view and function comments.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, reverse-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.