|
102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
|
#include <stdbool.h>#include <stdint.h>#include <string.h>#include <windows.h>#include <dttr_core.h>#include <dttr_pcdogs.h>#include <dttr_runtime.h>#include <dttr_test_support.h>Go to the source code of this file.
Macros | |
| #define | DTTR_SDK_ENABLE_UNSTABLE |
Functions | |
| static uintptr_t | sigscan_bytes (const uint8_t *bytes, size_t size, const char *sig, const char *mask) |
| static uintptr_t | sigscan (HMODULE mod, const char *sig, const char *mask) |
| static DTTR_Core_Context | runtime_context () |
| static void | test_signature_helpers_resolve_aob_patterns (void **state) |
| static void | test_patch_group_target_failure_rolls_back_only_new_entries (void **state) |
| static DTTR_PCDOGS_T_File_Handle * | pcdogs_file_open_detour (const char *filename, const char *mode) |
| static BOOL | pcdogs_cleanup_title_resources_detour () |
| static HRESULT | pcdogs_ddraw_create_ex_detour (DTTR_PCDOGS_T_Win32_GUID *guid, void **ddraw_out, DTTR_PCDOGS_T_Win32_GUID *iid, DTTR_PCDOGS_T_COM_IUnknown *outer) |
| static void | test_pcdogs_unstable_patch_specs_match_stable_shape (void **state) |
| static void | test_pcdogs_generated_function_patch_specs_name_current_hooks (void **state) |
| static void | test_pcdogs_generated_title_resource_patch_specs_use_current_names (void **state) |
Variables | |
| static uint8_t | sig_target [] = {0x55, 0x8B, 0xEC, 0x90, 0x90, 0xC3, 0x33, 0xC0} |
| static uint8_t | patch_target [4] |
| static uint8_t | group_patch_target [2] |
| static const DTTR_Core_API | RUNTIME |
| static const DTTR_TestCase | TEST_CASES [] |
|
static |
Definition at line 147 of file core.c.
References BOOL.
Referenced by test_pcdogs_generated_function_patch_specs_name_current_hooks().
|
static |
Definition at line 151 of file core.c.
References S_OK.
Referenced by test_pcdogs_unstable_patch_specs_match_stable_shape().
|
static |
Definition at line 140 of file core.c.
References NULL.
Referenced by test_pcdogs_generated_function_patch_specs_name_current_hooks().
|
static |
Definition at line 59 of file core.c.
References RUNTIME.
Referenced by test_patch_group_target_failure_rolls_back_only_new_entries(), and test_signature_helpers_resolve_aob_patterns().
|
static |
Definition at line 45 of file core.c.
References sig_target, and sigscan_bytes().
Referenced by aob_scan_with().
|
static |
Definition at line 83 of file core.c.
References ctx, DTTR_Core_HookCleanupAll(), DTTR_Core_PatchGroupCreate(), DTTR_Core_PatchGroupDestroy(), DTTR_Core_PatchGroupInstallTargets(), DTTR_Core_PatchGroupPatchBytes(), DTTR_ERR_NOT_FOUND, DTTR_ResultOK(), DTTR_TARGET_ADDRESS_PATCH, DTTR_TARGET_AOB_PATCH, DTTR_TEST_ARRAY_COUNT, DTTR_Core_TargetReport::failed_index, group_patch_target, NULL, patch_target, runtime_context(), state, and DTTR_Result::status.
Definition at line 197 of file core.c.
References cleanup(), DTTR_PCDOGS_T_Patch_Spec::detour, DTTR_PCDOGS_F_File_Open, DTTR_PCDOGS_F_Title_CleanupScreenResources, DTTR_PCDOGS_FUNCTION_FILE_OPEN, DTTR_PCDOGS_FUNCTION_TITLE_CLEANUP_SCREEN_RESOURCES, DTTR_PCDOGS_PATCH_FUNCTION_HOOK, DTTR_PCDOGS_T_Patch_Spec::function, DTTR_PCDOGS_T_Patch_Spec::kind, NULL, DTTR_PCDOGS_T_Patch_Spec::out_original, pcdogs_cleanup_title_resources_detour(), pcdogs_file_open_detour(), DTTR_PCDOGS_T_Patch_Spec::required, and state.
Definition at line 228 of file core.c.
References DTTR_PCDOGS_D_Title_ResourceHandle0, DTTR_PCDOGS_D_Title_ResourceHandle1, DTTR_PCDOGS_DATA_TITLE_RESOURCE_HANDLE0, DTTR_PCDOGS_DATA_TITLE_RESOURCE_HANDLE1, DTTR_PCDOGS_PATCH_DATA_POINTER_HOOK, DTTR_PCDOGS_T_Patch_Spec::global, DTTR_PCDOGS_T_Patch_Spec::kind, DTTR_PCDOGS_T_Patch_Spec::new_value, NULL, DTTR_PCDOGS_T_Patch_Spec::out_original, DTTR_PCDOGS_T_Patch_Spec::required, and state.
Definition at line 160 of file core.c.
References DTTR_PCDOGS_T_Patch_Spec::detour, DTTR_PCDOGS_D_Video_PlayMovieLoop_GetAsyncKeyStateThunk, DTTR_PCDOGS_DATA_VIDEO_PLAY_MOVIE_LOOP_GET_ASYNC_KEY_STATE_THUNK, DTTR_PCDOGS_F_DDraw_CreateEx, DTTR_PCDOGS_FUNCTION_DDRAW_CREATE_EX, DTTR_PCDOGS_PATCH_DATA_POINTER_HOOK, DTTR_PCDOGS_PATCH_FUNCTION_HOOK, DTTR_PCDOGS_T_Patch_Spec::function, DTTR_PCDOGS_T_Patch_Spec::global, DTTR_PCDOGS_T_Patch_Spec::kind, DTTR_PCDOGS_T_Patch_Spec::new_value, NULL, DTTR_PCDOGS_T_Patch_Spec::out_original, pcdogs_ddraw_create_ex_detour(), DTTR_PCDOGS_T_Patch_Spec::required, and state.
Definition at line 66 of file core.c.
References ctx, DTTR_Core_AOBFind(), DTTR_Core_SignatureFind(), DTTR_ERR_INVALID_ARGUMENT, DTTR_ResultOK(), runtime_context(), sig_target, state, and DTTR_Result::status.
|
static |
Definition at line 15 of file core.c.
Referenced by test_patch_group_target_failure_rolls_back_only_new_entries().
|
static |
Definition at line 14 of file core.c.
Referenced by test_patch_bytes_detach_restores_original(), and test_patch_group_target_failure_rolls_back_only_new_entries().
|
static |
Definition at line 49 of file core.c.
Referenced by runtime_context().
|
static |
Definition at line 13 of file core.c.
Referenced by sigscan(), and test_signature_helpers_resolve_aob_patterns().
|
static |