-
Notifications
You must be signed in to change notification settings - Fork 21
/
WDK.PGContext.h
1921 lines (1734 loc) · 71.6 KB
/
WDK.PGContext.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#pragma once
#include <winternl.h>
#pragma warning(push)
#pragma warning(disable: 4201)
namespace wdk
{
#define __Append$(x, y) x##y
#define Append$(x, y) __Append$(x, y)
#define AutoInc$(x) Append$(x, __COUNTER__)
#define Unkonwn$ AutoInc$(_Unknown)
struct PGProtectCode
{
UINT64 Routine;
UINT64 RoutineBytes;
};
struct PGProtectValue
{
UINT64 Address;
UINT64 Value;
};
struct PGProtectCode2
{
UINT64 Unkonwn$;
UINT64 Routine;
UINT32 RoutineBytes;
UINT32 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Reserved[2];
};
struct PGHashValidationBlock
{
UINT64 Unkonwn$;
UINT64 Address;
UINT32 Bytes;
UINT32 Hash;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
};
template<UINT64 _NumberOfStrs>
struct PGProtectString
{
UINT32 Bytes; // UINT64 * (2 + Count)
UINT32 Unkonwn$;
UINT64 Flags;
UINT64 Strings[_NumberOfStrs];
};
namespace build_7600
{
struct PGContextHeader
{
enum : UINT32
{
VerificationFunctionBytes = 0xC4
};
UINT8 PatchGuardVerification[VerificationFunctionBytes];
UINT32 ContextSizeInQWord;
};
struct PGContext : public PGContextHeader
{
UINT64 ExAcquireResourceSharedLite;
UINT64 ExAllocatePoolWithTag;
UINT64 ExFreePool;
UINT64 ExMapHandleToPointer;
UINT64 ExQueueWorkItem;
UINT64 ExReleaseResourceLite;
UINT64 ExUnlockHandleTableEntry;
UINT64 ExfAcquirePushLockExclusive;
UINT64 ExfReleasePushLockExclusive;
UINT64 KeAcquireInStackQueuedSpinLockAtDpcLevel;
UINT64 ExAcquireSpinLockShared;
UINT64 KeBugCheckEx;
UINT64 KeDelayExecutionThread;
UINT64 KeEnterCriticalRegionThread;
UINT64 KeLeaveCriticalRegion;
UINT64 KeEnterGuardedRegion;
UINT64 KeLeaveGuardedRegion;
UINT64 KeReleaseInStackQueuedSpinLockFromDpcLevel;
UINT64 ExReleaseSpinLockShared;
UINT64 KeRevertToUserAffinityThread;
UINT64 KeProcessorGroupAffinity;
UINT64 KeSetSystemGroupAffinityThread;
UINT64 KeSetTimer;
UINT64 LdrResFindResource;
UINT64 MmDbgCopyMemory;
UINT64 ObfDereferenceObject;
UINT64 ObReferenceObjectByName;
UINT64 RtlAssert;
UINT64 RtlImageDirectoryEntryToData;
UINT64 RtlImageNtHeader;
UINT64 RtlLookupFunctionTable;
UINT64 RtlSectionTableFromVirtualAddress;
UINT64 DbgPrint;
UINT64 DbgPrintEx;
UINT64 KiProcessListHead;
UINT64 KiProcessListLock;
UINT64 ObpTypeObjectType;
UINT64 PsActiveProcessHead;
UINT64 PsInvertedFunctionTable;
UINT64 PsLoadedModuleList;
UINT64 PsLoadedModuleResource;
UINT64 PsLoadedModuleSpinLock;
UINT64 PspActiveProcessLock;
UINT64 PspCidTable;
UINT64 SwapContext;
UINT64 EnlightenedSwapContext;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 WorkerRoutine;
UINT64 WorkerRoutineContext;
UINT32 Unkonwn$;
UINT32 Unkonwn$;
UINT64 Prcb;
UINT64 PGPageBase;
UINT64 DcpRoutineToBeScheduled; // E.g nt!ExpTimeZoneDpcRoutine
UINT32 Unkonwn$;
UINT32 Unkonwn$;
UINT32 OffsetOfPGSelfValidation; // nt!PGSelfValidation
UINT32 OffsetOfRtlLookupFunctionEntryEx; // nt!RtlLookupFunctionEntryEx
UINT32 OffsetOfFsRtlUninitializeSmallMcb; // nt!FsRtlUninitializeSmallMcb
UINT32 OffsetOfPGProtectCode2Table; // PGProtectCode2[?]
UINT64 Unkonwn$[7];
KIDTENTRY64 PGProtectIDTItems[3];
UINT64 Unkonwn$;
UINT64 IsTiggerPG;
UINT64 BugCheckArg0;
UINT64 BugCheckArg1;
UINT64 BugCheckArg3;
UINT64 BugCheckArg2;
UINT64 Unkonwn$;
UINT32 NumberOfProtectCodes;
UINT32 NumberOfProtectValues;
// PGProtectCode ProtectCodes[NumberOfProtectCodes];
// PGProtectValue ProtectValues[NumberOfProtectValues];
};
static_assert(sizeof(PGContext) == 0x340, "sizeof(PGContext) != 0x340");
}
namespace build_7601
{
using namespace build_7600;
}
namespace build_9200
{
using PGContextHeader = build_7601::PGContextHeader;
struct PGContext : public PGContextHeader
{
UINT64 ExAcquireResourceSharedLite;
UINT64 ExAllocatePoolWithTag;
UINT64 ExFreePool;
UINT64 ExMapHandleToPointer;
UINT64 ExQueueWorkItem;
UINT64 ExReleaseResourceLite;
UINT64 ExUnlockHandleTableEntry;
UINT64 ExfAcquirePushLockExclusive;
UINT64 ExfReleasePushLockExclusive;
UINT64 KeAcquireInStackQueuedSpinLockAtDpcLevel;
UINT64 ExAcquireSpinLockShared;
UINT64 KeBugCheckEx;
UINT64 KeDelayExecutionThread;
UINT64 KeEnterCriticalRegionThread;
UINT64 KeLeaveCriticalRegion;
UINT64 KeEnterGuardedRegion;
UINT64 KeLeaveGuardedRegion;
UINT64 KeReleaseInStackQueuedSpinLockFromDpcLevel;
UINT64 ExReleaseSpinLockShared;
UINT64 KeRevertToUserAffinityThread;
UINT64 KeProcessorGroupAffinity;
UINT64 KeSetSystemGroupAffinityThread;
UINT64 KeSetCoalescableTimer;
UINT64 LdrResFindResource;
UINT64 MmDbgCopyMemory;
UINT64 ObfDereferenceObject;
UINT64 ObReferenceObjectByName;
UINT64 RtlImageDirectoryEntryToData;
UINT64 RtlImageNtHeader;
UINT64 RtlLookupFunctionTable;
UINT64 RtlSectionTableFromVirtualAddress;
UINT64 DbgPrint;
UINT64 MmAllocateIndependentPages;
UINT64 MmFreeIndependentPages;
UINT64 MmSetPageProtection;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 RtlLookupFunctionEntry;
UINT64 KeAcquireSpinLockRaiseToDpc;
UINT64 KeReleaseSpinLock;
UINT64 MmGetSessionById;
UINT64 MmGetNextSession;
UINT64 MmQuitNextSession;
UINT64 MmAttachSession;
UINT64 MmDetachSession;
UINT64 MmGetSessionIdEx;
UINT64 KeInsertQueueApc;
UINT64 KeWaitForSingleObject;
UINT64 PsCreateSystemThread; // ??
UINT64 ExReferenceCallBackBlock;
UINT64 ExGetCallBackBlockRoutine;
UINT64 ExDereferenceCallBackBlock;
UINT64 KiScbQueueScanWorker;
UINT64 KiProcessListHead;
UINT64 KiProcessListLock;
UINT64 ObpTypeObjectType;
UINT64 PsActiveProcessHead;
UINT64 PsInvertedFunctionTable;
UINT64 PsLoadedModuleList;
UINT64 PsLoadedModuleResource;
UINT64 PsLoadedModuleSpinLock;
UINT64 PspActiveProcessLock;
UINT64 PspCidTable;
UINT64 SwapContext;
UINT64 EnlightenedSwapContext;
UINT64 Unkonwn$;
UINT64 ExpUuidLock;
UINT64 AlpcpPortListLock;
UINT64 KeServiceDescriptorTable;
UINT64 KeServiceDescriptorTableShadow;
UINT64 VfThunksExtended;
UINT64 PsWin32CallBack;
UINT64 Unkonwn$; // Global-Var In KiMarkBugCheckRegions;
UINT64 KiTableInformation;
UINT64 KxUnexpectedInterrupt0;
UINT64 Unkonwn$[2];
UINT64 Unkonwn$;
UINT64 ExNode0ListEntry; // &ExNode0.ListEntry
UINT64 WorkerRoutine;
UINT64 WorkerRoutineContext;
UINT64 Unkonwn$;
UINT64 Prcb;
UINT64 PGPageBase;
UINT64 SecondParamOfEndOfUninitialize;
UINT64 DcpRoutineToBeScheduled; // E.g INITKDBG: nt!KiTimerDispatch or nt!ExpCenturyDpcRoutine
UINT32 Unkonwn$; // NumberOfXXXX
UINT32 Unkonwn$;
UINT32 OffsetOfPGSelfValidation; // INITKDBG: nt!PGSelfValidation
UINT32 OffsetOfRtlLookupFunctionEntryEx; // nt!RtlLookupFunctionEntryEx
UINT32 OffsetOfFsRtlUninitializeSmallMcb; // nt!FsRtlUninitializeSmallMcb
UINT32 EndOffsetOf;
UINT64 SpinLock;
UINT32 OffsetOfPGHashValidationBlockTable; // PGHashValidationBlock[?]
UINT32 Unkonwn$;
UINT64 Unkonwn$[7];
KIDTENTRY64 PGProtectIDTItems[3];
UINT64 Unkonwn$[3];
UINT64 BaseOfNtos;
UINT64 BaseOfHal;
UINT64 BaseOfNtosNtHeader;
UINT64 IsTiggerPG;
UINT64 BugCheckArg0;
UINT64 BugCheckArg1;
UINT64 BugCheckArg3;
UINT64 BugCheckArg2;
PGProtectString<4> PGProtectStrings;
UINT64 Unkonwn$[4];
UINT64 BaseOfWin32k;
UINT64 Unkonwn$[10];
UINT32 NumberOfProtectCodes;
UINT32 NumberOfProtectValues;
// PGProtectCode ProtectCodes[NumberOfProtectCodes];
// PGProtectValue ProtectValues[NumberOfProtectValues];
};
}
namespace build_9600
{
using PGContextHeader = build_9200::PGContextHeader;
struct PGContext : public PGContextHeader
{
UINT64 ExAcquireResourceSharedLite;
UINT64 ExAcquireResourceExclusiveLite;
UINT64 ExAllocatePoolWithTag;
UINT64 ExFreePool;
UINT64 ExMapHandleToPointer;
UINT64 ExQueueWorkItem;
UINT64 ExReleaseResourceLite;
UINT64 ExUnlockHandleTableEntry;
UINT64 ExfAcquirePushLockExclusive;
UINT64 ExfReleasePushLockExclusive;
UINT64 ExfAcquirePushLockShared;
UINT64 ExfReleasePushLockShared;
UINT64 KeAcquireInStackQueuedSpinLockAtDpcLevel;
UINT64 ExAcquireSpinLockSharedAtDpcLevel;
UINT64 KeBugCheckEx;
UINT64 KeDelayExecutionThread;
UINT64 KeEnterCriticalRegionThread;
UINT64 KeLeaveCriticalRegion;
UINT64 KeEnterGuardedRegion;
UINT64 KeLeaveGuardedRegion;
UINT64 KeReleaseInStackQueuedSpinLockFromDpcLevel;
UINT64 ExReleaseSpinLockSharedFromDpcLevel;
UINT64 KeRevertToUserAffinityThread;
UINT64 KeProcessorGroupAffinity;
UINT64 KeSetSystemGroupAffinityThread;
UINT64 KeSetCoalescableTimer;
UINT64 ObfDereferenceObject;
UINT64 ObReferenceObjectByName;
UINT64 RtlImageDirectoryEntryToData;
UINT64 RtlImageNtHeader;
UINT64 RtlLookupFunctionTable;
UINT64 RtlPcToFileHeader;
UINT64 RtlSectionTableFromVirtualAddress;
UINT64 DbgPrint;
UINT64 MmAllocateIndependentPages;
UINT64 MmFreeIndependentPages;
UINT64 MmSetPageProtection;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 RtlLookupFunctionEntry;
UINT64 KeAcquireSpinLockRaiseToDpc;
UINT64 KeReleaseSpinLock;
UINT64 MmGetSessionById;
UINT64 MmGetNextSession;
UINT64 MmQuitNextSession;
UINT64 MmAttachSession;
UINT64 MmDetachSession;
UINT64 MmGetSessionIdEx;
UINT64 MmIsSessionAddress;
UINT64 KeInsertQueueApc;
UINT64 KeWaitForSingleObject;
UINT64 PsCreateSystemThread;
UINT64 ExReferenceCallBackBlock;
UINT64 ExGetCallBackBlockRoutine;
UINT64 ExDereferenceCallBackBlock;
UINT64 KiScbQueueScanWorker;
UINT64 PspEnumerateCallback;
UINT64 CmpEnumerateCallback;
UINT64 DbgEnumerateCallback;
UINT64 ExpEnumerateCallback;
UINT64 ExpGetNextCallback;
UINT64 PopPoCoalescinCallback_;
UINT64 KiSchedulerApcTerminate;
UINT64 KiSchedulerApc;
UINT64 PopPoCoalescinCallback;
UINT64 PGSelfEncryptWaitAndDecrypt;
UINT64 KiGetInterruptObjectAddress;
UINT64 KiWaitAlways;
UINT64 KiEntropyTimingRoutine;
UINT64 KiProcessListHead;
UINT64 KiProcessListLock;
UINT64 ObpTypeObjectType;
UINT64 IoDriverObjectType;
UINT64 PsActiveProcessHead;
UINT64 PsInvertedFunctionTable;
UINT64 PsLoadedModuleList;
UINT64 PsLoadedModuleResource;
UINT64 PsLoadedModuleSpinLock;
UINT64 PspActiveProcessLock;
UINT64 PspCidTable;
UINT64 ExpUuidLock;
UINT64 AlpcpPortListLock;
UINT64 KeServiceDescriptorTable;
UINT64 KeServiceDescriptorTableShadow;
UINT64 VfThunksExtended;
UINT64 PsWin32CallBack;
UINT64 Unkonwn$; // Global-Var In KiMarkBugCheckRegions;
UINT64 KiTableInformation;
UINT64 HandleTableListHead;
UINT64 HandleTableListLock;
UINT64 ObpKernelHandleTable;
UINT64 KiUserSharedData; // 0xFFFFF78000000000
UINT64 KiWaitNever;
UINT64 KxUnexpectedInterrupt0; // KiKvaShadow ? KiIsrThunkShadow : KxUnexpectedInterrupt0
};
}
namespace build_10240
{
struct PGContextHeader
{
enum : UINT32
{
VerificationFunctionBytes = 0xC4
};
UINT8 PatchGuardVerification[VerificationFunctionBytes];
UINT32 ContextSizeInQWord;
UINT64 Reserved[2];
};
struct PGContext : public PGContextHeader
{
UINT64 ExAcquireResourceSharedLite;
UINT64 ExAcquireResourceExclusiveLite;
UINT64 ExAllocatePoolWithTag;
UINT64 ExFreePool;
UINT64 ExMapHandleToPointer;
UINT64 ExQueueWorkItem;
UINT64 ExReleaseResourceLite;
UINT64 ExUnlockHandleTableEntry;
UINT64 ExAcquirePushLockExclusiveEx;
UINT64 ExReleasePushLockExclusiveEx;
UINT64 ExAcquirePushLockSharedEx;
UINT64 ExReleasePushLockSharedEx;
UINT64 KeAcquireInStackQueuedSpinLockAtDpcLevel;
UINT64 ExAcquireSpinLockSharedAtDpcLevel;
UINT64 KeBugCheckEx;
UINT64 KeDelayExecutionThread;
UINT64 KeEnterCriticalRegionThread;
UINT64 KeLeaveCriticalRegion;
UINT64 KeEnterGuardedRegion;
UINT64 KeLeaveGuardedRegion;
UINT64 KeReleaseInStackQueuedSpinLockFromDpcLevel;
UINT64 ExReleaseSpinLockSharedFromDpcLevel;
UINT64 KeRevertToUserAffinityThread;
UINT64 KeProcessorGroupAffinity;
UINT64 KeSetSystemGroupAffinityThread;
UINT64 KeSetCoalescableTimer;
UINT64 ObfDereferenceObject;
UINT64 ObReferenceObjectByName;
UINT64 RtlImageDirectoryEntryToData;
UINT64 RtlImageNtHeader;
UINT64 RtlLookupFunctionTable;
UINT64 RtlPcToFileHeader;
UINT64 RtlSectionTableFromVirtualAddress;
UINT64 DbgPrint;
UINT64 MmAllocateIndependentPages;
UINT64 MmFreeIndependentPages;
UINT64 MmSetPageProtection;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 RtlLookupFunctionEntry;
UINT64 KeAcquireSpinLockRaiseToDpc;
UINT64 KeReleaseSpinLock;
UINT64 MmGetSessionById;
UINT64 MmGetNextSession;
UINT64 MmQuitNextSession;
UINT64 MmAttachSession;
UINT64 MmDetachSession;
UINT64 MmGetSessionIdEx;
UINT64 MmIsSessionAddress;
UINT64 KeInsertQueueApc;
UINT64 KeWaitForSingleObject;
UINT64 PsCreateSystemThread;
UINT64 ExReferenceCallBackBlock;
UINT64 ExGetCallBackBlockRoutine;
UINT64 ExDereferenceCallBackBlock;
UINT64 KiScbQueueScanWorker;
UINT64 PspEnumerateCallback;
UINT64 CmpEnumerateCallback;
UINT64 DbgEnumerateCallback;
UINT64 ExpEnumerateCallback;
UINT64 ExpGetNextCallback;
UINT64 EmpCheckErrataList_;
UINT64 KiSchedulerApcTerminate;
UINT64 KiSchedulerApc;
UINT64 EmpCheckErrataList;
UINT64 PGSelfEncryptWaitAndDecrypt;
UINT64 MmAllocatePagesForMdlEx;
UINT64 MmAllocateMappingAddress;
UINT64 MmMapLockedPagesWithReservedMapping;
UINT64 MmUnmapReservedMapping;
UINT64 Unkonwn$; // nt!$$116+0x2e8
UINT64 Unkonwn$; // nt!$$116+0x350
UINT64 MmAcquireLoadLock;
UINT64 MmReleaseLoadLock;
UINT64 KeEnumerateQueueApc;
UINT64 KeIsApcRunningThread;
UINT64 Unkonwn$; // nt!$$115
UINT64 PsAcquireProcessExitSynchronization;
UINT64 PsReleaseProcessExitSynchronization;
UINT64 PsGetNextProcess;
UINT64 MmIsSessionLeaderProcess;
UINT64 PsInvokeWin32Callout;
UINT64 MmEnumerateAddressSpaceAndReferenceImages;
UINT64 PsGetProcessProtection;
UINT64 PsGetProcessSignatureLevel;
UINT64 PsGetProcessSectionBaseAddress;
UINT64 SeCompareSigningLevels;
UINT64 KeComputeSha256;
UINT64 KeComputeParallelSha256;
UINT64 KeSetEvent;
UINT64 RtlpConvertFunctionEntry;
UINT64 RtlpLookupPrimaryFunctionEntry;
UINT64 RtlIsMultiSessionSku;
UINT64 KiGetInterruptObjectAddress;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 PsInitialSystemProcess;
UINT64 KiWaitAlways;
UINT64 KiEntropyTimingRoutine;
UINT64 KiProcessListHead;
UINT64 KiProcessListLock;
UINT64 ObpTypeObjectType;
UINT64 IoDriverObjectType;
UINT64 PsActiveProcessHead;
UINT64 PsInvertedFunctionTable;
UINT64 PsLoadedModuleList;
UINT64 PsLoadedModuleResource;
UINT64 PsLoadedModuleSpinLock;
UINT64 PspActiveProcessLock;
UINT64 PspCidTable;
UINT64 ExpUuidLock;
UINT64 AlpcpPortListLock;
UINT64 KeServiceDescriptorTable;
UINT64 KeServiceDescriptorTableShadow;
UINT64 VfThunksExtended;
UINT64 PsWin32CallBack;
UINT64 Unkonwn$;
UINT64 KiTableInformation;
UINT64 HandleTableListHead;
UINT64 HandleTableListLock;
UINT64 ObpKernelHandleTable;
UINT64 KiUserSharedData; // 0xFFFFF78000000000
UINT64 KiWaitNever;
UINT64 SeProtectedMapping;
UINT64 KiInterruptThunk;
UINT64 CcPeriodicEvent;
UINT64 KxUnexpectedInterrupt0;
UINT64 Unkonwn$[2];
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$[2];
UINT64 WorkerRoutine;
UINT64 WorkerRoutineContext;
UINT64 Unkonwn$;
UINT64 Prcb;
UINT64 PGPageBase;
UINT64 SecondParamOfEndOfUninitialize;
UINT64 DcpRoutineToBeScheduled;
UINT32 Unkonwn$; // NumberOfXXXX
UINT32 Unkonwn$;
UINT32 OffsetOfPGSelfValidation; // INITKDBG: nt!PGSelfValidation
UINT32 OffsetOfRtlLookupFunctionEntryEx; // nt!RtlLookupFunctionEntryEx
UINT32 OffsetOfFsRtlUninitializeSmallMcb; // nt!FsRtlUninitializeSmallMcb
UINT32 OffsetOfFsRtlUnknown0; // xref: nt!FsRtlMdlReadCompleteDevEx
UINT32 OffsetOfFsRtlUnkonwn1; // xref: nt!FsRtlMdlReadCompleteDevEx
UINT32 EndOffsetOf;
UINT64 SpinLock;
UINT64 Unkonwn$[7];
KIDTENTRY64 PGProtectIDTItems[3];
UINT64 Unkonwn$;
UINT64 BaseOfNtos;
UINT64 BaseOfHal;
UINT64 BaseOfNtosNtHeader;
UINT64 IsTiggerPG;
UINT64 BugCheckArg0;
UINT64 BugCheckArg1;
UINT64 BugCheckArg3;
UINT64 BugCheckArg2;
PGProtectString<4> PGProtectStrings;
UINT64 Unkonwn$[4];
UINT64 BaseOfWin32k;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$[8];
UINT64 _UnknownListEntry0;
UINT64 KiDispatchCallout2;
UINT64 EmpCheckErrataList2;
UINT64 _UnknownListEntry1;
UINT64 Unkonwn$[11];
UINT32 NumberOfProtectCodes;
UINT32 NumberOfProtectValues;
// PGProtectCode ProtectCodes[NumberOfProtectCodes];
// PGProtectValue ProtectValues[NumberOfProtectValues];
};
}
namespace build_10586
{
struct PGContextHeader
{
enum : UINT32
{
VerificationFunctionBytes = 0xC4
};
UINT8 PatchGuardVerification[VerificationFunctionBytes];
UINT32 ContextSizeInQWord;
UINT64 Reserved[3];
};
struct PGContext : public PGContextHeader
{
UINT64 ExAcquireResourceSharedLite;
UINT64 ExAcquireResourceExclusiveLite;
UINT64 ExAllocatePoolWithTag;
UINT64 ExFreePool;
UINT64 ExMapHandleToPointer;
UINT64 ExQueueWorkItem;
UINT64 ExReleaseResourceLite;
UINT64 ExUnlockHandleTableEntry;
UINT64 ExAcquirePushLockExclusiveEx;
UINT64 ExReleasePushLockExclusiveEx;
UINT64 ExAcquirePushLockSharedEx;
UINT64 ExReleasePushLockSharedEx;
UINT64 KeAcquireInStackQueuedSpinLockAtDpcLevel;
UINT64 ExAcquireSpinLockSharedAtDpcLevel;
UINT64 KeBugCheckEx;
UINT64 KeDelayExecutionThread;
UINT64 KeEnterCriticalRegionThread;
UINT64 KeLeaveCriticalRegion;
UINT64 KeEnterGuardedRegion;
UINT64 KeLeaveGuardedRegion;
UINT64 KeReleaseInStackQueuedSpinLockFromDpcLevel;
UINT64 ExReleaseSpinLockSharedFromDpcLevel;
UINT64 KeRevertToUserAffinityThread;
UINT64 KeProcessorGroupAffinity;
UINT64 KeSetSystemGroupAffinityThread;
UINT64 KeSetCoalescableTimer;
UINT64 ObfDereferenceObject;
UINT64 ObReferenceObjectByName;
UINT64 RtlImageDirectoryEntryToData;
UINT64 RtlImageNtHeader;
UINT64 RtlLookupFunctionTable;
UINT64 RtlPcToFileHeader;
UINT64 RtlSectionTableFromVirtualAddress;
UINT64 DbgPrint;
UINT64 MmAllocateIndependentPages;
UINT64 MmFreeIndependentPages;
UINT64 MmSetPageProtection;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 RtlLookupFunctionEntry;
UINT64 KeAcquireSpinLockRaiseToDpc;
UINT64 KeReleaseSpinLock;
UINT64 MmGetSessionById;
UINT64 MmGetNextSession;
UINT64 MmQuitNextSession;
UINT64 MmAttachSession;
UINT64 MmDetachSession;
UINT64 MmGetSessionIdEx;
UINT64 MmIsSessionAddress;
UINT64 KeInsertQueueApc;
UINT64 KeWaitForSingleObject;
UINT64 PsCreateSystemThread;
UINT64 ExReferenceCallBackBlock;
UINT64 ExGetCallBackBlockRoutine;
UINT64 ExDereferenceCallBackBlock;
UINT64 KiScbQueueScanWorker;
UINT64 PspEnumerateCallback;
UINT64 CmpEnumerateCallback;
UINT64 DbgEnumerateCallback;
UINT64 ExpEnumerateCallback;
UINT64 ExpGetNextCallback;
UINT64 EmpCheckErrataList_;
UINT64 KiSchedulerApcTerminate;
UINT64 KiSchedulerApc;
UINT64 EmpCheckErrataList;
UINT64 PGSelfEncryptWaitAndDecrypt;
UINT64 MmAllocatePagesForMdlEx;
UINT64 MmAllocateMappingAddress;
UINT64 MmMapLockedPagesWithReservedMapping;
UINT64 MmUnmapReservedMapping;
UINT64 Unkonwn$; // nt!$$116+0x2e8
UINT64 Unkonwn$; // nt!$$116+0x350
UINT64 MmAcquireLoadLock;
UINT64 MmReleaseLoadLock;
UINT64 KeEnumerateQueueApc;
UINT64 KeIsApcRunningThread;
UINT64 Unkonwn$; // nt!$$115
UINT64 PsAcquireProcessExitSynchronization;
UINT64 PsReleaseProcessExitSynchronization;
UINT64 PsGetNextProcess;
UINT64 MmIsSessionLeaderProcess;
UINT64 PsInvokeWin32Callout;
UINT64 MmEnumerateAddressSpaceAndReferenceImages;
UINT64 PsGetProcessProtection;
UINT64 PsGetProcessSignatureLevel;
UINT64 PsGetProcessSectionBaseAddress;
UINT64 SeCompareSigningLevels;
UINT64 KeComputeSha256;
UINT64 KeComputeParallelSha256;
UINT64 KeSetEvent;
UINT64 RtlpConvertFunctionEntry;
UINT64 RtlpLookupPrimaryFunctionEntry;
UINT64 RtlIsMultiSessionSku;
UINT64 KiGetInterruptObjectAddress;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 PsInitialSystemProcess;
UINT64 KiWaitAlways;
UINT64 KiEntropyTimingRoutine;
UINT64 KiProcessListHead;
UINT64 KiProcessListLock;
UINT64 ObpTypeObjectType;
UINT64 IoDriverObjectType;
UINT64 PsActiveProcessHead;
UINT64 PsInvertedFunctionTable;
UINT64 PsLoadedModuleList;
UINT64 PsLoadedModuleResource;
UINT64 PsLoadedModuleSpinLock;
UINT64 PspActiveProcessLock;
UINT64 PspCidTable;
UINT64 ExpUuidLock;
UINT64 AlpcpPortListLock;
UINT64 KeServiceDescriptorTable;
UINT64 KeServiceDescriptorTableShadow;
UINT64 VfThunksExtended;
UINT64 PsWin32CallBack;
UINT64 Unkonwn$; // nt!TriageImagePageSize+0x30
UINT64 KiTableInformation;
UINT64 HandleTableListHead;
UINT64 HandleTableListLock;
UINT64 ObpKernelHandleTable;
UINT64 KiUserSharedData; // 0xFFFFF78000000000
UINT64 KiWaitNever;
UINT64 SeProtectedMapping;
UINT64 KiInterruptThunk;
UINT64 CcPeriodicEvent;
UINT64 KxUnexpectedInterrupt0; // nt!KiIsrThunk
UINT64 Unkonwn$[5];
UINT64 WorkerRoutine;
UINT64 WorkerRoutineContext;
UINT64 Unkonwn$;
UINT64 Prcb;
UINT64 PGPageBase;
UINT64 SecondParamOfEndOfUninitialize;
UINT64 DcpRoutineToBeScheduled;
UINT32 Unkonwn$; // NumberOfXXXX
UINT32 Unkonwn$;
UINT32 OffsetOfPGSelfValidation; // INITKDBG: nt!PGSelfValidation
UINT32 OffsetOfRtlLookupFunctionEntryEx; // nt!RtlLookupFunctionEntryEx
UINT32 OffsetOfFsRtlUninitializeSmallMcb; // nt!FsRtlUninitializeSmallMcb
UINT32 OffsetOfFsRtlUnknown0; // xref: nt!FsRtlMdlReadCompleteDevEx
UINT32 OffsetOfFsRtlUnkonwn1; // xref: nt!FsRtlMdlReadCompleteDevEx
UINT32 EndOffsetOf;
UINT64 SpinLock;
UINT64 Unkonwn$[7];
KIDTENTRY64 PGProtectIDTItems[3];
UINT64 Unkonwn$;
UINT64 BaseOfNtos;
UINT64 BaseOfHal;
UINT64 BaseOfNtosNtHeader;
UINT64 IsTiggerPG;
UINT64 BugCheckArg0;
UINT64 BugCheckArg1;
UINT64 BugCheckArg3;
UINT64 BugCheckArg2;
PGProtectString<4> PGProtectStrings;
UINT64 Unkonwn$[4];
UINT64 BaseOfWin32k;
UINT64 Unkonwn$[25];
UINT32 NumberOfProtectCodes;
UINT32 NumberOfProtectValues;
// PGProtectCode ProtectCodes[NumberOfProtectCodes];
// PGProtectValue ProtectValues[NumberOfProtectValues];
};
}
namespace build_14393
{
struct PGContextHeader
{
enum : UINT32
{
VerificationFunctionBytes = 0xC4
};
UINT8 PatchGuardVerification[VerificationFunctionBytes];
UINT32 ContextSizeInQWord;
UINT64 Reserved;
};
struct PGContext : public PGContextHeader
{
UINT64 ExAcquireResourceSharedLite;
UINT64 ExAcquireResourceExclusiveLite;
UINT64 ExAllocatePoolWithTag;
UINT64 ExFreePool;
UINT64 ExMapHandleToPointer;
UINT64 ExQueueWorkItem;
UINT64 ExReleaseResourceLite;
UINT64 ExUnlockHandleTableEntry;
UINT64 ExAcquirePushLockExclusiveEx;
UINT64 ExReleasePushLockExclusiveEx;
UINT64 ExAcquirePushLockSharedEx;
UINT64 ExReleasePushLockSharedEx;
UINT64 KeAcquireInStackQueuedSpinLockAtDpcLevel;
UINT64 ExAcquireSpinLockSharedAtDpcLevel;
UINT64 KeBugCheckEx;
UINT64 KeDelayExecutionThread;
UINT64 KeEnterCriticalRegionThread;
UINT64 KeLeaveCriticalRegion;
UINT64 KeEnterGuardedRegion;
UINT64 KeLeaveGuardedRegion;
UINT64 KeReleaseInStackQueuedSpinLockFromDpcLevel;
UINT64 ExReleaseSpinLockSharedFromDpcLevel;
UINT64 KeRevertToUserAffinityThread;
UINT64 KeProcessorGroupAffinity;
UINT64 KeInitializeEnumerationContext;
UINT64 KeEnumerateNextProcessor;
UINT64 KeCountSetBitsAffinityEx;
UINT64 KeQueryAffinityProcess;
UINT64 KeQueryAffinityThread;
UINT64 KeSetSystemGroupAffinityThread;
UINT64 KeSetCoalescableTimer;
UINT64 ObfDereferenceObject;
UINT64 ObReferenceObjectByName;
UINT64 RtlImageDirectoryEntryToData;
UINT64 RtlImageNtHeader;
UINT64 RtlLookupFunctionTable;
UINT64 RtlPcToFileHeader;
UINT64 RtlSectionTableFromVirtualAddress;
UINT64 DbgPrint;
UINT64 MmAllocateIndependentPages;
UINT64 MmFreeIndependentPages;
UINT64 MmSetPageProtection;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 Unkonwn$;
UINT64 RtlLookupFunctionEntry;
UINT64 KeAcquireSpinLockRaiseToDpc;
UINT64 KeReleaseSpinLock;
UINT64 MmGetSessionById;
UINT64 MmGetNextSession;
UINT64 MmQuitNextSession;
UINT64 MmAttachSession;
UINT64 MmDetachSession;
UINT64 MmGetSessionIdEx;
UINT64 MmIsSessionAddress;
UINT64 MmIsAddressValid;
UINT64 MmSessionGetWin32Callouts;
UINT64 KeInsertQueueApc;
UINT64 KeWaitForSingleObject;
UINT64 PsCreateSystemThread;
UINT64 ExReferenceCallBackBlock;
UINT64 ExGetCallBackBlockRoutine;
UINT64 ExDereferenceCallBackBlock;
UINT64 KiScbQueueScanWorker;
UINT64 PspEnumerateCallback;
UINT64 CmpEnumerateCallback;
UINT64 DbgEnumerateCallback;
UINT64 ExpEnumerateCallback;
UINT64 ExpGetNextCallback;
UINT64 EmpCheckErrataList_;
UINT64 KiSchedulerApcTerminate;
UINT64 KiSchedulerApc;
UINT64 EmpCheckErrataList;
UINT64 PGSelfEncryptWaitAndDecrypt;
UINT64 MmAllocatePagesForMdlEx;
UINT64 MmAllocateMappingAddress;
UINT64 MmMapLockedPagesWithReservedMapping;
UINT64 MmUnmapReservedMapping;
UINT64 Unkonwn$; // nt!$$116+0x2e8
UINT64 Unkonwn$; // nt!$$116+0x350
UINT64 MmAcquireLoadLock;
UINT64 MmReleaseLoadLock;
UINT64 KeEnumerateQueueApc;
UINT64 KeIsApcRunningThread;
UINT64 Unkonwn$; // nt!$$115
UINT64 PsAcquireProcessExitSynchronization;
UINT64 PsReleaseProcessExitSynchronization;
UINT64 PsGetNextProcess;
UINT64 PsQuitNextProcess;
UINT64 MmIsSessionLeaderProcess;
UINT64 PsInvokeWin32Callout;
UINT64 MmEnumerateAddressSpaceAndReferenceImages;
UINT64 PsGetProcessProtection;
UINT64 PsGetProcessSignatureLevel;
UINT64 PsGetProcessSectionBaseAddress;
UINT64 SeCompareSigningLevels;
UINT64 KeComputeSha256;
UINT64 KeComputeParallelSha256;
UINT64 KeSetEvent;
UINT64 RtlpConvertFunctionEntry;
UINT64 RtlpLookupPrimaryFunctionEntry;
UINT64 RtlIsMultiSessionSku;
UINT64 KiEnumerateCallback;
UINT64 KeStackAttachProcess;
UINT64 KeUnstackDetachProcess;
UINT64 KiGetInterruptObjectAddress;
UINT64 Unkonwn$;
UINT64 PsInitialSystemProcess;
UINT64 KiWaitAlways;
UINT64 KiEntropyTimingRoutine;
UINT64 KiProcessListHead;
UINT64 KiProcessListLock;
UINT64 ObpTypeObjectType;
UINT64 IoDriverObjectType;
UINT64 PsActiveProcessHead;
UINT64 PsInvertedFunctionTable;
UINT64 PsLoadedModuleList;
UINT64 PsLoadedModuleResource;
UINT64 PsLoadedModuleSpinLock;
UINT64 PspActiveProcessLock;
UINT64 PspCidTable;
UINT64 ExpUuidLock;
UINT64 AlpcpPortListLock;
UINT64 KeServiceDescriptorTable;
UINT64 KeServiceDescriptorTableShadow;
UINT64 KeServiceDescriptorTableFilter;
UINT64 VfThunksExtended;
UINT64 PsWin32CallBack;
UINT64 Unkonwn$; // nt!TriageImagePageSize+0x30
UINT64 KiTableInformation;
UINT64 HandleTableListHead;
UINT64 HandleTableListLock;
UINT64 ObpKernelHandleTable;
UINT64 KiUserSharedData; // 0xFFFFF78000000000
UINT64 KiWaitNever;
UINT64 SeProtectedMapping;
UINT64 KiInterruptThunk;
UINT64 CcPeriodicEvent;
UINT64 PageTables; // 0xFFFFC28000000000
UINT64 KxUnexpectedInterrupt0; // nt!KiIsrThunk
UINT64 Unkonwn$[5];
UINT64 WorkerRoutine;
UINT64 WorkerRoutineContext;
UINT64 Unkonwn$;
UINT64 Prcb;
UINT64 PGPageBase;
UINT64 SecondParamOfEndOfUninitialize;
UINT64 DcpRoutineToBeScheduled;
UINT32 Unkonwn$; // NumberOfXXXX