From 56da69aa61654521424cf1af87bcce41a1c0df01 Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Tue, 17 Feb 2026 07:20:51 -0500 Subject: Handle Universal binaries through container transform system. --- view/macho/universaltransform.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 view/macho/universaltransform.h (limited to 'view/macho/universaltransform.h') diff --git a/view/macho/universaltransform.h b/view/macho/universaltransform.h new file mode 100644 index 00000000..2d54d65e --- /dev/null +++ b/view/macho/universaltransform.h @@ -0,0 +1,24 @@ +#pragma once + +#include "binaryninjaapi.h" +#include "machoview.h" + +namespace BinaryNinja +{ + void InitUniversalTransform(); + + class UniversalTransform : public Transform + { + public: + static const std::map, std::string>& GetArchitectures(); + static std::string ArchitectureToString(cpu_type_t cpuType, cpu_subtype_t cpuSubType, bool& is64Bit); + static bool ParseHeaders(Ref data, FatHeader& fatHeader, std::vector& fatArchEntries, bool& isFat64, std::string& errorMsg); + + UniversalTransform(); + + virtual bool Decode(const DataBuffer& input, DataBuffer& output, const std::map& params) override; + virtual bool DecodeWithContext(Ref context, const std::map& params) override; + virtual bool Encode(const DataBuffer& input, DataBuffer& output, const std::map& params) override; + virtual bool CanDecode(Ref input) const override; + }; +} -- cgit v1.3.1