Files
wavestone-cdt-edrsandblast/EDRSandblast/Includes/KernelDSE.h
T
Maxime Meignan f15471d12c DSE bypass : implemented "callback swapping" method
The new default method for unsigned driver loading uses a KDP compatible
technique, since it does not overwrite the protected variable g_CiOptions.
Based on the work of: https://github.com/0mWindyBug/KDP-compatible-driver-loader

Co-authored-by: Windy Bug <139051196+0mWindyBug@users.noreply.github.com>
2023-11-03 15:13:36 +01:00

28 lines
973 B
C

#pragma once
#pragma comment(lib, "ntdll.lib")
#define DEFAULT_EVIL_DRIVER_FILE TEXT("evil.sys")
#include "PrintFunctions.h"
#if !defined(PRINT_ERROR_AUTO)
#define PRINT_ERROR_AUTO(func) _tprintf_or_not(TEXT("[!] ERROR ") TEXT(__FUNCTION__) TEXT(" ; ") func TEXT(" (0x%08x)\n"), GetLastError())
#endif
enum dseDisablingMethods_e {
G_CIOPTIONS_PATCHING,
CALLBACK_SWAPPING,
};
BOOLEAN IsCiEnabled();
DWORD64 FindCIBaseAddress();
BOOL patch_gCiOptions(DWORD64 CiVariableAddress, ULONG CiOptionsValue, PULONG OldCiOptionsValue);
BOOL disableDSE(enum dseDisablingMethods_e method, BOOL verbose);
BOOL reenableDSE(enum dseDisablingMethods_e method, BOOL verbose);
BOOL disableDSEbyCallbackSwapping(DWORD64* oldCiValidateImageHeaderEntryAddr);
BOOL reenableDSEbyCallbackSwapping(DWORD64 ciValidateImageHeaderEntryAddr);
BOOL disableDSEbyPatchingCiOptions(BOOL verbose, _Out_ ULONG* OldCiOptionsValue);
BOOL reenableDSEbyPatchingCiOptions(ULONG OldCiOptionsValue);