Panoptes 1.0.0
Endpoint Detection and Response
Loading...
Searching...
No Matches
Test_NtWriteVirtualMemory.cpp File Reference
#include "hook_test_harness.hpp"
#include <winternl.h>

Go to the source code of this file.

Classes

struct  MainImage
 A process's main image: its base, entry point and the address of the AddressOfEntryPoint header field. More...

Macros

#define PEB_BEING_DEBUGGED_OFFSET   0x2
#define PEB_IMAGE_BASE_OFFSET   0x8
#define PEB_IMAGE_BASE_OFFSET_TEXT   "0x8"
#define POINTER_SIZE_TEXT   (sizeof(void*) == 8 ? "8" : "4")
#define REMOTE_IMAGE_BASE_READ
 The read hook's report of the PEB.ImageBaseAddress read in RemoteMainImage.

Typedefs

typedef NTSTATUS(NTAPI * NtReadWriteVirtualMemory_t) (HANDLE ProcessHandle, PVOID BaseAddress, PVOID Buffer, SIZE_T NumberOfBytes, PSIZE_T NumberOfBytesTransferred)

Functions

int main (int argc, char **argv)

Macro Definition Documentation

◆ PEB_BEING_DEBUGGED_OFFSET

#define PEB_BEING_DEBUGGED_OFFSET   0x2

Definition at line 41 of file Test_NtWriteVirtualMemory.cpp.

◆ PEB_IMAGE_BASE_OFFSET

#define PEB_IMAGE_BASE_OFFSET   0x8

Definition at line 46 of file Test_NtWriteVirtualMemory.cpp.

◆ PEB_IMAGE_BASE_OFFSET_TEXT

#define PEB_IMAGE_BASE_OFFSET_TEXT   "0x8"

Definition at line 47 of file Test_NtWriteVirtualMemory.cpp.

◆ POINTER_SIZE_TEXT

#define POINTER_SIZE_TEXT   (sizeof(void*) == 8 ? "8" : "4")

Definition at line 49 of file Test_NtWriteVirtualMemory.cpp.

◆ REMOTE_IMAGE_BASE_READ

#define REMOTE_IMAGE_BASE_READ
Value:
(std::string("NtReadVirtualMemory: ") + POINTER_SIZE_TEXT + \
" bytes read from the PEB of the remote process at offset " PEB_IMAGE_BASE_OFFSET_TEXT)
#define POINTER_SIZE_TEXT
#define PEB_IMAGE_BASE_OFFSET_TEXT

The read hook's report of the PEB.ImageBaseAddress read in RemoteMainImage.

Definition at line 52 of file Test_NtWriteVirtualMemory.cpp.

52#define REMOTE_IMAGE_BASE_READ (std::string("NtReadVirtualMemory: ") + POINTER_SIZE_TEXT + \
53 " bytes read from the PEB of the remote process at offset " PEB_IMAGE_BASE_OFFSET_TEXT)

Typedef Documentation

◆ NtReadWriteVirtualMemory_t

typedef NTSTATUS(NTAPI * NtReadWriteVirtualMemory_t) (HANDLE ProcessHandle, PVOID BaseAddress, PVOID Buffer, SIZE_T NumberOfBytes, PSIZE_T NumberOfBytesTransferred)

Definition at line 26 of file Test_NtWriteVirtualMemory.cpp.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 355 of file Test_NtWriteVirtualMemory.cpp.

355 {
356 return RunHookTests(argc, argv, "NtWriteVirtualMemory", g_Cases);
357}
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.

References RunHookTests().