summaryrefslogtreecommitdiff
path: root/view/macho/machoview.cpp
diff options
context:
space:
mode:
authorHongyu Chen <hongyu@vector35.com>2025-06-30 00:01:59 -0400
committerGalen Williamson <galen@vector35.com>2025-07-02 12:43:12 -0400
commit68672b4438a962e837067c719188995844746200 (patch)
tree6814d988caad9b3ef49173fecf23c75017de6d80 /view/macho/machoview.cpp
parent02f114a425f6af78ef2e5d4f5b41157541842a34 (diff)
Added no export trie data detection.
Diffstat (limited to 'view/macho/machoview.cpp')
-rw-r--r--view/macho/machoview.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/view/macho/machoview.cpp b/view/macho/machoview.cpp
index a58fd556..e4be6c7b 100644
--- a/view/macho/machoview.cpp
+++ b/view/macho/machoview.cpp
@@ -696,14 +696,18 @@ MachOHeader MachoView::HeaderForAddress(BinaryView* data, uint64_t address, bool
header.dyldInfo.export_size = reader.Read32();
header.exportTrie.dataoff = header.dyldInfo.export_off;
header.exportTrie.datasize = header.dyldInfo.export_size;
- header.exportTriePresent = true;
+ // Only mark export trie as present if there's actually data
+ if (header.dyldInfo.export_off != 0 && header.dyldInfo.export_size != 0)
+ header.exportTriePresent = true;
header.dyldInfoPresent = true;
break;
case LC_DYLD_EXPORTS_TRIE:
m_logger->LogDebug("LC_DYLD_EXPORTS_TRIE\n");
header.exportTrie.dataoff = reader.Read32();
header.exportTrie.datasize = reader.Read32();
- header.exportTriePresent = true;
+ // Only mark export trie as present if there's actually data
+ if (header.exportTrie.dataoff != 0 && header.exportTrie.datasize != 0)
+ header.exportTriePresent = true;
break;
case LC_THREAD:
case LC_UNIXTHREAD: