Panoptes 1.0.0
Endpoint Detection and Response
Loading...
Searching...
No Matches
def.h
Go to the documentation of this file.
1#pragma once
2#include <Winddi.h>
3#include <winternl.h>
4
18
19#pragma region API Definitions
21typedef NTSTATUS(NTAPI* pNtWriteVirtualMemory)(
22 HANDLE ProcessHandle,
23 PVOID BaseAddress,
24 PVOID Buffer,
25 SIZE_T NumberOfBytesToWrite,
26 PSIZE_T NumberOfBytesWritten
27 );
28
30typedef NTSTATUS(NTAPI* pNtModifyBootEntry)(
31 PBOOT_ENTRY BootEntry
32 );
33
36typedef NTSTATUS(NTAPI* pNtMapViewOfSectionEx)(
37 _In_ HANDLE SectionHandle,
38 _In_ HANDLE ProcessHandle,
39 _Inout_ _At_(*BaseAddress, _Readable_bytes_(*ViewSize) _Writable_bytes_(*ViewSize)
40 _Post_readable_byte_size_(*ViewSize)) PVOID* BaseAddress,
41 _Inout_opt_ PLARGE_INTEGER SectionOffset,
42 _Inout_ PSIZE_T ViewSize,
43 _In_ ULONG AllocationType,
44 _In_ ULONG PageProtection,
45 _Inout_updates_opt_(ExtendedParameterCount) PMEM_EXTENDED_PARAMETER ExtendedParameters,
46 _In_ ULONG ExtendedParameterCount
47 );
48
54
57typedef NTSTATUS(NTAPI* pNtMapViewOfSection)(
58 _In_ HANDLE SectionHandle,
59 _In_ HANDLE ProcessHandle,
60 _Inout_ PVOID* BaseAddress,
61 _In_ ULONG_PTR ZeroBits,
62 _In_ SIZE_T CommitSize,
63 _Inout_opt_ PLARGE_INTEGER SectionOffset,
64 _Inout_ PSIZE_T ViewSize,
65 _In_ PANO_SECTION_INHERIT InheritDisposition,
66 _In_ ULONG AllocationType,
67 _In_ ULONG Win32Protect
68 );
69
72typedef NTSTATUS(NTAPI* pNtUnmapViewOfSection)(
73 _In_ HANDLE ProcessHandle,
74 _In_opt_ PVOID BaseAddress
75 );
76
79typedef NTSTATUS(NTAPI* pNtUnmapViewOfSectionEx)(
80 _In_ HANDLE ProcessHandle,
81 _In_opt_ PVOID BaseAddress,
82 _In_ ULONG Flags
83 );
84
86typedef NTSTATUS(NTAPI* pNtProtectVirtualMemory)(
87 _In_ HANDLE ProcessHandle,
88 _Inout_ PVOID* BaseAddress,
89 _Inout_ PSIZE_T RegionSize,
90 _In_ ULONG NewProtection,
91 _Out_ PULONG OldProtection
92 );
93
95typedef NTSTATUS(NTAPI* pNtAllocateVirtualMemory)(
96 _In_ HANDLE ProcessHandle,
97 _Inout_ PVOID* BaseAddress,
98 _In_ ULONG_PTR ZeroBits,
99 _Inout_ PSIZE_T RegionSize,
100 _In_ ULONG AllocationType,
101 _In_ ULONG Protection
102 );
103
106typedef NTSTATUS(NTAPI* pNtAllocateVirtualMemoryEx)(
107 _In_ HANDLE ProcessHandle,
108 _Inout_ PVOID* BaseAddress,
109 _Inout_ PSIZE_T RegionSize,
110 _In_ ULONG AllocationType,
111 _In_ ULONG PageProtection,
112 _Inout_updates_opt_(ExtendedParameterCount) PMEM_EXTENDED_PARAMETER ExtendedParameters,
113 _In_ ULONG ExtendedParameterCount
114 );
115
117typedef NTSTATUS(NTAPI* pNtReadVirtualMemory)(
118 _In_ HANDLE ProcessHandle,
119 _In_opt_ PVOID BaseAddress,
120 _Out_writes_bytes_(NumberOfBytesToRead) PVOID Buffer,
121 _In_ SIZE_T NumberOfBytesToRead,
122 _Out_opt_ PSIZE_T NumberOfBytesRead
123 );
124
128typedef NTSTATUS(NTAPI* pNtCreateThreadEx)(
129 _Out_ PHANDLE ThreadHandle,
130 _In_ ACCESS_MASK DesiredAccess,
131 _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
132 _In_ HANDLE ProcessHandle,
133 _In_ PVOID StartRoutine,
134 _In_opt_ PVOID Argument,
135 _In_ ULONG CreateFlags,
136 _In_ SIZE_T ZeroBits,
137 _In_ SIZE_T StackSize,
138 _In_ SIZE_T MaximumStackSize,
139 _In_opt_ PVOID AttributeList
140 );
141
143typedef VOID(NTAPI* PPANO_APC_ROUTINE)(
144 _In_opt_ PVOID ApcArgument1,
145 _In_opt_ PVOID ApcArgument2,
146 _In_opt_ PVOID ApcArgument3
147 );
148
150typedef NTSTATUS(NTAPI* pNtQueueApcThread)(
151 _In_ HANDLE ThreadHandle,
152 _In_ PPANO_APC_ROUTINE ApcRoutine,
153 _In_opt_ PVOID ApcArgument1,
154 _In_opt_ PVOID ApcArgument2,
155 _In_opt_ PVOID ApcArgument3
156 );
157
160#define PANO_QUEUE_USER_APC_FLAGS_SPECIAL_USER_APC 0x1
161
165typedef NTSTATUS(NTAPI* pNtQueueApcThreadEx2)(
166 _In_ HANDLE ThreadHandle,
167 _In_opt_ HANDLE ReserveHandle,
168 _In_ ULONG ApcFlags,
169 _In_ PPANO_APC_ROUTINE ApcRoutine,
170 _In_opt_ PVOID ApcArgument1,
171 _In_opt_ PVOID ApcArgument2,
172 _In_opt_ PVOID ApcArgument3
173 );
174
176typedef NTSTATUS(NTAPI* pNtSetInformationProcess)(
177 _In_ HANDLE ProcessHandle,
178 _In_ PROCESSINFOCLASS ProcessInformationClass,
179 _In_reads_bytes_(ProcessInformationLength) PVOID ProcessInformation,
180 _In_ ULONG ProcessInformationLength
181 );
182#pragma endregion
enum _PANO_SECTION_INHERIT PANO_SECTION_INHERIT
How a mapped view is shared with child processes. Only defined in kernel-mode headers.
NTSTATUS(NTAPI * pNtCreateThreadEx)(_Out_ PHANDLE ThreadHandle, _In_ ACCESS_MASK DesiredAccess, _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes, _In_ HANDLE ProcessHandle, _In_ PVOID StartRoutine, _In_opt_ PVOID Argument, _In_ ULONG CreateFlags, _In_ SIZE_T ZeroBits, _In_ SIZE_T StackSize, _In_ SIZE_T MaximumStackSize, _In_opt_ PVOID AttributeList)
The NtCreateThreadEx function creates a thread in a specified process. StartRoutine is a PUSER_THREAD...
Definition def.h:128
NTSTATUS(NTAPI * pNtWriteVirtualMemory)(HANDLE ProcessHandle, PVOID BaseAddress, PVOID Buffer, SIZE_T NumberOfBytesToWrite, PSIZE_T NumberOfBytesWritten)
The NtWriteVirtualMemory function writes memory to a specified process.
Definition def.h:21
NTSTATUS(NTAPI * pNtAllocateVirtualMemoryEx)(_In_ HANDLE ProcessHandle, _Inout_ PVOID *BaseAddress, _Inout_ PSIZE_T RegionSize, _In_ ULONG AllocationType, _In_ ULONG PageProtection, _Inout_updates_opt_(ExtendedParameterCount) PMEM_EXTENDED_PARAMETER ExtendedParameters, _In_ ULONG ExtendedParameterCount)
The NtAllocateVirtualMemoryEx function reserves and/or commits memory in a process,...
Definition def.h:106
NTSTATUS(NTAPI * pNtQueueApcThread)(_In_ HANDLE ThreadHandle, _In_ PPANO_APC_ROUTINE ApcRoutine, _In_opt_ PVOID ApcArgument1, _In_opt_ PVOID ApcArgument2, _In_opt_ PVOID ApcArgument3)
The NtQueueApcThread function queues a user-mode APC to a thread.
Definition def.h:150
struct _BOOT_ENTRY BOOT_ENTRY
The BOOT_ENTRY structure represents a boot entry in the boot configuration database....
NTSTATUS(NTAPI * pNtUnmapViewOfSection)(_In_ HANDLE ProcessHandle, _In_opt_ PVOID BaseAddress)
The NtUnmapViewOfSection function unmaps a view of a section from the address space of a process.
Definition def.h:72
NTSTATUS(NTAPI * pNtMapViewOfSection)(_In_ HANDLE SectionHandle, _In_ HANDLE ProcessHandle, _Inout_ PVOID *BaseAddress, _In_ ULONG_PTR ZeroBits, _In_ SIZE_T CommitSize, _Inout_opt_ PLARGE_INTEGER SectionOffset, _Inout_ PSIZE_T ViewSize, _In_ PANO_SECTION_INHERIT InheritDisposition, _In_ ULONG AllocationType, _In_ ULONG Win32Protect)
The NtMapViewOfSection function maps a view of a section into the address space of a process.
Definition def.h:57
NTSTATUS(NTAPI * pNtProtectVirtualMemory)(_In_ HANDLE ProcessHandle, _Inout_ PVOID *BaseAddress, _Inout_ PSIZE_T RegionSize, _In_ ULONG NewProtection, _Out_ PULONG OldProtection)
The NtProtectVirtualMemory function changes the protection of memory in a process.
Definition def.h:86
struct _BOOT_ENTRY * PBOOT_ENTRY
_PANO_SECTION_INHERIT
How a mapped view is shared with child processes. Only defined in kernel-mode headers.
Definition def.h:50
@ PanoViewShare
Definition def.h:51
@ PanoViewUnmap
Definition def.h:52
NTSTATUS(NTAPI * pNtModifyBootEntry)(PBOOT_ENTRY BootEntry)
The NtModifyBootEntry function modifies a boot entry in the boot configuration database.
Definition def.h:30
NTSTATUS(NTAPI * pNtSetInformationProcess)(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _In_reads_bytes_(ProcessInformationLength) PVOID ProcessInformation, _In_ ULONG ProcessInformationLength)
The NtSetInformationProcess function sets information about a process.
Definition def.h:176
NTSTATUS(NTAPI * pNtQueueApcThreadEx2)(_In_ HANDLE ThreadHandle, _In_opt_ HANDLE ReserveHandle, _In_ ULONG ApcFlags, _In_ PPANO_APC_ROUTINE ApcRoutine, _In_opt_ PVOID ApcArgument1, _In_opt_ PVOID ApcArgument2, _In_opt_ PVOID ApcArgument3)
The NtQueueApcThreadEx2 function queues a user-mode APC to a thread, optionally as a special user APC...
Definition def.h:165
NTSTATUS(NTAPI * pNtAllocateVirtualMemory)(_In_ HANDLE ProcessHandle, _Inout_ PVOID *BaseAddress, _In_ ULONG_PTR ZeroBits, _Inout_ PSIZE_T RegionSize, _In_ ULONG AllocationType, _In_ ULONG Protection)
The NtAllocateVirtualMemory function reserves and/or commits memory in a process.
Definition def.h:95
NTSTATUS(NTAPI * pNtReadVirtualMemory)(_In_ HANDLE ProcessHandle, _In_opt_ PVOID BaseAddress, _Out_writes_bytes_(NumberOfBytesToRead) PVOID Buffer, _In_ SIZE_T NumberOfBytesToRead, _Out_opt_ PSIZE_T NumberOfBytesRead)
The NtReadVirtualMemory function reads memory from a specified process.
Definition def.h:117
NTSTATUS(NTAPI * pNtMapViewOfSectionEx)(_In_ HANDLE SectionHandle, _In_ HANDLE ProcessHandle, _Inout_ _At_(*BaseAddress, _Readable_bytes_(*ViewSize) _Writable_bytes_(*ViewSize) _Post_readable_byte_size_(*ViewSize)) PVOID *BaseAddress, _Inout_opt_ PLARGE_INTEGER SectionOffset, _Inout_ PSIZE_T ViewSize, _In_ ULONG AllocationType, _In_ ULONG PageProtection, _Inout_updates_opt_(ExtendedParameterCount) PMEM_EXTENDED_PARAMETER ExtendedParameters, _In_ ULONG ExtendedParameterCount)
The NtMapViewOfSectionEx function maps a view of a section into the address space of a process.
Definition def.h:36
NTSTATUS(NTAPI * pNtUnmapViewOfSectionEx)(_In_ HANDLE ProcessHandle, _In_opt_ PVOID BaseAddress, _In_ ULONG Flags)
The NtUnmapViewOfSectionEx function unmaps a view of a section from the address space of a process,...
Definition def.h:79
VOID(NTAPI * PPANO_APC_ROUTINE)(_In_opt_ PVOID ApcArgument1, _In_opt_ PVOID ApcArgument2, _In_opt_ PVOID ApcArgument3)
The routine an APC queued with NtQueueApcThread runs. Not in the SDK headers.
Definition def.h:143
The BOOT_ENTRY structure represents a boot entry in the boot configuration database....
Definition def.h:8
ULONG FriendlyNameOffset
Definition def.h:13
ULONG Length
Definition def.h:10
ULONG OsOptionsLength
Definition def.h:15
ULONG Attributes
Definition def.h:12
ULONG Version
Definition def.h:9
ULONG BootFilePathOffset
Definition def.h:14
CHAR OsOptions[1]
Definition def.h:16
ULONG Id
Definition def.h:11