summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/MachO.h
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-04-13 00:47:36 -0400
committerMason Reed <mason@vector35.com>2025-04-14 03:20:51 -0400
commitea47d4c85e78533ea7e88adc442159414feb3f7f (patch)
tree801cd657bf7872d02cb783f8ee0f25b3f5ecad1c /view/sharedcache/core/MachO.h
parent83dc0ef0eea5face59d8a58251f78f32f3e6c914 (diff)
[SharedCache] Apply .symbols file information when applying an image
This improves symbol recovery drastically on newer shared caches Related PR: https://github.com/Vector35/binaryninja-api/pull/6210
Diffstat (limited to 'view/sharedcache/core/MachO.h')
-rw-r--r--view/sharedcache/core/MachO.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/view/sharedcache/core/MachO.h b/view/sharedcache/core/MachO.h
index 8508edbf..d3a720a9 100644
--- a/view/sharedcache/core/MachO.h
+++ b/view/sharedcache/core/MachO.h
@@ -7,6 +7,15 @@
struct CacheSymbol;
+// Used when reading symbol/string table info.
+struct TableInfo
+{
+ // VM address where the reading will begin.
+ uint64_t address;
+ // Number of entries in the table.
+ uint32_t entries;
+};
+
struct SharedCacheMachOHeader
{
uint64_t textBase = 0;
@@ -61,8 +70,7 @@ struct SharedCacheMachOHeader
static std::optional<SharedCacheMachOHeader> ParseHeaderForAddress(
std::shared_ptr<VirtualMemory> vm, uint64_t address, const std::string& imagePath);
- // TODO: Replace view with address size?
- std::vector<CacheSymbol> ReadSymbolTable(BinaryNinja::BinaryView& view, VirtualMemory& vm) const;
+ std::vector<CacheSymbol> ReadSymbolTable(VirtualMemory& vm, const TableInfo &symbolInfo, const TableInfo &stringInfo) const;
bool AddExportTerminalSymbol(
std::vector<CacheSymbol>& symbols, const std::string& symbolName, const uint8_t* current,