26 return global ? global->
address : 0;
33 uintptr_t (*address_at)(uint32_t index),
35 const char *invalid_message,
36 const char *not_found_message
38 if (!
ctx || !out_addr ||
id >=
count) {
44 const uintptr_t addr = address_at(
id);
64 "invalid PCDOGS symbol function resolve arguments",
65 "PCDOGS symbol function was not resolved"
78 "invalid PCDOGS function resolve arguments"
96 "invalid PCDOGS symbol global resolve arguments",
97 "PCDOGS symbol global was not resolved"
110 "invalid PCDOGS global resolve arguments"
128 if (!
ctx || !out_hook) {
131 "invalid PCDOGS global pointer hook arguments"
135 uintptr_t address = 0;
150 if (!group || !detour) {
153 "invalid PCDOGS patch group symbol function hook arguments"
161 "PCDOGS symbol function is not hookable"
166 uintptr_t address = 0;
192 "invalid PCDOGS patch group function hook arguments"
208 "invalid PCDOGS patch group global pointer hook arguments"
213 uintptr_t address = 0;
226 if (!spec || !out_target) {
229 "invalid PCDOGS patch spec target"
235 switch (spec->
kind) {
260 "unsupported PCDOGS patch spec kind"
272 switch (spec->
kind) {
276 "unsupported PCDOGS patch spec kind"
311 "optional PCDOGS patch spec skipped"
320 "unsupported PCDOGS patch spec kind"
333 if (!out_group || (!specs && spec_count)) {
336 "invalid PCDOGS patch spec install arguments"
345 "PCDOGS patch group output is already set"
358 for (
size_t i = 0; i < spec_count; i++) {
365 if (!specs[i].required
static void cleanup(DTTR_BackendState *state)
DTTR_Graphics_COM_Direct3DDevice7 void DWORD flags DWORD count
DTTR_Graphics_COM_DirectDrawSurface7 DWORD flags void NULL
DTTR_Graphics_COM_DirectDrawSurface7 DWORD DWORD void void DWORD flags DTTR_Graphics_COM_DirectDrawSurface7 void void *cb void * target
static DTTR_Result dttr_core_result(DTTR_Status status, const char *message)
DTTR_Result DTTR_Core_PatchGroupCreate(const DTTR_Core_Context *ctx, DTTR_Core_PatchGroup **out_group)
DTTR_Result DTTR_Core_PatchGroupHookPointer(DTTR_Core_PatchGroup *group, uintptr_t address, void *new_value, void **out_original, DTTR_Core_Hook **out_hook)
DTTR_Result DTTR_Core_PatchGroupRelease(DTTR_Core_PatchGroup **group)
DTTR_Result DTTR_Core_HookPointer(const DTTR_Core_Context *ctx, uintptr_t address, void *new_value, void **out_original, DTTR_Core_Hook **out_hook)
DTTR_Result DTTR_Core_PatchGroupHookFunction(DTTR_Core_PatchGroup *group, uintptr_t address, int prologue_size, void *detour, void **out_original, DTTR_Core_Hook **out_hook)
@ DTTR_TARGET_ADDRESS_PATCH
@ DTTR_TARGET_AOB_REL32_JMP
DTTR_Result DTTR_Core_PatchGroupInstallTargets(DTTR_Core_PatchGroup *group, const DTTR_Core_TargetSpec *targets, size_t target_count, DTTR_Core_TargetReport *out_report)
struct DTTR_Core_PatchGroup DTTR_Core_PatchGroup
DTTR_PCDOGS_T_Symbol_Function_ID
Function symbol identifiers.
DTTR_PCDOGS_T_Data_ID
Stable global identifiers for the public SDK facade.
DTTR_PCDOGS_API const DTTR_PCDOGS_T_Symbol_Function * DTTR_PCDOGS_SymbolFunctionAt(uint32_t index)
#define DTTR_PCDOGS_SYMBOL_DATA_COUNT
@ DTTR_PCDOGS_PATCH_DATA_POINTER_HOOK
@ DTTR_PCDOGS_PATCH_TARGET
@ DTTR_PCDOGS_PATCH_AOB_REL32_JMP
@ DTTR_PCDOGS_PATCH_UNSUPPORTED
@ DTTR_PCDOGS_PATCH_AOB_BYTES
@ DTTR_PCDOGS_PATCH_FUNCTION_HOOK
@ DTTR_PCDOGS_PATCH_ADDRESS_BYTES
bool DTTR_PCDOGS_FunctionSymbolID(DTTR_PCDOGS_T_Function_ID id, DTTR_PCDOGS_T_Symbol_Function_ID *out_symbol_id)
DTTR_PCDOGS_API bool DTTR_PCDOGS_ResolveAll(const DTTR_Core_Context *ctx)
#define DTTR_PCDOGS_SYMBOL_FUNCTION_COUNT
DTTR_PCDOGS_T_Function_ID
Function identifiers for the public SDK facade.
bool DTTR_PCDOGS_DataSymbolID(DTTR_PCDOGS_T_Data_ID id, DTTR_PCDOGS_T_Symbol_Data_ID *out_symbol_id)
DTTR_PCDOGS_T_Symbol_Data_ID
Data symbol identifiers.
DTTR_PCDOGS_API const DTTR_PCDOGS_T_Symbol_Data * DTTR_PCDOGS_SymbolDataAt(uint32_t index)
bool DTTR_ResultOK(DTTR_Result result)
@ DTTR_ERR_INVALID_ARGUMENT
@ DTTR_ERR_ALREADY_INSTALLED
static void patch_report_fail(DTTR_PCDOGS_T_Patch_Report *report, size_t index, DTTR_Result result)
static DTTR_Result patch_spec_target(const DTTR_PCDOGS_T_Patch_Spec *spec, DTTR_Core_TargetSpec *out_target)
DTTR_Result DTTR_PCDOGS_Hook_DataPointer(const DTTR_Core_Context *ctx, DTTR_PCDOGS_T_Data_ID id, void *new_value, void **out_original, DTTR_Core_Hook **out_hook)
DTTR_Result DTTR_PCDOGS_PatchGroup_Install(const DTTR_Core_Context *ctx, const DTTR_PCDOGS_T_Patch_Spec *specs, size_t spec_count, DTTR_Core_PatchGroup **out_group, DTTR_PCDOGS_T_Patch_Report *out_report)
DTTR_Result DTTR_PCDOGS_DataResolve(const DTTR_Core_Context *ctx, DTTR_PCDOGS_T_Data_ID id, uintptr_t *out_addr)
static DTTR_Result patch_group_hook_symbol_function(DTTR_Core_PatchGroup *group, DTTR_PCDOGS_T_Symbol_Function_ID id, void *detour, void **out_original)
static uintptr_t global_address_at(uint32_t index)
DTTR_Result DTTR_PCDOGS_FunctionResolve(const DTTR_Core_Context *ctx, DTTR_PCDOGS_T_Function_ID id, uintptr_t *out_addr)
DTTR_Result DTTR_PCDOGS_PatchGroup_HookDataPointer(DTTR_Core_PatchGroup *group, DTTR_PCDOGS_T_Data_ID id, void *new_value, void **out_original)
static uintptr_t function_address_at(uint32_t index)
DTTR_Result DTTR_PCDOGS_SymbolDataResolve(const DTTR_Core_Context *ctx, DTTR_PCDOGS_T_Symbol_Data_ID id, uintptr_t *out_addr)
static DTTR_Result resolve_symbol(const DTTR_Core_Context *ctx, uint32_t id, uint32_t count, uintptr_t(*address_at)(uint32_t index), uintptr_t *out_addr, const char *invalid_message, const char *not_found_message)
DTTR_Result DTTR_PCDOGS_PatchGroup_HookFunction(DTTR_Core_PatchGroup *group, DTTR_PCDOGS_T_Function_ID id, void *detour, void **out_original)
static DTTR_Result patch_spec_install(DTTR_Core_PatchGroup *group, const DTTR_PCDOGS_T_Patch_Spec *spec)
DTTR_Result DTTR_PCDOGS_SymbolFunctionResolve(const DTTR_Core_Context *ctx, DTTR_PCDOGS_T_Symbol_Function_ID id, uintptr_t *out_addr)
static void patch_report_init(DTTR_PCDOGS_T_Patch_Report *report)
const DTTR_Core_Context * dttr_core_patch_group_context(const DTTR_Core_PatchGroup *group)
void dttr_core_report_fail(DTTR_Core_TargetReport *report, size_t index, DTTR_Result result)
void dttr_core_report_init(DTTR_Core_TargetReport *report)
const uint8_t * patch_bytes
DTTR_PCDOGS_T_Data_ID global
DTTR_Core_TargetSpec target
DTTR_PCDOGS_T_Function_ID function
DTTR_PCDOGS_T_Patch_Kind kind
DTTR_PCDOGS_T_Hook_Kind hook_kind