Skip to content

Commit 79a26d5

Browse files
committed
Explain why original shared cache files are needed.
1 parent 5763682 commit 79a26d5

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

docs/guide/sharedcache.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,27 @@ To load the shared cache, open the **Primary** file in Binary Ninja. In the exam
5353
???+ Danger "Warning"
5454
Opening any other file (e.g. `dyld_shared_cache_arm64.01`) will result in a partial shared cache, with only the information present in the file you opened.
5555

56+
### Original Cache Files Are Required
57+
58+
Unlike other binaries, when you save an analysis database (`.bndb`) for the shared cache, Binary Ninja will not include the original files in the database. As a result, reopening the database still requires access to the `dyld_shared_cache` file and any related cache files in the same set.
59+
60+
This is required even if you previously loaded only a small number of images because Binary Ninja re-parses the shared cache headers on load and analysis may need information from images that were not previously loaded into the view. For example, names for external symbols can be defined by other images in the cache, so metadata from other files than the images you explicitly loaded may be needed.
61+
62+
If Binary Ninja cannot find the primary shared cache file when reopening a database, it may ask you to select it. Select the original primary `dyld_shared_cache` file, not another `.bndb` database.
63+
64+
When running without the UI, Binary Ninja will try and resolve the primary file automatically (or use `loader.dsc.primaryFilePath`, if provided). If the provided path is invalid or missing, and the primary shared cache file can't be found automatically, the database won't load. An example of specifying the location manually is:
65+
66+
```python
67+
from binaryninja import load
68+
69+
bv = load(
70+
"your_database.bndb",
71+
options={"loader.dsc.primaryFilePath": "/path/to/dyld_shared_cache_arm64"},
72+
)
73+
```
74+
75+
Note: `loader.dsc.primaryFilePath` is used only for the *current* load. Binary Ninja stores the primary cache file's basename in the database, but not the absolute path. If the primary shared cache file is in another directory and can't be found automatically, you may need to specify the `primaryFilePath` on subsequent loads.
76+
5677
### Project Support
5778

5879
Binary Ninja projects support `dyld_shared_cache` files. However, due to the nature of the project files not having a mappable path,
@@ -66,6 +87,7 @@ every open of the database. As a result, we advise keeping your analysis databas
6687
- `dyld_shared_cache_arm64.symbols` (Symbols, optional)
6788
- `your_database.bndb` (This is recommended)
6889

90+
6991
## Interacting With a Shared Cache
7092

7193
After opening a `dyld_shared_cache`, you will be provided a supercharged binary view: one which has information not only from

0 commit comments

Comments
 (0)