summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/MachOProcessor.h
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-03-10 11:05:40 -0400
committerMason Reed <mason@vector35.com>2025-04-02 05:36:54 -0400
commit25cc02431b61097b2adfc2fbc493b648b0300c3b (patch)
treea79d9c4f4f67234d3bf9bda413e8608f479a4cc8 /view/sharedcache/core/MachOProcessor.h
parentfa85bf28502286c4821427c5d0ed91a7ed46f8f6 (diff)
[SharedCache] Refactor Shared Cache
In absence of a better name, this commit refactors the shared cache code.
Diffstat (limited to 'view/sharedcache/core/MachOProcessor.h')
-rw-r--r--view/sharedcache/core/MachOProcessor.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/view/sharedcache/core/MachOProcessor.h b/view/sharedcache/core/MachOProcessor.h
new file mode 100644
index 00000000..0564a831
--- /dev/null
+++ b/view/sharedcache/core/MachOProcessor.h
@@ -0,0 +1,23 @@
+#pragma once
+#include "MachO.h"
+
+// Process `SharedCacheMachOHeader`.
+class SharedCacheMachOProcessor
+{
+ BinaryNinja::Ref<BinaryNinja::BinaryView> m_view;
+ BinaryNinja::Ref<BinaryNinja::Logger> m_logger;
+ std::shared_ptr<VirtualMemory> m_vm;
+
+ bool m_applyFunctions = true;
+
+public:
+ explicit SharedCacheMachOProcessor(
+ BinaryNinja::Ref<BinaryNinja::BinaryView> view, std::shared_ptr<VirtualMemory> vm);
+
+ // Initialize header information such as sections and symbols.
+ void ApplyHeader(SharedCacheMachOHeader& header);
+
+ uint64_t ApplyHeaderSections(SharedCacheMachOHeader& header);
+
+ void ApplyHeaderDataVariables(SharedCacheMachOHeader& header);
+};