SafetyHook
Loading...
Searching...
No Matches
context.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
6#ifndef SAFETYHOOK_USE_CXXMODULES
7#include <cstdint>
8#else
9import std.compat;
10#endif
11
12#include "safetyhook/common.hpp"
13
14namespace safetyhook {
15union Xmm {
16 uint8_t u8[16];
17 uint16_t u16[8];
18 uint32_t u32[4];
19 uint64_t u64[2];
20 float f32[4];
21 double f64[2];
22};
23
30struct Context64 {
31 Xmm xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15;
32 uintptr_t rflags, r15, r14, r13, r12, r11, r10, r9, r8, rdi, rsi, rdx, rcx, rbx, rax, rbp, rsp, trampoline_rsp, rip;
33};
34
41struct Context32 {
42 Xmm xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7;
43 uintptr_t eflags, edi, esi, edx, ecx, ebx, eax, ebp, esp, trampoline_esp, eip;
44};
45
51#if SAFETYHOOK_ARCH_X86_64
52using Context = Context64;
53#elif SAFETYHOOK_ARCH_X86_32
54using Context = Context32;
55#endif
56
57} // namespace safetyhook
Context structure for 32-bit MidHook.
Definition context.hpp:41
Context structure for 64-bit MidHook.
Definition context.hpp:30
Definition context.hpp:15