summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/MachOProcessor.h
blob: 4b014f4ed484439e57fda7971487e62f275e7a14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once
#include "MachO.h"
#include "SharedCache.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(const SharedCache& cache, SharedCacheMachOHeader& header);

	uint64_t ApplyHeaderSections(SharedCacheMachOHeader& header);

	void ApplyHeaderDataVariables(SharedCacheMachOHeader& header);
};