binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

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

Open bdash opened this issue 7 months ago • 0 comments

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.

bdash avatar Jul 09 '25 18:07 bdash