summaryrefslogtreecommitdiff
path: root/view/macho/fatmachoview.h
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2024-03-06 19:20:34 -0500
committerRusty Wagner <rusty.wagner@gmail.com>2024-03-06 19:20:34 -0500
commit828fff839f4e4de3e9582405dfec567531000ebc (patch)
treeee0db0607edb0c76c653078672201c85e8a96d19 /view/macho/fatmachoview.h
parent47894a1ce20090849ad304c68e6c0b889665eda3 (diff)
Move view modules into the API repo
Diffstat (limited to 'view/macho/fatmachoview.h')
-rw-r--r--view/macho/fatmachoview.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/view/macho/fatmachoview.h b/view/macho/fatmachoview.h
new file mode 100644
index 00000000..575d3884
--- /dev/null
+++ b/view/macho/fatmachoview.h
@@ -0,0 +1,50 @@
+#pragma once
+
+#include <exception>
+#include <vector>
+#include <string.h>
+
+#include "binaryninjaapi.h"
+#include "machoview.h"
+
+namespace BinaryNinja
+{
+ struct fat_header
+ {
+ uint32_t magic;
+ uint32_t nfat_arch;
+ };
+
+ struct fat_arch
+ {
+ cpu_type_t cputype;
+ cpu_subtype_t cpusubtype;
+ uint32_t offset;
+ uint32_t size;
+ uint32_t align;
+ };
+
+ struct fat_arch_64
+ {
+ cpu_type_t cputype;
+ cpu_subtype_t cpusubtype;
+ uint64_t offset;
+ uint64_t size;
+ uint32_t align;
+ uint32_t reserved;
+ };
+
+ class FatMachoViewType: public BinaryViewType
+ {
+ cpu_type_t m_cputype;
+ cpu_subtype_t m_cpusubtype;
+
+ public:
+ FatMachoViewType(const std::string& name, const std::string& long_name, cpu_type_t cputype, cpu_subtype_t cpusubtype);
+ virtual Ref<BinaryView> Create(BinaryView* data) override;
+ virtual bool IsTypeValidForData(BinaryView* data) override;
+ virtual bool IsDeprecated() override { return true; }
+ };
+
+ void InitFatMachoViewType();
+}