102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
dttr_bootstrap.h
Go to the documentation of this file.
1#ifndef DTTR_BOOTSTRAP_H
2#define DTTR_BOOTSTRAP_H
3
4#include <stddef.h>
5#include <stdint.h>
6#include <windows.h>
7
20
33
34enum {
36};
37
38typedef struct {
39 uint32_t phase; // 0x0
40 uint32_t failure_code; // 0x4
41 uint32_t last_error; // 0x8
42 uint32_t exception_code; // 0xC
43 uint32_t flags; // 0x10
44 uint32_t helper_module; // 0x14
45 uint32_t sidecar_module; // 0x18
46 uint32_t kernel32_module; // 0x1C
47 uint32_t ntdll_module; // 0x20
48 char dump_path[MAX_PATH]; // 0x24
50
51enum {
62};
63
64typedef struct {
65 // Absolute sidecar DLL path.
66 char dll_path[MAX_PATH]; // 0x0
67
68 // Shellcode diagnostics.
69 uint32_t status; // 0x104
70 uint32_t module; // 0x108
71 uint32_t last_error; // 0x10C
72
73 // Original game entrypoint.
74 uint32_t original_entry; // 0x110
75
76 // Embedded kernel32.dll as UTF-16LE.
77 WCHAR kernel32_name[sizeof(L"kernel32.dll") / sizeof(WCHAR)]; // 0x114
78
79 // Embedded ASCII kernel32 exports.
80 char loadlibraryex_name[sizeof("LoadLibraryExA")]; // 0x12E
81 char exitthread_name[sizeof("ExitThread")]; // 0x13D
82 char getlasterror_name[sizeof("GetLastError")]; // 0x148
83
84 // Sidecar-resolved ExitThread pointer used after the entrypoint returns.
85 uint32_t exitthread; // 0x158
87
88#endif // DTTR_BOOTSTRAP_H
@ DTTR_BOOTSTRAP_FLAG_DUMP_WRITTEN
DTTR_BootstrapFailureCode
@ DTTR_BOOTSTRAP_FAILURE_HELPER_BOOTSTRAP_FAILED
@ DTTR_BOOTSTRAP_FAILURE_EXITTHREAD_NOT_FOUND
@ DTTR_BOOTSTRAP_FAILURE_HELPER_BOOTSTRAP_EXPORT_NOT_FOUND
@ DTTR_BOOTSTRAP_FAILURE_LOADLIBRARYEX_NOT_FOUND
@ DTTR_BOOTSTRAP_FAILURE_SIDECAR_LOAD_FAILED
@ DTTR_BOOTSTRAP_FAILURE_HELPER_LOAD_FAILED
@ DTTR_BOOTSTRAP_FAILURE_SIDECAR_BIND_EXPORT_NOT_FOUND
@ DTTR_BOOTSTRAP_FAILURE_GETLASTERROR_NOT_FOUND
@ DTTR_BOOTSTRAP_FAILURE_NONE
@ DTTR_BOOTSTRAP_FAILURE_KERNEL32_NOT_FOUND
@ DTTR_LOADER_SHELLCODE_STATUS_EXITTHREAD_NOT_FOUND
@ DTTR_LOADER_SHELLCODE_STATUS_LOADLIBRARY_FAILED
@ DTTR_LOADER_SHELLCODE_STATUS_GETLASTERROR_NOT_FOUND
@ DTTR_LOADER_SHELLCODE_STATUS_LOADLIBRARY_NOT_FOUND
@ DTTR_LOADER_SHELLCODE_STATUS_LOADLIBRARY_READY
@ DTTR_LOADER_SHELLCODE_STATUS_LOADED
@ DTTR_LOADER_SHELLCODE_STATUS_KERNEL32_READY
@ DTTR_LOADER_SHELLCODE_STATUS_KERNEL32_NOT_FOUND
@ DTTR_LOADER_SHELLCODE_STATUS_EXITTHREAD_READY
@ DTTR_LOADER_SHELLCODE_STATUS_GETLASTERROR_READY
DTTR_BootstrapPhase
@ DTTR_BOOTSTRAP_PHASE_INIT
@ DTTR_BOOTSTRAP_PHASE_HELPER_LOADED
@ DTTR_BOOTSTRAP_PHASE_KERNEL32_READY
@ DTTR_BOOTSTRAP_PHASE_SIDECAR_LOADED
@ DTTR_BOOTSTRAP_PHASE_FAILED
@ DTTR_BOOTSTRAP_PHASE_API_READY
@ DTTR_BOOTSTRAP_PHASE_CRASHED
@ DTTR_BOOTSTRAP_PHASE_SIDECAR_BOUND
@ DTTR_BOOTSTRAP_PHASE_HELPER_BOOTSTRAPPED
@ DTTR_BOOTSTRAP_PHASE_READY
char dump_path[MAX_PATH]
WCHAR kernel32_name[sizeof(L"kernel32.dll")/sizeof(WCHAR)]
char getlasterror_name[sizeof("GetLastError")]
char loadlibraryex_name[sizeof("LoadLibraryExA")]
char exitthread_name[sizeof("ExitThread")]