fixing some comments

This commit is contained in:
Lysann Tranvouez 2025-10-01 22:14:43 +02:00
parent 9f1f93d9e4
commit ccaa4bfbf0

View file

@ -12,12 +12,11 @@ typedef struct detour_trampoline
// An ARM64 instruction is 4 bytes long.
//
// The overwrite is always composed of 3 instructions (12 bytes) which perform an indirect jump
// using _DETOUR_TRAMPOLINE::pbDetour as the address holding the target location.
// using detour_trampoline::ptr_detour as the address holding the target location.
//
// Copied instructions can expand.
//
// The scheme using MovImmediate can cause an instruction
// to grow as much as 6 times.
// The scheme using MovImmediate can cause an instruction to grow as much as 6 times.
// That would be Bcc or Tbz with a large address space:
// 4 instructions to form immediate
// inverted tbz/bcc
@ -27,11 +26,11 @@ typedef struct detour_trampoline
// 3 instructions to form immediate
// br or brl
//
// A theoretical maximum for rbCode is thefore 4*4*6 + 16 = 112 (another 16 for jmp to pbRemain).
// A theoretical maximum for `code` is therefore 4*4*6 + 16 = 112 (another 16 for jmp to ptr_remain).
//
// With literals, the maximum expansion is 5, including the literals: 4*4*5 + 16 = 96.
//
// The number is rounded up to 128. m_rbScratchDst should match this.
// The number is rounded up to 128.
//
uint8_t code[128]; // target code + jmp to pbRemain
uint8_t code_size; // size of moved target code.