|
102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
|
Go to the source code of this file.
Data Structures | |
| struct | blueprint_signature |
| struct | blueprint_function |
Macros | |
| #define | STABLE_SIGNATURE_COUNT (sizeof(DTTR_PCDOGS_SIGNATURES) / sizeof(*DTTR_PCDOGS_SIGNATURES)) |
| #define | STABLE_FUNCTION_COUNT (sizeof(DTTR_PCDOGS_FUNCTIONS) / sizeof(*DTTR_PCDOGS_FUNCTIONS)) |
| #define | UNSTABLE_SIGNATURE_COUNT (sizeof(DTTR_PCDOGS_UNSTABLE_SIGNATURES) / sizeof(*DTTR_PCDOGS_UNSTABLE_SIGNATURES)) |
| #define | UNSTABLE_FUNCTION_COUNT (sizeof(DTTR_PCDOGS_UNSTABLE_FUNCTIONS) / sizeof(*DTTR_PCDOGS_UNSTABLE_FUNCTIONS)) |
Functions | |
| static uintptr_t | require_sigscan (const DTTR_TestPCDOGSFixture *fixture, const char *kind, const char *name, const uint8_t *sig, const char *mask, const DTTR_TestPEImage *image) |
| static void | assert_decodes_at (const DTTR_TestPCDOGSFixture *fixture, const char *kind, const char *name, const DTTR_TestPEImage *image, uintptr_t rva) |
| static void | assert_signature_resolved (const DTTR_TestPCDOGSFixture *fixture, const blueprint_signature *sig, const DTTR_TestPEImage *image) |
| static bool | assert_signatures_for_fixture (size_t fixture_index, const DTTR_TestBinaryFixture *fixture, const char *path, const DTTR_TestPEImage *image, void *userdata) |
| static void | test_expected_pcdogs_signatures_resolve (void **state) |
| static uintptr_t | blueprint_function_site (const DTTR_TestPCDOGSFixture *fixture, const blueprint_function *fn, const DTTR_TestPEImage *image) |
| static bool | instruction_has_unsupported_reloc (const DTTR_TestDecodedInstruction *decoded) |
| static void | assert_patch_window_decodes (const DTTR_TestPCDOGSFixture *fixture, const blueprint_function *fn, const DTTR_TestPEImage *image, uintptr_t site, uint32_t patch_size) |
| static uint32_t | ret_stack_bytes (const DTTR_TestDecodedInstruction *decoded) |
| static void | assert_abi_return_matches (const DTTR_TestPCDOGSFixture *fixture, const blueprint_function *fn, const DTTR_TestPEImage *image, uintptr_t site) |
| static void | assert_blueprint_function_resolved (const DTTR_TestPCDOGSFixture *fixture, const blueprint_function *fn, const DTTR_TestPEImage *image) |
| static bool | assert_blueprint_functions_for_fixture (size_t fixture_index, const DTTR_TestBinaryFixture *fixture, const char *path, const DTTR_TestPEImage *image, void *userdata) |
| static void | test_blueprint_functions_resolve_and_match_abi (void **state) |
Variables | |
| static const DTTR_TestCase | TEST_CASES [] |
| #define STABLE_FUNCTION_COUNT (sizeof(DTTR_PCDOGS_FUNCTIONS) / sizeof(*DTTR_PCDOGS_FUNCTIONS)) |
Definition at line 30 of file pcdogs.c.
Referenced by assert_blueprint_functions_for_fixture().
| #define STABLE_SIGNATURE_COUNT (sizeof(DTTR_PCDOGS_SIGNATURES) / sizeof(*DTTR_PCDOGS_SIGNATURES)) |
Definition at line 28 of file pcdogs.c.
Referenced by assert_signatures_for_fixture().
| #define UNSTABLE_FUNCTION_COUNT (sizeof(DTTR_PCDOGS_UNSTABLE_FUNCTIONS) / sizeof(*DTTR_PCDOGS_UNSTABLE_FUNCTIONS)) |
Definition at line 34 of file pcdogs.c.
Referenced by assert_blueprint_functions_for_fixture().
| #define UNSTABLE_SIGNATURE_COUNT (sizeof(DTTR_PCDOGS_UNSTABLE_SIGNATURES) / sizeof(*DTTR_PCDOGS_UNSTABLE_SIGNATURES)) |
Definition at line 32 of file pcdogs.c.
Referenced by assert_signatures_for_fixture().
|
static |
Definition at line 249 of file pcdogs.c.
References blueprint_function::calling_convention, DTTR_PCDOGS_CC_CDECL, dttr_test_zydis_decode32_at(), blueprint_function::name, ret_stack_bytes(), and blueprint_function::stack_param_bytes.
Referenced by assert_blueprint_function_resolved().
|
static |
Definition at line 304 of file pcdogs.c.
References assert_abi_return_matches(), assert_decodes_at(), assert_patch_window_decodes(), blueprint_function_site(), DTTR_PCDOGS_HOOK_HOTPATCH, DTTR_PCDOGS_HOOK_REL32, blueprint_function::entry_patch_size, blueprint_function::hook_kind, blueprint_function::name, and blueprint_function::patch_size.
Referenced by assert_blueprint_functions_for_fixture().
|
static |
Definition at line 325 of file pcdogs.c.
References assert_blueprint_function_resolved(), dttr_test_fixture_required(), blueprint_function::required, STABLE_FUNCTION_COUNT, and UNSTABLE_FUNCTION_COUNT.
Referenced by test_blueprint_functions_resolve_and_match_abi().
|
static |
Definition at line 75 of file pcdogs.c.
References dttr_test_zydis_decode32_at().
Referenced by assert_blueprint_function_resolved(), and assert_signature_resolved().
|
static |
Definition at line 200 of file pcdogs.c.
References dttr_test_range_valid(), dttr_test_zydis_decode32_at(), instruction_has_unsupported_reloc(), and blueprint_function::name.
Referenced by assert_blueprint_function_resolved().
|
static |
Definition at line 98 of file pcdogs.c.
References assert_decodes_at(), blueprint_signature::mask, blueprint_signature::name, require_sigscan(), and blueprint_signature::sig.
Referenced by assert_signatures_for_fixture().
|
static |
Definition at line 115 of file pcdogs.c.
References assert_signature_resolved(), dttr_test_fixture_required(), blueprint_signature::required, STABLE_SIGNATURE_COUNT, and UNSTABLE_SIGNATURE_COUNT.
Referenced by test_expected_pcdogs_signatures_resolve().
|
static |
Definition at line 150 of file pcdogs.c.
References dttr_test_offset_site(), dttr_test_signed_range_valid(), blueprint_function::mask, blueprint_function::match_offset, blueprint_function::name, require_sigscan(), and blueprint_function::sig.
Referenced by assert_blueprint_function_resolved().
|
static |
Definition at line 177 of file pcdogs.c.
Referenced by assert_patch_window_decodes().
|
static |
Definition at line 38 of file pcdogs.c.
References DTTR_TEST_PCDOGS_SIG_NOT_FOUND, pcdogs_sigscan(), and pcdogs_sigscan_count().
Referenced by assert_signature_resolved(), and blueprint_function_site().
|
static |
Definition at line 240 of file pcdogs.c.
Referenced by assert_abi_return_matches().
Definition at line 350 of file pcdogs.c.
References assert_blueprint_functions_for_fixture(), dttr_test_require_available(), NULL, pcdogs_fixtures_available(), pcdogs_for_each_fixture(), and state.
Definition at line 144 of file pcdogs.c.
References assert_signatures_for_fixture(), dttr_test_require_available(), NULL, pcdogs_fixtures_available(), pcdogs_for_each_fixture(), and state.
|
static |