File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2787,8 +2787,8 @@ class Arm64MachoRelocationHandler : public RelocationHandler
27872787 // printf("reloc->GetAddress(): 0x%llX\n", reloc->GetAddress());
27882788
27892789 if (info.nativeType == BINARYNINJA_MANUAL_RELOCATION)
2790- { // Magic number defined in MachOView.cpp for tagged pointers
2791- *(uint64_t *)dest = info.target ;
2790+ { // Magic number defined in MachOView.cpp for chained fixups
2791+ *(uint64_t *)dest = info.target + info. addend ;
27922792 }
27932793 else if (info.nativeType == ARM64_RELOC_PAGE21)
27942794 {
Original file line number Diff line number Diff line change @@ -2684,8 +2684,8 @@ class ArmMachORelocationHandler: public RelocationHandler
26842684 {
26852685 auto info = reloc->GetInfo ();
26862686 if (info.nativeType == BINARYNINJA_MANUAL_RELOCATION)
2687- { // Magic number defined in MachOView.cpp for tagged pointers
2688- *(uint32_t *)dest = (uint32_t )info.target ;
2687+ { // Magic number defined in MachOView.cpp for chained fixups
2688+ *(uint32_t *)dest = (uint32_t )( info.target + info. addend ) ;
26892689 }
26902690
26912691 return true ;
Original file line number Diff line number Diff line change @@ -4117,10 +4117,10 @@ class x86MachoRelocationHandler: public RelocationHandler
41174117 case (uint64_t )-1 : // Magic number defined in MachOView.cpp
41184118 // We need to write a jump absolute `jmp target`
41194119 dest[0 ] = ' \xe9 ' ;
4120- ((uint32_t *)&dest[1 ])[0 ] = target - (uint32_t )reloc->GetAddress () - 5 ;
4120+ ((uint32_t *)&dest[1 ])[0 ] = target + ( uint32_t )info. addend - (uint32_t )reloc->GetAddress () - 5 ;
41214121 break ;
41224122 case (uint64_t )-2 : // Magic number defined in MachOView.cpp
4123- dest32[0 ] = target;
4123+ dest32[0 ] = target + ( uint32_t )info. addend ;
41244124 break ;
41254125 case GENERIC_RELOC_VANILLA:
41264126 switch (info.size )
@@ -4307,7 +4307,7 @@ class x64MachoRelocationHandler: public RelocationHandler
43074307 dest64[0 ] = dest64[0 ] + info.next ->target - target;
43084308 break ;
43094309 case (uint64_t ) -2 :
4310- dest64[0 ] = reloc-> GetTarget () ;
4310+ dest64[0 ] = info. target + info. addend ;
43114311 break ;
43124312 }
43134313 return true ;
You can’t perform that action at this time.
0 commit comments