From 828fff839f4e4de3e9582405dfec567531000ebc Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Wed, 6 Mar 2024 19:20:34 -0500 Subject: Move view modules into the API repo --- view/macho/fatmachoview.h | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 view/macho/fatmachoview.h (limited to 'view/macho/fatmachoview.h') 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 +#include +#include + +#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 Create(BinaryView* data) override; + virtual bool IsTypeValidForData(BinaryView* data) override; + virtual bool IsDeprecated() override { return true; } + }; + + void InitFatMachoViewType(); +} -- cgit v1.3.1