code style

This commit is contained in:
Lysann Tranvouez 2025-09-29 00:07:48 +02:00
parent 21cd133480
commit b78bf27449
2 changed files with 16 additions and 14 deletions

View file

@ -39,15 +39,17 @@ typedef struct detour_trampoline
//
// The number is rounded up to 128. m_rbScratchDst should match this.
//
uint8_t rbCode[128]; // target code + jmp to pbRemain
uint8_t cbCode; // size of moved target code.
uint8_t cbCodeBreak[3]; // padding to make debugging easier.
uint8_t rbRestore[24]; // original target code.
uint8_t cbRestore; // size of original target code.
uint8_t cbRestoreBreak[3]; // padding to make debugging easier.
detour_align rAlign[8]; // instruction alignment array.
uint8_t* pbRemain; // first instruction after moved code. [free list]
uint8_t* pbDetour; // first instruction of detour function.
uint8_t code[128]; // target code + jmp to pbRemain
uint8_t code_size; // size of moved target code.
uint8_t code_padding[3]; // padding to make debugging easier.
uint8_t restore_code[24]; // original target code.
uint8_t restore_code_size; // size of original target code.
uint8_t restore_code_padding[3]; // padding to make debugging easier.
detour_align align[8]; // instruction alignment array.
uint8_t* ptr_remain; // first instruction after moved code. [free list]
uint8_t* ptr_detour; // first instruction of detour function.
} detour_trampoline;
static_assert(sizeof(detour_trampoline) == 192);

View file

@ -57,8 +57,8 @@ static void internal_detour_runnable_trampoline_regions()
// Transactions
typedef enum detour_operation_kind {
attach,
detach,
detour_operation_kind_attach,
detour_operation_kind_detach,
} detour_operation_kind;
typedef struct detour_operation
@ -67,7 +67,7 @@ typedef struct detour_operation
detour_operation_kind kind;
uint8_t** pointer;
uint8_t* target;
struct detour_trampoline* trampoline;
detour_trampoline* trampoline;
vm_prot_t perm;
} detour_operation;