Vector35 / Vector35/binaryninja-api

Shared Cache / Kernel Cache views should stop using `AddUserSection`

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

Nobody has claimed this yet.

File Format: KernelCache File Format: SharedCache Impact: Low State: Blocked (Issue)
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

The Shared Cache / Kernel Cache views currently use AddUserSection when loading images. For example:

https://github.com/Vector35/binaryninja-api/blob/83e8981804afe6e7521ce59de55ab0736fb2a3bf/view/sharedcache/core/MachOProcessor.cpp#L249-L251

This is because the sections need to be persisted in the database.

A side-effect of AddUserSection is that an undo entry is created. This is problematic for performance if the calls happen on a background thread, and it's not clear that it's even desirable. Loading a single image from a shared cache might create 20 sections and thus 20 undo actions.

When an alternative API to AddUserSection is added that allows persistence of sections without creating undo actions, Shared Cache / Kernel Cache should switch to it. This may come as part of https://github.com/Vector35/binaryninja-api/issues/6742.

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 view/sharedcache/core/MachOProcessor.cpp around lines 249-251, then read issue #6742 for the alternative persistence API. Once that API is available, switch the Shared Cache and Kernel Cache view loading paths from AddUserSection; done means persisted sections no longer create undo actions.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, reverse-engineering
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.