From 4bf13779d75176b6fba0c37fe3b614842bffa193 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Fri, 27 Feb 2026 18:31:39 -0800 Subject: [MachO] Fix relocations from chained fixups not respecting addends The addends were correctly stored in the relocation info and displayed as offsets in linear view, but the relocation handlers never applied them. Reading from an address containing such a relocation would give an incorrect value. --- arch/arm64/arch_arm64.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm64/arch_arm64.cpp') diff --git a/arch/arm64/arch_arm64.cpp b/arch/arm64/arch_arm64.cpp index fb623e4e..b71e79e8 100644 --- a/arch/arm64/arch_arm64.cpp +++ b/arch/arm64/arch_arm64.cpp @@ -2787,8 +2787,8 @@ class Arm64MachoRelocationHandler : public RelocationHandler // printf("reloc->GetAddress(): 0x%llX\n", reloc->GetAddress()); if (info.nativeType == BINARYNINJA_MANUAL_RELOCATION) - { // Magic number defined in MachOView.cpp for tagged pointers - *(uint64_t*)dest = info.target; + { // Magic number defined in MachOView.cpp for chained fixups + *(uint64_t*)dest = info.target + info.addend; } else if (info.nativeType == ARM64_RELOC_PAGE21) { -- cgit v1.3.1