Developer knowledge network · moderated exchange

مجتمع الكود غير الموثوق به

أبحاث المطورين، مجتمع الهندسة العكسية والترميز

Knowledge indexيعيش
4Categories
919Threads
2.8Kدعامات
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
مندوب: 181
تاريخ الانضمام: Jul 2019
دعامات: 21
شكرًا: 50
1 months ago · 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
مندوب: 215
تاريخ الانضمام: Mar 2018
دعامات: 86
شكرًا: 61
1 months ago · 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
مندوب: 99
تاريخ الانضمام: Sep 2022
دعامات: 14
شكرًا: 16
1 months ago · Jul 7, 2026 9:38 PM
#3

Clean assembly encoding breakdown.