2023-08-19 04:52:57 +02:00
|
|
|
#ifndef MODULES_H
|
|
|
|
#define MODULES_H
|
|
|
|
|
|
|
|
#include <ntifs.h>
|
|
|
|
#include <intrin.h>
|
2023-09-25 17:41:38 +02:00
|
|
|
|
2023-08-22 19:32:25 +02:00
|
|
|
#include "common.h"
|
2023-08-19 04:52:57 +02:00
|
|
|
|
2024-04-13 06:40:51 +02:00
|
|
|
typedef struct _APC_OPERATION_ID {
|
2024-04-13 10:23:14 +02:00
|
|
|
int operation_id;
|
2023-09-28 18:10:01 +02:00
|
|
|
|
2023-12-13 05:06:27 +01:00
|
|
|
} APC_OPERATION_ID, *PAPC_OPERATION_ID;
|
2023-09-28 18:10:01 +02:00
|
|
|
|
2023-08-19 04:52:57 +02:00
|
|
|
/* system modules information */
|
|
|
|
|
2024-04-13 06:40:51 +02:00
|
|
|
typedef struct _SYSTEM_MODULES {
|
2024-04-13 10:23:14 +02:00
|
|
|
PVOID address;
|
|
|
|
INT module_count;
|
2023-08-19 04:52:57 +02:00
|
|
|
|
2023-12-13 05:06:27 +01:00
|
|
|
} SYSTEM_MODULES, *PSYSTEM_MODULES;
|
2023-08-19 04:52:57 +02:00
|
|
|
|
2023-09-25 17:41:38 +02:00
|
|
|
#define APC_CONTEXT_ID_STACKWALK 0x1
|
2024-05-30 07:42:35 +02:00
|
|
|
#define APC_CONTEXT_ID_STARTADDRESS 0x2
|
2023-09-25 17:41:38 +02:00
|
|
|
|
2024-04-13 06:40:51 +02:00
|
|
|
typedef struct _APC_CONTEXT_HEADER {
|
2024-04-13 10:23:14 +02:00
|
|
|
LONG context_id;
|
|
|
|
volatile INT count;
|
|
|
|
volatile INT allocation_in_progress;
|
2023-09-25 17:41:38 +02:00
|
|
|
|
2023-12-13 05:06:27 +01:00
|
|
|
} APC_CONTEXT_HEADER, *PAPC_CONTEXT_HEADER;
|
2023-09-26 12:00:45 +02:00
|
|
|
|
2024-04-13 06:40:51 +02:00
|
|
|
typedef struct _APC_STACKWALK_CONTEXT {
|
2024-04-13 10:23:14 +02:00
|
|
|
APC_CONTEXT_HEADER header;
|
|
|
|
PSYSTEM_MODULES modules;
|
2023-09-26 12:00:45 +02:00
|
|
|
|
2023-12-13 05:06:27 +01:00
|
|
|
} APC_STACKWALK_CONTEXT, *PAPC_STACKWALK_CONTEXT;
|
2023-09-25 17:41:38 +02:00
|
|
|
|
2023-10-05 08:27:17 +02:00
|
|
|
NTSTATUS
|
2023-12-13 05:06:27 +01:00
|
|
|
GetSystemModuleInformation(_Out_ PSYSTEM_MODULES ModuleInformation);
|
2023-08-19 04:52:57 +02:00
|
|
|
|
2023-10-05 08:27:17 +02:00
|
|
|
NTSTATUS
|
2024-01-21 08:22:06 +01:00
|
|
|
HandleValidateDriversIOCTL();
|
2023-08-19 04:52:57 +02:00
|
|
|
|
2023-10-05 08:27:17 +02:00
|
|
|
PRTL_MODULE_EXTENDED_INFO
|
2024-04-13 06:40:51 +02:00
|
|
|
FindSystemModuleByName(_In_ LPCSTR ModuleName,
|
|
|
|
_In_ PSYSTEM_MODULES SystemModules);
|
2023-08-22 19:32:25 +02:00
|
|
|
|
2023-10-05 08:27:17 +02:00
|
|
|
NTSTATUS
|
2024-01-25 12:09:16 +01:00
|
|
|
HandleNmiIOCTL();
|
2023-09-02 15:47:15 +02:00
|
|
|
|
2023-10-05 08:27:17 +02:00
|
|
|
NTSTATUS
|
2023-09-27 06:22:14 +02:00
|
|
|
ValidateThreadsViaKernelApc();
|
2023-09-24 13:13:20 +02:00
|
|
|
|
2023-09-26 15:32:06 +02:00
|
|
|
VOID
|
2023-12-13 05:06:27 +01:00
|
|
|
FreeApcStackwalkApcContextInformation(_Inout_ PAPC_STACKWALK_CONTEXT Context);
|
2023-10-07 17:37:47 +02:00
|
|
|
|
2024-05-05 15:58:36 +02:00
|
|
|
BOOLEAN
|
2024-07-19 16:27:50 +02:00
|
|
|
IsInstructionPointerInInvalidRegion(_In_ UINT64 Rip,
|
2024-05-05 15:58:36 +02:00
|
|
|
_In_ PSYSTEM_MODULES SystemModules);
|
2023-09-26 12:00:45 +02:00
|
|
|
|
2024-05-04 17:43:01 +02:00
|
|
|
PVOID
|
|
|
|
FindDriverBaseNoApi(_In_ PDRIVER_OBJECT DriverObject, _In_ PWCH Name);
|
|
|
|
|
2023-10-30 12:57:24 +01:00
|
|
|
NTSTATUS
|
2023-12-29 17:20:32 +01:00
|
|
|
DispatchStackwalkToEachCpuViaDpc();
|
2023-10-30 12:57:24 +01:00
|
|
|
|
2024-01-01 17:45:40 +01:00
|
|
|
NTSTATUS
|
|
|
|
ValidateHalDispatchTables();
|
|
|
|
|
2024-01-07 05:13:41 +01:00
|
|
|
PVOID
|
2024-01-28 08:34:09 +01:00
|
|
|
FindDriverBaseNoApi(_In_ PDRIVER_OBJECT DriverObject, _In_ PWCH Name);
|
2024-01-07 05:13:41 +01:00
|
|
|
|
2024-02-13 19:08:38 +01:00
|
|
|
NTSTATUS
|
2024-04-13 06:40:51 +02:00
|
|
|
GetDriverObjectByDriverName(_In_ PUNICODE_STRING DriverName,
|
|
|
|
_Out_ PDRIVER_OBJECT* DriverObject);
|
2024-02-13 19:08:38 +01:00
|
|
|
|
2024-05-04 17:43:01 +02:00
|
|
|
NTSTATUS
|
|
|
|
ValidateWin32kDispatchTables();
|
|
|
|
|
2023-08-19 04:52:57 +02:00
|
|
|
#endif
|