From 941b8b63c02184b4708d85391c5348b8d8913628 Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Thu, 10 Apr 2025 13:27:34 -0400 Subject: Avoid MH_FILESET in Mach-O view during magic check. --- view/macho/fatmachoview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'view/macho/fatmachoview.cpp') diff --git a/view/macho/fatmachoview.cpp b/view/macho/fatmachoview.cpp index de9b755b..83499fb6 100644 --- a/view/macho/fatmachoview.cpp +++ b/view/macho/fatmachoview.cpp @@ -210,8 +210,8 @@ bool FatMachoViewType::IsTypeValidForData(BinaryView* data) if (!ExtractFatArchForCPU(data, arch, m_cputype, m_cpusubtype)) return false; - // MachoView::IsMacho only considers the magic header, so we can load only that - DataBuffer buffer = data->ReadBuffer(arch.offset, 4); + // MachoView::IsMacho needs to inspect the full header + DataBuffer buffer = data->ReadBuffer(arch.offset, sizeof(mach_header)); Ref newData = new BinaryData(data->GetFile(), std::move(buffer)); Ref attemptedViewType = FatViewTypeForData(newData); -- cgit v1.3.1