Skip to content

Commit f87bcde

Browse files
authored
Merge pull request #97 from 4B4DB4B3/master
Fix #93 issue
2 parents 5edf3e7 + 97824fc commit f87bcde

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

Garhal/garhal.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ NTSTATUS DriverEntry(PDRIVER_OBJECT pDriverObject, PUNICODE_STRING pRegistryPath
6969
pDeviceObject->Flags |= DO_DIRECT_IO;
7070
pDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
7171

72+
// 4B4DB4B3: Bypass MmVerifyRegisterCallbacksFlags
73+
// Fix STATUS_ACCESS_DENIED
74+
PKLDR_DATA_TABLE_ENTRY ldr = (PKLDR_DATA_TABLE_ENTRY)pDriverObject->DriverSection;
75+
ldr->Flags |= 0x20; // LDRP_VALID_SECTION
76+
7277
NTSTATUS reg = RegisterOBCallback();
7378
if (reg == STATUS_SUCCESS)
7479
{

Garhal/gstructs.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@
33
#include <ntifs.h>
44
#include <minwindef.h>
55

6+
// 4b4db4b3
7+
typedef struct _KLDR_DATA_TABLE_ENTRY {
8+
LIST_ENTRY InLoadOrderLinks;
9+
PVOID ExceptionTable;
10+
ULONG ExceptionTableSize;
11+
PVOID GpValue;
12+
PVOID NonPagedDebugInfo;
13+
PVOID DllBase;
14+
PVOID EntryPoint;
15+
ULONG SizeOfImage;
16+
UNICODE_STRING FullDllName;
17+
UNICODE_STRING BaseDllName;
18+
ULONG Flags;
19+
USHORT LoadCount;
20+
USHORT __Unused5;
21+
PVOID SectionPointer;
22+
ULONG CheckSum;
23+
PVOID LoadedImports;
24+
PVOID PatchInformation;
25+
} KLDR_DATA_TABLE_ENTRY, * PKLDR_DATA_TABLE_ENTRY;
26+
// 4b4db4b3
27+
628
typedef struct _LDR_DATA_TABLE_ENTRY
729
{
830
LIST_ENTRY InLoadOrderLinks;

0 commit comments

Comments
 (0)