From 25cc02431b61097b2adfc2fbc493b648b0300c3b Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Mon, 10 Mar 2025 11:05:40 -0400 Subject: [SharedCache] Refactor Shared Cache In absence of a better name, this commit refactors the shared cache code. --- view/sharedcache/core/MachOProcessor.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 view/sharedcache/core/MachOProcessor.h (limited to 'view/sharedcache/core/MachOProcessor.h') 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 m_view; + BinaryNinja::Ref m_logger; + std::shared_ptr m_vm; + + bool m_applyFunctions = true; + +public: + explicit SharedCacheMachOProcessor( + BinaryNinja::Ref view, std::shared_ptr vm); + + // Initialize header information such as sections and symbols. + void ApplyHeader(SharedCacheMachOHeader& header); + + uint64_t ApplyHeaderSections(SharedCacheMachOHeader& header); + + void ApplyHeaderDataVariables(SharedCacheMachOHeader& header); +}; -- cgit v1.3.1