Developer knowledge network · moderated exchange

Społeczność UnreliableCode

Badania programistów, inżynieria wsteczna i społeczność programistów

Knowledge indexNa żywo
4Categories
919Threads
2.8KPosty
Guide

Calculating 64-bit RIP-Relative 5-Byte Direct vs 14-Byte Indirect Jumps in x64 [v2.4 Technical Discussion]

hook_doctor
Hooking Specialist
MEMBER
Rozpustnik: 181
Data dołączenia: Jul 2019
Posty: 21
Dzięki: 50
1 miesięcy temu · Jul 7, 2026 3:07 AM
#1

Why 64-bit hooks fail when target functions are > 2GB away in virtual address space:

  1. 5-Byte JMP (E9 [disp32]):
    $$\text{disp32} = \text{TargetAddress} - (\text{HookAddress} + 5)$$
    Limited to $\pm 2\text{GB}$ range from instruction pointer.
  2. 14-Byte Absolute Indirect JMP:
ASM
   FF 25 00 00 00 00       ; jmp qword ptr [rip + 0]
   AA BB CC DD EE FF 00 11 ; 64-bit Target Absolute Pointer

Reaches any 64-bit address anywhere in virtual RAM without register clobbering!

vtable_slayer
Senior Reverser
MEMBER
Rozpustnik: 215
Data dołączenia: Mar 2018
Posty: 86
Dzięki: 61
1 miesięcy temu · Jul 7, 2026 7:43 AM
#2

Using a 14-byte indirect jump eliminates the need to allocate trampolines within 2GB of the target module. Great explanation.

x64_assembler
Assembly Guru
MEMBER
Rozpustnik: 99
Data dołączenia: Sep 2022
Posty: 14
Dzięki: 16
1 miesięcy temu · Jul 7, 2026 9:38 PM
#3

Clean assembly encoding breakdown.