|
102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
|
#include <dttr_test_support.h>Go to the source code of this file.
Macros | |
| #define | DTTR_TEST_BINARY_SUPPORT |
| #define | DTTR_TEST_PCDOGS_REQUIRED_ALL DTTR_TEST_FIXTURE_MASK_ALL(DTTR_TEST_PCDOGS_FIXTURE_COUNT) |
| #define | DTTR_TEST_PCDOGS_REQUIRED_EN DTTR_TEST_FIXTURE_BIT(DTTR_TEST_PCDOGS_EN) |
| #define | DTTR_TEST_PCDOGS_REQUIRED_EU_SC |
| #define | DTTR_TEST_PCDOGS_REQUIRED_EN_EU |
| #define | DTTR_TEST_PCDOGS_REQUIRED_EN_SC |
| #define | DTTR_TEST_PCDOGS_SIG_NOT_FOUND DTTR_TEST_SIG_NOT_FOUND |
| #define | DTTR_TEST_PCDOGS_IMPORT_CAP DTTR_TEST_IMPORT_CAP |
| #define | TARGET_RESOLVE DTTR_TEST_TARGET_RESOLVE |
| #define | TARGET_JMP_HOOK DTTR_TEST_TARGET_JMP_HOOK |
| #define | TARGET_TRAMPOLINE_HOOK DTTR_TEST_TARGET_TRAMPOLINE_HOOK |
| #define | TARGET_POINTER_FF25_E8_TARGET DTTR_TEST_TARGET_POINTER_FF25_E8_TARGET |
| #define | TARGET_POINTER_U32_AT_MATCH_PLUS_2 DTTR_TEST_TARGET_POINTER_U32_AT_MATCH_PLUS_2 |
| #define | TARGET_BYTE_PATCH DTTR_TEST_TARGET_BYTE_PATCH |
Typedefs | |
| typedef DTTR_TestBinaryFixture | DTTR_TestPCDOGSFixture |
| typedef DTTR_TestPatternExpectation | DTTR_TestPCDOGSSignatureExpectation |
| typedef DTTR_TestTargetKind | E_TargetKind |
| typedef DTTR_TestTargetExpectation | pcdogs_target_expectation |
Enumerations | |
| enum | DTTR_TestPCDOGSFixtureID { DTTR_TEST_PCDOGS_EN = 0 , DTTR_TEST_PCDOGS_EU , DTTR_TEST_PCDOGS_SC , DTTR_TEST_PCDOGS_FIXTURE_COUNT } |
Functions | |
| const char * | pcdogs_fixture_dir () |
| Return the fixture directory used by PCDOGS signature tests. | |
| bool | pcdogs_fixtures_available () |
| Report whether all PCDOGS binary fixtures are available for signature tests. | |
| bool | pcdogs_for_each_fixture (DTTR_TestPEFixtureVisitor visitor, void *userdata) |
| Visit each available PCDOGS fixture image for signature and ABI checks. | |
| static uintptr_t | pcdogs_sigscan (const DTTR_TestPEImage *image, const uint8_t *sig, const char *mask) |
| Scan a fixture image with the same signature format used by SDK symbol rows. | |
| static size_t | pcdogs_sigscan_count (const DTTR_TestPEImage *image, const uint8_t *sig, const char *mask) |
| Count signature matches in a fixture image. | |
| static size_t | pcdogs_collect_imports (const DTTR_TestPEImage *image, DTTR_TestImportEntry *imports, size_t imports_cap) |
| Collect fixture imports for tests that validate recovered sidecar targets. | |
Variables | |
| const DTTR_TestPCDOGSFixture | DTTR_TEST_PCDOGS_FIXTURES [] |
| const pcdogs_target_expectation | DTTR_TEST_PCDOGS_SIDECAR_TARGETS [] |
| const size_t | DTTR_TEST_PCDOGS_SIDECAR_TARGET_COUNT |
| const char *const | DTTR_TEST_PCDOGS_SIDECAR_MSS_IMPORT_HOOKS [] |
| const size_t | DTTR_TEST_PCDOGS_SIDECAR_MSS_IMPORT_HOOK_COUNT |
| #define DTTR_TEST_BINARY_SUPPORT |
Definition at line 4 of file dttr_test.h.
| #define DTTR_TEST_PCDOGS_IMPORT_CAP DTTR_TEST_IMPORT_CAP |
Definition at line 21 of file dttr_test.h.
Referenced by assert_imports_for_fixture().
| #define DTTR_TEST_PCDOGS_REQUIRED_ALL DTTR_TEST_FIXTURE_MASK_ALL(DTTR_TEST_PCDOGS_FIXTURE_COUNT) |
Definition at line 8 of file dttr_test.h.
| #define DTTR_TEST_PCDOGS_REQUIRED_EN DTTR_TEST_FIXTURE_BIT(DTTR_TEST_PCDOGS_EN) |
Definition at line 10 of file dttr_test.h.
| #define DTTR_TEST_PCDOGS_REQUIRED_EN_EU |
Definition at line 14 of file dttr_test.h.
| #define DTTR_TEST_PCDOGS_REQUIRED_EN_SC |
Definition at line 17 of file dttr_test.h.
| #define DTTR_TEST_PCDOGS_REQUIRED_EU_SC |
Definition at line 11 of file dttr_test.h.
| #define DTTR_TEST_PCDOGS_SIG_NOT_FOUND DTTR_TEST_SIG_NOT_FOUND |
Definition at line 20 of file dttr_test.h.
Referenced by require_sigscan().
| #define TARGET_BYTE_PATCH DTTR_TEST_TARGET_BYTE_PATCH |
Definition at line 28 of file dttr_test.h.
Referenced by test_expected_pcdogs_byte_patch_targets_resolve().
| #define TARGET_JMP_HOOK DTTR_TEST_TARGET_JMP_HOOK |
Definition at line 24 of file dttr_test.h.
Referenced by test_expected_pcdogs_jmp_hook_targets_resolve().
| #define TARGET_POINTER_FF25_E8_TARGET DTTR_TEST_TARGET_POINTER_FF25_E8_TARGET |
Definition at line 26 of file dttr_test.h.
| #define TARGET_POINTER_U32_AT_MATCH_PLUS_2 DTTR_TEST_TARGET_POINTER_U32_AT_MATCH_PLUS_2 |
Definition at line 27 of file dttr_test.h.
| #define TARGET_RESOLVE DTTR_TEST_TARGET_RESOLVE |
Definition at line 23 of file dttr_test.h.
| #define TARGET_TRAMPOLINE_HOOK DTTR_TEST_TARGET_TRAMPOLINE_HOOK |
Definition at line 25 of file dttr_test.h.
| typedef DTTR_TestBinaryFixture DTTR_TestPCDOGSFixture |
Definition at line 37 of file dttr_test.h.
| typedef DTTR_TestPatternExpectation DTTR_TestPCDOGSSignatureExpectation |
Definition at line 38 of file dttr_test.h.
| typedef DTTR_TestTargetKind E_TargetKind |
Definition at line 39 of file dttr_test.h.
| typedef DTTR_TestTargetExpectation pcdogs_target_expectation |
Definition at line 40 of file dttr_test.h.
| Enumerator | |
|---|---|
| DTTR_TEST_PCDOGS_EN | |
| DTTR_TEST_PCDOGS_EU | |
| DTTR_TEST_PCDOGS_SC | |
| DTTR_TEST_PCDOGS_FIXTURE_COUNT | |
Definition at line 30 of file dttr_test.h.
|
inlinestatic |
Collect fixture imports for tests that validate recovered sidecar targets.
Definition at line 74 of file dttr_test.h.
References DTTR_TestPE_CollectImports().
Referenced by assert_imports_for_fixture().
| const char * pcdogs_fixture_dir | ( | ) |
Return the fixture directory used by PCDOGS signature tests.
Definition at line 27 of file pcdogs_fixtures.c.
Referenced by pcdogs_fixtures_available(), and pcdogs_for_each_fixture().
| bool pcdogs_fixtures_available | ( | ) |
Report whether all PCDOGS binary fixtures are available for signature tests.
Definition at line 33 of file pcdogs_fixtures.c.
References dttr_test_fixtures_available(), DTTR_TEST_PCDOGS_FIXTURE_COUNT, DTTR_TEST_PCDOGS_FIXTURES, and pcdogs_fixture_dir().
Referenced by test_blueprint_functions_resolve_and_match_abi(), test_expected_mss32_imports_are_hooked(), test_expected_pcdogs_byte_patch_targets_resolve(), test_expected_pcdogs_jmp_hook_targets_resolve(), and test_expected_pcdogs_signatures_resolve().
| bool pcdogs_for_each_fixture | ( | DTTR_TestPEFixtureVisitor | visitor, |
| void * | userdata ) |
Visit each available PCDOGS fixture image for signature and ABI checks.
Definition at line 42 of file pcdogs_fixtures.c.
References DTTR_TEST_PCDOGS_FIXTURE_COUNT, DTTR_TEST_PCDOGS_FIXTURES, dttr_test_pe_for_each_fixture(), and pcdogs_fixture_dir().
Referenced by test_blueprint_functions_resolve_and_match_abi(), test_expected_mss32_imports_are_hooked(), test_expected_pcdogs_signatures_resolve(), and test_targets_matching().
|
inlinestatic |
Scan a fixture image with the same signature format used by SDK symbol rows.
Definition at line 56 of file dttr_test.h.
References DTTR_TestPE_Sigscan().
Referenced by require_sigscan().
|
inlinestatic |
Count signature matches in a fixture image.
Definition at line 65 of file dttr_test.h.
References DTTR_TestPE_SigscanCount().
Referenced by require_sigscan().
|
extern |
Definition at line 5 of file pcdogs_fixtures.c.
Referenced by pcdogs_fixtures_available(), and pcdogs_for_each_fixture().
|
extern |
Definition at line 215 of file pcdogs.c.
Referenced by assert_imports_for_fixture(), and import_hook_expected().
|
extern |
Definition at line 185 of file pcdogs.c.
Referenced by import_hook_expected().
|
extern |
Definition at line 178 of file pcdogs.c.
Referenced by assert_targets_for_fixture().
|
extern |
Definition at line 49 of file pcdogs.c.
Referenced by assert_targets_for_fixture().