![]() |
Panoptes 1.0.0
Endpoint Detection and Response
|
#include <Windows.h>#include <cstdio>#include <cstring>#include <string>#include <vector>Go to the source code of this file.
Classes | |
| class | HookTestContext |
| Resources shared by the cases of one test run, created in the child process. The remote processes are started by Start, before the first case, so what process creation itself triggers (CreateProcess writes to the child's PEB) is reported as setup rather than attributed to a case. More... | |
| struct | HookTestCase |
| One test case. Run executes in the child with the hooks placed. Expected lists the "[Panoptes] " messages (without that prefix) the case must produce, in order; '*' matches any run of characters, e.g. for addresses. More... | |
Namespaces | |
| namespace | hook_test_detail |
Macros | |
| #define | HOOK_ARCH "x86" |
| #define | HOOK_DLL_NAME "PanoptesDLL" HOOK_ARCH ".dll" |
Functions | |
| template<typename T> | |
| T | NtdllFunction (const char *name) |
| Looks up an ntdll export. Calls through the result go through the hooks, because the hooks patch the export itself. | |
| PROCESS_INFORMATION | StartSuspended (const std::string &commandLine) |
| Starts a suspended process. Returns an empty PROCESS_INFORMATION on failure. | |
| bool | hook_test_detail::WildcardMatch (const char *pattern, const char *text) |
| Matches text against a pattern where '*' matches any run of characters. | |
| int | hook_test_detail::RunChild (const std::vector< HookTestCase > &cases) |
| Child side: loads the hook DLL from bin/<config>, one directory above the tests folder, then runs every case, announcing each with a marker message. | |
| bool | hook_test_detail::CaptureChild (const char *exePath, size_t caseCount, std::vector< std::vector< std::string > > &messages) |
| Parent side: runs the child under a debug loop and returns the hook messages it emitted, grouped by case. Returns false if the child could not be run or did not exit cleanly. | |
| int | RunHookTests (int argc, char **argv, const char *apiName, const std::vector< HookTestCase > &cases) |
| Runs the cases and prints a PASS/FAIL line for each. Call from main. | |
Variables | |
| constexpr const char * | hook_test_detail::kCaseMarker = "@@PANO_CASE " |
| constexpr const char * | hook_test_detail::kEndMarker = "@@PANO_END" |
| constexpr const char * | hook_test_detail::kMessagePrefix = "[Panoptes] " |
| #define HOOK_ARCH "x86" |
Definition at line 17 of file hook_test_harness.hpp.
Referenced by main(), and RunHookTests().
| #define HOOK_DLL_NAME "PanoptesDLL" HOOK_ARCH ".dll" |
Definition at line 20 of file hook_test_harness.hpp.
Referenced by main(), and hook_test_detail::RunChild().
|
inline |
Looks up an ntdll export. Calls through the result go through the hooks, because the hooks patch the export itself.
Definition at line 25 of file hook_test_harness.hpp.
Referenced by MapView(), MapViewEx(), UnmapView(), and UnmapViewEx().
|
inline |
Runs the cases and prints a PASS/FAIL line for each. Call from main.
Definition at line 284 of file hook_test_harness.hpp.
References hook_test_detail::CaptureChild(), HookTestCase::Expected, HOOK_ARCH, MAX_PATH, HookTestCase::Name, and hook_test_detail::RunChild().
Referenced by main().
|
inline |
Starts a suspended process. Returns an empty PROCESS_INFORMATION on failure.
Definition at line 30 of file hook_test_harness.hpp.
Referenced by HookTestContext::Start().