Indirect memory access

Creator
Creator
Seonglae Cho
Created
Created
2024 May 22 5:33
Editor
Edited
Edited
2024 Sep 19 13:54
Refs
Refs
usually bracket in assembly language
Indirect memory access is a bottleneck for modern CPUs
Like pointer, interpreted as address
inc rax ; increment rax register inc [rax] ; increment value in rax address
  • Base: starting address of reference
  • Index: offset from base address
  • Scale: Constant multiplier of index
  • Displacement: Constant base
Address=base+indexscale+displacementAddress = base + index*scale + displacement
mov edx, [rdx+rcx*4]
 

Attacks via indirect jumps and function calls

  • Return addresses in stack are not the only code pointers that can be corrupted.
  • Indirect jumps and indirect function calls also jump to the code that code pointers point to
 
 
 
 
 

Recommendations