Bitdefender Hypervisor Memory Introspection
exceptions.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #ifndef _EXCEPTIONS_H_
6 #define _EXCEPTIONS_H_
7 
13 
18 
19 #include "guest_stack.h"
20 #include "drivers.h"
21 #include "integrity.h"
22 #include "introcpu.h"
23 #include "lixprocess.h"
24 #include "winummodule.h"
25 
26 // Special value, so we don't log this
27 #define EXCEPTION_INTROUNIT_NAME_HASH 0x1036c1b7
28 #define EXCEPTION_NO_NAME "<no name>"
29 #define EXCEPTION_NO_WNAME u"<no name>"
30 #define EXCEPTION_NO_INSTRUCTION "<generic>"
31 #define EXCEPTION_NO_SYMBOL "<no sym>"
32 
33 #define EXPORT_BEGIN_WRITE_ERR_RANGE 0x10
34 #define EXPORT_NAME_UNKNOWN "<unknown>"
35 
36 #define EXCEPTION_UM_GLOB_LENGTH 64
37 
38 //
39 // We group exceptions into 16 categories, by the originator hash:
40 // 0 - GeneralExceptions (special ones)
41 // 0x00000001 - 0x0fffffff
42 // 0x10000000 - 0x1fffffff
43 // 0x20000000 - 0x2fffffff
44 // .......................
45 // 0xf0000000 - 0xfffffffe
46 //
47 // NOTE: 0xffffffff as a hash is invalid!
48 //
49 #define EXCEPTION_TABLE_SIZE 0x10
50 #define EXCEPTION_TABLE_ID(H) (((H) & 0xF0000000) >> 0x1c)
51 
53 #define EXCEPTION_CODEBLOCKS_OFFSET 0x250
54 
58 typedef enum _EXCEPTION_TYPE
59 {
65 
66 
71 {
81 
82 
86 typedef struct _EXCEPTIONS
87 {
92 
95 
100 
103 
106 
111 
120 
129 
138 
139  struct
140  {
144  } Version;
145 
148 
149 
154 {
155  kmObjNone = 0,
182 
183  // Add more as needed
185 
186 
191 {
197 
198  // Add more as needed
200 
201 
206 {
207  umObjNone = 0,
227 
228  // Add more as needed
230 
231 
232 
236 #pragma pack(push)
237 #pragma pack(4)
239 {
240  struct
241  {
242  DWORD Value : 22;
243  DWORD Type : 10;
244  } Field;
245 
246  DWORD Value;
248 
249 
253 typedef struct _KM_EXCEPTION
254 {
256 
258 
260 
262 
264 
266 
268  EXCEPTION_SIGNATURE_ID Signatures[];
270 
271 
275 typedef struct _KUM_EXCEPTION
276 {
278 
279  union
280  {
284  } Originator;
285 
286  struct
287  {
288  DWORD NameHash;
289  DWORD ProcessHash;
291  } Victim;
292 
294 
296 
298 
300  EXCEPTION_SIGNATURE_ID Signatures[];
302 
303 
304 
308 typedef struct _UM_EXCEPTION
309 {
311 
313 
314  struct
315  {
317  DWORD ProcessHash;
320  } Victim;
321 
323 
325 
327 
329  EXCEPTION_SIGNATURE_ID Signatures[];
331 
332 
336 typedef struct _UM_EXCEPTION_GLOB
337 {
339 
341  char OriginatorNameGlob[EXCEPTION_UM_GLOB_LENGTH];
342 
343  struct
344  {
350  } Victim;
351 
353 
355 
357 
359  EXCEPTION_SIGNATURE_ID Signatures[];
361 
362 
366 typedef struct _SIG_CODEBLOCK_HASH
367 {
369  DWORD Hashes[];
371 
372 
376 typedef struct _SIG_VALUE_HASH
377 {
382 
383 
387 typedef struct _SIG_EXPORT_HASH
388 {
392 
393 
398 {
400 
403 
407 
408  CHAR Object[];
410 
411 
415 typedef struct _SIG_VALUE_CODE
416 {
418 
421 
425 
426  WORD Object[];
428 
429 
433 typedef struct _SIG_EXPORT
434 {
436 
439 
441 
444 
445  CHAR Object[];
447 
448 
452 typedef struct _SIG_VALUE
453 {
455 
458 
462 
463  CHAR Object[];
465 
466 
470 typedef struct _SIG_IDT
471 {
473 
476 
478 
480 } SIG_IDT, *PSIG_IDT;
481 
482 
486 typedef struct _SIG_VERSION_OS
487 {
489 
492 
494 
495  union
496  {
498  struct
499  {
504  BYTE _Reserved[2];
505  };
506 
508  } Minimum;
509 
510  union
511  {
513  struct
514  {
515  BYTE Version;
516  BYTE Patch;
517  WORD Sublevel;
518  WORD Backport;
519  BYTE _Reserved[2];
520  };
521 
522  QWORD Value;
523  } Maximum;
524 
526 
527 
531 typedef struct _SIG_VERSION_INTRO
532 {
534 
537 
539 
540  union
541  {
543  struct
544  {
549  };
550 
552  } Minimum;
553 
554  union
555  {
557  struct
558  {
559  WORD Major;
560  WORD Minor;
561  WORD Revision;
562  WORD Build;
563  };
564 
565  QWORD Raw;
566  } Maximum;
567 
569 
570 
574 typedef struct _SIG_PROCESS_CREATION
575 {
577 
580 
582 
584 
586 
587 #pragma pack(pop)
588 
589 
593 typedef enum _EXCEPTION_FLG
594 {
595  EXCEPTION_FLG_FEEDBACK = 0x00000001,
596  EXCEPTION_FLG_32 = 0x00000002,
597  EXCEPTION_FLG_64 = 0x00000004,
598  EXCEPTION_FLG_INIT = 0x00000008,
601  EXCEPTION_FLG_RETURN = 0x00000010,
602 
603  EXCEPTION_FLG_LINUX = 0x00000080,
604 
605  EXCEPTION_FLG_READ = 0x10000000,
606  EXCEPTION_FLG_WRITE = 0x20000000,
607  EXCEPTION_FLG_EXECUTE = 0x40000000,
608 
609  EXCEPTION_FLG_IGNORE = 0x80000000,
610 
615  EXCEPTION_KM_FLG_SMAP = 0x00000400,
616  EXCEPTION_KM_FLG_SMEP = 0x00000800,
617 
619 
624 
627 
632 } EXCEPTION_FLG;
633 
634 
638 typedef enum _KM_EXCEPTION_NAME
639 {
645 
648 
650 
651  // Note: Add new names only from this line on, because the exception generation
652  // script depends on the ordering of these values.
653 
654  // Add more as needed
655 
657 
659 
660 
665 {
671 
672  // Note: Add new names only from this line on, because the exception generation
673  // script depends on the ordering of these values.
674 
675  // Add more as needed
676 
678 
680 
681 
685 typedef enum _UM_EXCEPTION_NAME
686 {
691 
693 
694  // Add more as needed
695 
698 
699 
703 typedef enum _SIGNATURE_FLG
704 {
705  SIGNATURE_FLG_32 = 0x00000001,
706  SIGNATURE_FLG_64 = 0x00000002,
707 
708  SIGNATURE_FLG_CB_MEDIUM = 0x00000004,
709 
712 
713  SIGNATURE_FLG_LINUX = 0x00000080,
714 
715 } SIGNATURE_FLG;
716 
717 
718 //
719 // Zone flags
720 //
721 #define ZONE_LIB_IMPORTS 0x000000001ULL
722 #define ZONE_LIB_EXPORTS 0x000000002ULL
723 #define ZONE_LIB_CODE 0x000000004ULL
724 #define ZONE_LIB_DATA 0x000000008ULL
725 #define ZONE_LIB_RESOURCES 0x000000010ULL
727 
728 #define ZONE_PROC_THREAD_CTX 0x000000020ULL
729 #define ZONE_PROC_THREAD_APC 0x000000040ULL
730 #define ZONE_DEP_EXECUTION 0x000000080ULL
731 #define ZONE_MODULE_LOAD 0x000000100ULL
732 #define ZONE_PROC_INSTRUMENT 0x000000200ULL
733 
734 #define ZONE_WRITE 0x010000000ULL
735 #define ZONE_READ 0x020000000ULL
736 #define ZONE_EXECUTE 0x040000000ULL
737 
738 #define ZONE_INTEGRITY 0x100000000ULL
739 
740 
744 typedef enum _ZONE_TYPE
745 {
753 } ZONE_TYPE;
754 
755 
759 typedef struct _EXCEPTION_VICTIM_EPT
760 {
764 
765 
769 typedef struct _EXCEPTION_VICTIM_MSR
770 {
774 
775 
779 typedef struct _EXCEPTION_VICTIM_CR
780 {
782 
786 
787 
791 typedef struct _EXCEPTION_VICTIM_DTR
792 {
795 
796 
801 {
805  BYTE InterruptObjIndex;
815 
816 
821 {
824 
828 
833 {
834  union
835  {
836  void *Module;
838 
839  };
840 
841  char SectionName[9];
842 
845 
846 
851 {
853 
855 
856  union
857  {
858  char *Name;
860  };
861 
864 
865  union
866  {
867  union
868  {
871  };
872 
873  // All of the fields can be valid (injection into a library which has a VAD for eg.).
874  struct
875  {
876  VAD *Vad;
878 
879  union
880  {
881  void *Process;
884  };
885  };
886  };
888 
889 
894 {
896 
899 
901 
902  union
903  {
910  };
911 
912  union
913  {
914  struct
915  {
916  QWORD OldValue[8];
917  QWORD NewValue[8];
918 
920  } WriteInfo;
921 
922  struct
923  {
924  QWORD Value[8];
925 
926  DWORD AccessSize;
927  } ReadInfo;
928 
929  struct
930  {
935  } ExecInfo;
936  };
938 
939 
944 {
945  struct
946  {
951  CHAR Section[9];
952  } Return;
953 
954  STACK_ELEMENT StackElements[8];
956 
957  // Only valid in kernel exceptions
958  struct
959  {
960  DWORD NameHash;
961  DWORD PathHash;
962  KERNEL_DRIVER *Driver;
963  QWORD Rip;
964  CHAR Section[9];
965  } Original;
966 
967  union
968  {
971  void *Process;
974  } Process;
975 
978  INSTRUX *Instruction;
979 
982 
983  struct
984  {
985  BOOLEAN User : 1;
987  } Injection;
989 
990 
995 {
997 
998  union
999  {
1002  };
1003 
1004  union
1005  {
1006  void *Process;
1009  };
1010 
1011  union
1012  {
1013  void *Library;
1015  };
1016 
1017  union
1018  {
1021  };
1022 
1023  struct
1024  {
1025  DWORD NameHash;
1026  union
1027  {
1028  PCHAR Name;
1029  PWCHAR NameWide;
1030 
1031  };
1032  QWORD Rip;
1033 
1034  union
1035  {
1036  void *Library;
1037  WIN_PROCESS_MODULE *WinLib;
1038  };
1039  } Return;
1040 
1042 
1043  INSTRUX *Instruction;
1044 
1047 
1048 
1053 #define EXCEPTION_KM_ORIGINATOR_OPT_DO_NOT_BLOCK 0x00000001u
1054 
1060 #define EXCEPTION_KM_ORIGINATOR_OPT_FULL_STACK 0x00000002u
1061 
1062 
1063 //
1064 // Helpers
1065 //
1066 #define for_each_km_exception(_ex_head, _var_name) \
1067  list_for_each(_ex_head, KM_EXCEPTION, _var_name)
1068 #define for_each_kum_exception(_ex_head, _var_name) \
1069  list_for_each(_ex_head, KUM_EXCEPTION, _var_name)
1070 #define for_each_um_exception(_ex_head, _var_name) \
1071  list_for_each(_ex_head, UM_EXCEPTION, _var_name)
1072 #define for_each_um_glob_exception(_ex_head, _var_name) \
1073  list_for_each(_ex_head, UM_EXCEPTION_GLOB, _var_name)
1074 #define for_each_cb_signature(_ex_head, _var_name) \
1075  list_for_each(_ex_head, SIG_CODEBLOCKS, _var_name)
1076 #define for_each_export_signature(_ex_head, _var_name) \
1077  list_for_each(_ex_head, SIG_EXPORT, _var_name)
1078 #define for_each_value_signature(_ex_head, _var_name) \
1079  list_for_each(_ex_head, SIG_VALUE, _var_name)
1080 #define for_each_value_code_signature(_ex_head, _var_name) \
1081  list_for_each(_ex_head, SIG_VALUE_CODE, _var_name)
1082 #define for_each_idt_signature(_ex_head, _var_name) \
1083  list_for_each(_ex_head, SIG_IDT, _var_name)
1084 #define for_each_version_os_signature(_ex_head, _var_name) \
1085  list_for_each(_ex_head, SIG_VERSION_OS, _var_name)
1086 #define for_each_version_intro_signature(_ex_head, _var_name) \
1087  list_for_each(_ex_head, SIG_VERSION_INTRO, _var_name)
1088 #define for_each_process_creation_signature(_ex_head, _var_name) \
1089  list_for_each(_ex_head, SIG_PROCESS_CREATION, _var_name)
1090 
1091 
1092 //
1093 // Functions
1094 //
1095 
1096 INTSTATUS
1098  void
1099  );
1100 
1101 INTSTATUS
1103  void
1104  );
1105 
1106 INTSTATUS
1108  void
1109  );
1110 
1111 INTSTATUS
1113  void
1114  );
1115 
1116 int
1118  _In_opt_ const LIX_TASK_OBJECT *Task,
1119  _In_ char *Header,
1120  _Out_ char *Line,
1121  _In_ int MaxLength,
1122  _In_opt_ DWORD NameAlignment
1123  );
1124 
1125 int
1127  _In_ WIN_PROCESS_MODULE *Module,
1128  _In_ char *Header,
1129  _Out_ char *Line,
1130  _In_ int MaxLength,
1131  _In_opt_ DWORD NameAlignment
1132  );
1133 
1134 int
1136  _In_ WIN_PROCESS_OBJECT *Process,
1137  _In_ char *Header,
1138  _Out_ char *Line,
1139  _In_ int MaxLength,
1140  _In_opt_ DWORD NameAlignment
1141  );
1142 
1143 int
1145  _In_ KERNEL_DRIVER *Module,
1146  _In_ char *Header,
1147  _Out_ char *Line,
1148  _In_ int MaxLength,
1149  _In_opt_ DWORD NameAlignment
1150  );
1151 
1152 void
1154  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1155  _In_ EXCEPTION_UM_ORIGINATOR *Originator,
1156  _In_ INTRO_ACTION Action,
1157  _In_ INTRO_ACTION_REASON Reason
1158  );
1159 
1160 void
1162  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1163  _In_ EXCEPTION_KM_ORIGINATOR *Originator,
1164  _In_ INTRO_ACTION Action,
1165  _In_ INTRO_ACTION_REASON Reason
1166  );
1167 
1168 void
1170  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1171  _In_ EXCEPTION_KM_ORIGINATOR *Originator,
1172  _In_ INTRO_ACTION Action,
1173  _In_ INTRO_ACTION_REASON Reason
1174  );
1175 
1176 void
1178  _In_ void *Originator,
1179  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1180  _In_ BOOLEAN KernelMode,
1181  _In_ BOOLEAN ReturnDrv
1182  );
1183 
1184 INTSTATUS
1186  _Out_ EXCEPTION_KM_ORIGINATOR *Originator,
1187  _In_ DWORD Options
1188  );
1189 
1190 INTSTATUS
1192  _In_ void *Process,
1193  _Out_ EXCEPTION_UM_ORIGINATOR *Originator
1194  );
1195 
1196 INTSTATUS
1198  _In_ void *Process,
1199  _In_ BOOLEAN ModuleWrite,
1200  _In_ QWORD Address,
1201  _In_opt_ INSTRUX *Instrux,
1202  _Out_ EXCEPTION_UM_ORIGINATOR *Originator
1203  );
1204 
1205 INTSTATUS
1207  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1208  _Out_ EXCEPTION_KM_ORIGINATOR *Originator
1209  );
1210 
1211 INTSTATUS
1213  _In_ QWORD NewValue,
1214  _In_ QWORD OldValue,
1215  _In_ DWORD Cr,
1217  );
1218 
1219 INTSTATUS
1221  _In_opt_ void *Context,
1222  _In_ QWORD Gpa,
1223  _In_ QWORD Gva,
1224  _In_ INTRO_OBJECT_TYPE Type,
1225  _In_ DWORD ZoneFlags,
1227  );
1228 
1229 INTSTATUS
1231  _In_ void *Process,
1232  _In_ QWORD DestinationGva,
1233  _In_ DWORD Length,
1234  _In_ QWORD ZoneFlags,
1236  );
1237 
1238 INTSTATUS
1240  _In_ INTEGRITY_REGION *IntegrityRegion,
1241  _Inout_ DWORD *Offset,
1243  );
1244 
1245 INTSTATUS
1247  _In_ QWORD NewValue,
1248  _In_ QWORD OldValue,
1249  _In_ DWORD Msr,
1251  );
1252 
1253 INTSTATUS
1255  _In_ DTR *NewValue,
1256  _In_ DTR *OldValue,
1257  _In_ INTRO_OBJECT_TYPE Type,
1259  );
1260 
1261 INTSTATUS
1263  _In_ void *Process,
1264  _In_ INTRO_OBJECT_TYPE ObjectType,
1266  );
1267 
1268 INTSTATUS
1270  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1271  _In_ EXCEPTION_UM_ORIGINATOR *Originator,
1272  _In_ UM_EXCEPTION *Exception
1273  );
1274 
1275 INTSTATUS
1277  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1278  _In_ EXCEPTION_UM_ORIGINATOR *Originator,
1279  _In_ UM_EXCEPTION *Exception
1280  );
1281 
1282 INTSTATUS
1284  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1285  _In_ EXCEPTION_UM_ORIGINATOR *Originator,
1286  _In_ UM_EXCEPTION *Exception
1287  );
1288 
1289 INTSTATUS
1291  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1292  _In_ EXCEPTION_UM_ORIGINATOR *Originator,
1293  _In_ UM_EXCEPTION_GLOB *Exception
1294  );
1295 
1296 INTSTATUS
1298  _In_ void *Victim,
1299  _In_ void *Originator,
1300  _In_ void *Exception,
1301  _In_ EXCEPTION_TYPE ExceptionType,
1302  _Out_ INTRO_ACTION *Action,
1303  _Out_ INTRO_ACTION_REASON *Reason
1304  );
1305 
1306 INTSTATUS
1308  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1309  _In_ EXCEPTION_KM_ORIGINATOR *Originator,
1310  _In_ KM_EXCEPTION *Exception
1311  );
1312 
1313 INTSTATUS
1315  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1316  _In_ EXCEPTION_UM_ORIGINATOR *Originator,
1317  _In_ void *Exception,
1318  _In_ EXCEPTION_TYPE ExceptionType
1319  );
1320 
1321 INTSTATUS
1323  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1324  _In_ EXCEPTION_KM_ORIGINATOR *Originator,
1325  _In_ KUM_EXCEPTION *Exception
1326  );
1327 
1328 INTSTATUS
1330  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1331  _In_ EXCEPTION_KM_ORIGINATOR *Originator,
1332  _Out_ INTRO_ACTION *Action,
1333  _Out_ INTRO_ACTION_REASON *Reason
1334  );
1335 
1336 INTSTATUS
1338  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1339  _In_ EXCEPTION_UM_ORIGINATOR *Originator,
1340  _Out_ INTRO_ACTION *Action,
1341  _Out_ INTRO_ACTION_REASON *Reason
1342  );
1343 
1344 INTSTATUS
1346  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1347  _In_ EXCEPTION_KM_ORIGINATOR *Originator,
1348  _Out_ INTRO_ACTION *Action,
1349  _Out_ INTRO_ACTION_REASON *Reason
1350  );
1351 
1352 void
1353 IntExcept(
1354  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1355  _In_ void *Originator,
1356  _In_ EXCEPTION_TYPE Type,
1357  _Out_ INTRO_ACTION *Action,
1358  _Out_ INTRO_ACTION_REASON *Reason,
1359  _In_ INTRO_EVENT_TYPE EventClass
1360  );
1361 
1362 void
1364  _In_ QWORD Gva
1365  );
1366 
1367 void
1369  _In_ QWORD Cr3
1370  );
1371 
1372 BOOLEAN
1374  void
1375  );
1376 
1384 #define IntExceptErase(Ptr, Tag) \
1385  do { \
1386  RemoveEntryList(&((Ptr)->Link)); \
1387  HpFreeAndNullWithTag(&(Ptr), (Tag)); \
1388  } while(0)
1389 
1390 #endif // _EXCEPTIONS_H_
The range-identifier used for value-code signature.
Definition: exceptions.h:78
struct _EXCEPTION_VICTIM_INTEGRITY EXCEPTION_VICTIM_INTEGRITY
Describes a integrity victim.
struct _SIG_VALUE * PSIG_VALUE
struct _EXCEPTION_VICTIM_INTEGRITY * PEXCEPTION_VICTIM_INTEGRITY
struct _SIG_IDT SIG_IDT
Describes a idt signature.
uint16_t * PWCHAR
Definition: intro_types.h:63
EXCEPTION_SIGNATURE_ID Id
An unique id (EXCEPTION_SIGNATURE_ID).
Definition: exceptions.h:419
void * Module
The internal structure of a module.
Definition: exceptions.h:836
The object allows only dlls which are detected as suspicous (e.g. module loads before kernel32...
Definition: exceptions.h:223
EXCEPTION_VICTIM_CR Cr
Valid if the modified zone is CR.
Definition: exceptions.h:906
#define _In_opt_
Definition: intro_sal.h:16
INTSTATUS IntExceptKernel(EXCEPTION_VICTIM_ZONE *Victim, EXCEPTION_KM_ORIGINATOR *Originator, INTRO_ACTION *Action, INTRO_ACTION_REASON *Reason)
This function iterates through exception lists and tries to find an exception that matches the origin...
WORD SigCount
Contains the number of signatures.
Definition: exceptions.h:267
QWORD Context
Contains the context given by the integrator.
Definition: exceptions.h:326
enum _INTRO_ACTION_REASON INTRO_ACTION_REASON
The reason for which an INTRO_ACTION was taken.
#define _Out_
Definition: intro_sal.h:22
_Bool BOOLEAN
Definition: intro_types.h:58
Describes a victim module.
Definition: exceptions.h:832
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:406
INTSTATUS IntExceptKernelVerifyExtra(EXCEPTION_VICTIM_ZONE *Victim, EXCEPTION_UM_ORIGINATOR *Originator, UM_EXCEPTION *Exception)
This function is used as an extra step in exception mechanism.
struct _SIG_VERSION_OS SIG_VERSION_OS
Describes a operating system version signature.
void IntExceptInvCbCacheByGva(QWORD Gva)
Invalidate the cache used for code blocks for a given guest virtual address.
Definition: exceptions.c:77
The exception ID. The layout consists of the exception type and the unique identifier of the exceptio...
Definition: exceptions.h:238
The value hash is for the process command line (valid only for value signature).
Definition: exceptions.h:711
uint8_t BYTE
Definition: intro_types.h:47
int IntExceptPrintWinProcInfo(WIN_PROCESS_OBJECT *Process, char *Header, char *Line, int MaxLength, DWORD NameAlignment)
Print the data from the provided WIN_PROCESS_OBJECT.
struct _UM_EXCEPTION UM_EXCEPTION
Describe a user-mode exception.
Describe a export signature hash.
Definition: exceptions.h:387
QWORD ZoneFlags
The flags of the modified zone.
Definition: exceptions.h:898
struct _EXCEPTION_VICTIM_OBJECT * PEXCEPTION_VICTIM_OBJECT
Describes a process-creation signature.
Definition: exceptions.h:574
LIST_HEAD KernelUserExceptions[EXCEPTION_TABLE_SIZE]
Array of linked lists used for kernel-user mode exceptions.
Definition: exceptions.h:108
LIST_HEAD ValueCodeSignatures
Linked list used for value-code signatures.
Definition: exceptions.h:133
The modified object is anything inside the HAL heap zone.
Definition: exceptions.h:167
#define _In_
Definition: intro_sal.h:21
Describe a kernel-user mode exception.
Definition: exceptions.h:275
LIX_TASK_OBJECT * LixProc
The Linux process object from which the write originates.
Definition: exceptions.h:973
The name is the operating system kernel name.
Definition: exceptions.h:668
The signature is valid only on 64 bit systems/processes.
Definition: exceptions.h:706
BYTE Score
The number of (minimum) hashes from a list that need to match.
Definition: exceptions.h:404
QWORD Context
Contains the context given by the integrator.
Definition: exceptions.h:297
EXCEPTION_VICTIM_EPT Ept
Valid if the modified zone is EPT.
Definition: exceptions.h:904
WORD Offset
The displacement from the beginning of the modified zone.
Definition: exceptions.h:378
LIST_HEAD NoNameKernelExceptions
Linked list used for kernel-mode exceptions that don&#39;t have a valid originator (-).
Definition: exceptions.h:97
The name can be any string.
Definition: exceptions.h:640
DWORD DriverHash
Contains the originator driver name-hash.
Definition: exceptions.h:282
uint16_t WORD
Definition: intro_types.h:48
struct _SIG_VALUE SIG_VALUE
Describes a value signature.
Describes a value signature.
Definition: exceptions.h:415
WORD Delta
The number of bytes that are modified.
Definition: exceptions.h:389
The modified object is only the driver&#39;s EAT.
Definition: exceptions.h:158
DWORD Cr
The CR written.
Definition: exceptions.h:781
INTSTATUS IntExceptKernelUserVerifyExtra(EXCEPTION_VICTIM_ZONE *Victim, EXCEPTION_UM_ORIGINATOR *Originator, UM_EXCEPTION *Exception)
This function is used as an extra step in exception mechanism.
Describes an EPT victim.
Definition: exceptions.h:759
struct _EXCEPTION_VICTIM_INJECTION * PEXCEPTION_VICTIM_INJECTION
DWORD Build
Definition: exceptions.h:141
User-mode exception.
Definition: exceptions.h:60
LIST_HEAD GenericUserExceptions
Linked list used for user-mode exceptions that have a generic originator(*).
Definition: exceptions.h:91
QWORD Context
Contains the context given by the integrator.
Definition: exceptions.h:356
struct _EXCEPTION_VICTIM_MODULE * PEXCEPTION_VICTIM_MODULE
Blocking exception.
Definition: exceptions.h:192
The modified object is anything inside the structure CONTEXT (valid only for windows).
Definition: exceptions.h:215
QWORD Context
Contains the context given by the integrator.
Definition: exceptions.h:265
LIST_HEAD ExportSignatures
Linked list used for export signatures.
Definition: exceptions.h:131
union _EXCEPTION_SIGNATURE_ID EXCEPTION_SIGNATURE_ID
The exception ID. The layout consists of the exception type and the unique identifier of the exceptio...
Signals an attempt to set an insturmentation callback.
Definition: exceptions.h:226
LIST_HEAD ProcessCreationAlertExceptions
Linked list used for process-creation exceptions that are added from alert.
Definition: exceptions.h:122
The modified object represents an execution inside SharedUserData.
Definition: exceptions.h:176
struct _KUM_EXCEPTION * PKUM_EXCEPTION
The exception sends a feedback alert.
Definition: exceptions.h:595
The exception will take into consideration the return driver/dll.
Definition: exceptions.h:601
struct _SIG_CODEBLOCK_HASH SIG_CODEBLOCK_HASH
Describe a codeblocks signature hash.
KM_EXCEPTION_OBJECT Type
Contains the type of the exception (KM_EXCEPTION_OBJECT).
Definition: exceptions.h:263
QWORD StackBase
The stack base for the thread that attempted the execution.
Definition: exceptions.h:932
The name is the operating system vsyscall (valid only for Linux).
Definition: exceptions.h:647
EXCEPTION_SIGNATURE_ID Id
An unique id (_EXCEPTION_SIGNATURE_ID).
Definition: exceptions.h:401
INTSTATUS IntExceptGetVictimProcessCreation(void *Process, INTRO_OBJECT_TYPE ObjectType, EXCEPTION_VICTIM_ZONE *Victim)
This function is used to get the information about the victim for process-creation violation...
DWORD OriginatorNameHash
Contains the originator name-hash.
Definition: exceptions.h:257
INTRO_PC_VIOLATION_TYPE
Process creation violation flags.
Definition: intro_types.h:1651
EXCEPTION_SIGNATURE_ID Id
An unique id (EXCEPTION_SIGNATURE_ID).
Definition: exceptions.h:578
The modified object is inside an EPT hook.
Definition: exceptions.h:746
LIST_HEAD VersionIntroSignatures
Linked list used for introspection version signatures.
Definition: exceptions.h:136
BOOLEAN IntUpdateAreExceptionsLoaded(void)
Checks if the exceptions are loaded.
QWORD Gva
The guest virtual address to be written.
Definition: exceptions.h:822
Describe a user-mode glob exception.
Definition: exceptions.h:336
enum _UM_EXCEPTION_OBJECT UM_EXCEPTION_OBJECT
Object type of the user-mode exception.
Structure that describes a stack trace element.
Definition: guest_stack.h:25
enum _SIGNATURE_FLG SIGNATURE_FLG
Describes the flags that can be used by an signature.
int IntExceptPrintWinModInfo(WIN_PROCESS_MODULE *Module, char *Header, char *Line, int MaxLength, DWORD NameAlignment)
Print the data from the provided WIN_PROCESS_MODULE.
The modified object is HalPerformanceCounter.
Definition: exceptions.h:177
LIST_HEAD ProcessCreationSignatures
Linked list used for process-creation signatures.
Definition: exceptions.h:137
BYTE ListsCount
The number of the list of hashes.
Definition: exceptions.h:442
The exception is valid only for read violation.
Definition: exceptions.h:605
_EXCEPTION_SIGNATURE_TYPE
The identifier that describes a range of signatures.
Definition: exceptions.h:70
LIST_HEAD IdtSignatures
Linked list used for IDT signatures.
Definition: exceptions.h:134
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:461
EXCEPTION_SIGNATURE_ID Id
An unique id (EXCEPTION_SIGNATURE_ID).
Definition: exceptions.h:437
BYTE Entry
The number of the IDT entry.
Definition: exceptions.h:477
The exception is valid only if the write comes due to an injection from user-mode.
Definition: exceptions.h:629
LIST_HEAD UserAlertExceptions
Linked list used for user-mode exceptions that are added from alert.
Definition: exceptions.h:124
Describes a user-mode originator.
Definition: exceptions.h:994
Used to indicate an invalid user-mode exception name.
Definition: exceptions.h:696
LIST_ENTRY Link
Definition: exceptions.h:435
KERNEL_DRIVER * Driver
The driver that&#39;s modifying the memory.
Definition: exceptions.h:949
INSTRUX * Instruction
The modifying instruction (at the OriginalRip). There&#39;s no point in getting the instruction at Rip...
Definition: exceptions.h:978
The modified object is only the driver&#39;s data sections.
Definition: exceptions.h:160
struct _SIG_VALUE_HASH SIG_VALUE_HASH
Describe a value signature hash.
The name can be any string.
Definition: exceptions.h:687
The range-identifier used for idt signature.
Definition: exceptions.h:77
LIST_HEAD UserExceptions[EXCEPTION_TABLE_SIZE]
Array of linked lists used for user-mode exceptions.
Definition: exceptions.h:109
INTSTATUS IntExceptMatchException(void *Victim, void *Originator, void *Exception, EXCEPTION_TYPE ExceptionType, INTRO_ACTION *Action, INTRO_ACTION_REASON *Reason)
This function tries to find a exception for the current violation..
Definition: exceptions.c:3167
int INTSTATUS
The status data type.
Definition: introstatus.h:24
QWORD StackLimit
The stack limit for the thread that attempted the execution.
Definition: exceptions.h:933
BYTE * Buffer
The buffer to be written.
Definition: exceptions.h:825
DWORD NameHash
The namehash of the process.
Definition: exceptions.h:996
struct _EXCEPTION_VICTIM_EPT * PEXCEPTION_VICTIM_EPT
_ZONE_TYPE
Describes the zone types that can be excepted.
Definition: exceptions.h:744
BOOLEAN Loaded
True if the exceptions are loaded.
Definition: exceptions.h:146
struct _EXCEPTION_VICTIM_OBJECT EXCEPTION_VICTIM_OBJECT
Describes a victim object.
KUM_EXCEPTION_OBJECT Type
Contains the type of the exception (KM_EXCEPTION_OBJECT).
Definition: exceptions.h:295
The exception will match only for the init phase of a driver/process.
Definition: exceptions.h:599
The exception is valid only for Linux.
Definition: exceptions.h:603
The exception is valid only if the originator process is a system process.
Definition: exceptions.h:621
enum _KM_EXCEPTION_OBJECT KM_EXCEPTION_OBJECT
Object type of the kernel-mode exception.
INTSTATUS IntExceptAlertRemove(void)
This function removes and frees all exceptions and signatures that have been added from alert...
Definition: exceptions.c:382
EXCEPTION_SIGNATURE_ID Id
An unique id (EXCEPTION_SIGNATURE_ID).
Definition: exceptions.h:456
PCHAR Name
The process name of the originator (saved as CHAR).
Definition: exceptions.h:1000
INTSTATUS IntExceptUninit(void)
This function removes and frees all exceptions and signatures.
Definition: exceptions.c:513
DWORD Offset
The offset of the modification.
Definition: exceptions.h:803
DWORD NameHash
Definition: exceptions.h:316
Describes a integrity victim.
Definition: exceptions.h:800
LIST_HEAD KernelAlertExceptions
Linked list used for kernel-mode exceptions that are added from alert.
Definition: exceptions.h:126
The name is missing.
Definition: exceptions.h:644
INTSTATUS IntExceptUserVerifyExtra(EXCEPTION_VICTIM_ZONE *Victim, EXCEPTION_UM_ORIGINATOR *Originator, UM_EXCEPTION *Exception)
This function is used as an extra step in exception mechanism that verify the initialization flags of...
void IntExceptKernelUserLogInformation(EXCEPTION_VICTIM_ZONE *Victim, EXCEPTION_KM_ORIGINATOR *Originator, INTRO_ACTION Action, INTRO_ACTION_REASON Reason)
Print the information about a kernel-user mode violation and dumps the code-blocks.
enum _KM_EXCEPTION_NAME KM_EXCEPTION_NAME
The predefined names for kernel-user-mode exception.
struct _SIG_PROCESS_CREATION SIG_PROCESS_CREATION
Describes a process-creation signature.
_KUM_EXCEPTION_OBJECT
Object type of the kernel-user mode exception.
Definition: exceptions.h:190
Describes a kernel-mode originator.
Definition: exceptions.h:943
LIX_TASK_OBJECT * LixProc
The internal structure of the modified Linux process.
Definition: exceptions.h:883
The modified object is only the driver&#39;s IAT.
Definition: exceptions.h:174
User-mode exception that accepts glob content.
Definition: exceptions.h:62
Describes a MSR victim.
Definition: exceptions.h:769
WORD Size
The size of of the modified zone.
Definition: exceptions.h:379
struct _EXCEPTION_CB_SIGNATURE SIG_CODEBLOCKS
Describes a codeblocks signature.
Codeblocks were extracted at a medium level.
Definition: exceptions.h:708
BOOLEAN Smep
True if SMEP is modified.
Definition: exceptions.h:784
The modified object is any with the modified name.
Definition: exceptions.h:193
INTRO_OBJECT_TYPE Type
The type of the modified object.
Definition: exceptions.h:793
The range-identifier used for value signature.
Definition: exceptions.h:76
BOOLEAN Kernel
This field is set to TRUE for a write due to an injection from kernel-mode.
Definition: exceptions.h:986
enum _KUM_EXCEPTION_NAME KUM_EXCEPTION_NAME
The predefined names for kernel-mode exception.
void * Process
The process that&#39;s modifying the memory (always present).
Definition: exceptions.h:1006
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:538
The exception is valid only for write violation.
Definition: exceptions.h:606
The range-identifier used for process creation signature.
Definition: exceptions.h:74
struct _EXCEPTION_VICTIM_ZONE * PEXCEPTION_VICTIM_ZONE
WIN_PROCESS_OBJECT * WinProc
The windows process that&#39;s modifying the memory (always present).
Definition: exceptions.h:1007
struct _EXCEPTION_VICTIM_CR * PEXCEPTION_VICTIM_CR
DWORD Flags
Contains any flags from EXCEPTION_FLG.
Definition: exceptions.h:261
INTRO_PC_VIOLATION_TYPE PcType
Valid if the current violation is DPI Process Creation Violation.
Definition: exceptions.h:1041
struct _EXCEPTIONS EXCEPTIONS
Describes the internal exceptions data.
BYTE ListsCount
The number of the list of hashes.
Definition: exceptions.h:460
struct _KUM_EXCEPTION KUM_EXCEPTION
Describe a kernel-user mode exception.
enum _ZONE_TYPE ZONE_TYPE
Describes the zone types that can be excepted.
_KUM_EXCEPTION_NAME
The predefined names for kernel-mode exception.
Definition: exceptions.h:664
The modified object is anything inside the driver.
Definition: exceptions.h:157
QWORD SourceVA
The GVA from where the injection is.
Definition: exceptions.h:1020
The name is missing.
Definition: exceptions.h:692
Describes a value signature.
Definition: exceptions.h:452
Describes a kernel driver.
Definition: drivers.h:30
struct _EXCEPTION_CB_SIGNATURE * PSIG_CODEBLOCKS
The modified object is only another process (injection basically).
Definition: exceptions.h:209
BYTE * Buffer
The new security descriptor buffer (valid only if INTRO_OBJECT_TYPE is introObjectTypeSecDesc or intr...
Definition: exceptions.h:810
DWORD PathHash
The pathhash of the originator return driver.
Definition: exceptions.h:948
EXCEPTION_VICTIM_OBJECT Object
The modified object.
Definition: exceptions.h:895
struct _SIG_CODEBLOCK_HASH * PSIG_CODEBLOCK_HASH
DWORD ProcessHash
Contains the originator process name-hash.
Definition: exceptions.h:283
DWORD Flags
Contains any flags from SIGNATURE_FLG.
Definition: exceptions.h:579
The modified object is a SharedUserData field.
Definition: exceptions.h:180
void * Library
The library that&#39;s modifying the memory (if that&#39;s the case).
Definition: exceptions.h:1013
The modified object is IDTR/GDTR.
Definition: exceptions.h:751
EXCEPTION_VICTIM_MODULE Module
Used when a module is modified.
Definition: exceptions.h:869
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:424
struct _KM_EXCEPTION KM_EXCEPTION
Describe a kernel-mode exception.
_UM_EXCEPTION_OBJECT
Object type of the user-mode exception.
Definition: exceptions.h:205
LIST_HEAD CbSignatures
Linked list used for codeblocks signatures.
Definition: exceptions.h:130
DWORD BufferSize
The size of the new security descriptor buffer (valid only if INTRO_OBJECT_TYPE is introObjectTypeSec...
Definition: exceptions.h:813
#define EXCEPTION_UM_GLOB_LENGTH
Definition: exceptions.h:36
enum _INTRO_OBJECT_TYPE INTRO_OBJECT_TYPE
The type of the object protected by an EPT hook.
QWORD BaseAddress
Depending on INTRO_OBJECT_TYPE we have: CR3 for processes / ModuleBase for km drivers and um dll...
Definition: exceptions.h:863
#define _Inout_
Definition: intro_sal.h:20
The exception is valid only for CR4.SMEP write.
Definition: exceptions.h:616
The range-identifier used for export signature.
Definition: exceptions.h:75
struct _EXCEPTION_VICTIM_EPT EXCEPTION_VICTIM_EPT
Describes an EPT victim.
DWORD Flags
Contains any flags from EXCEPTION_FLG.
Definition: exceptions.h:352
DWORD BufferSize
The buffer size to be written.
Definition: exceptions.h:826
PWCHAR NameWide
The module name of the originator (saved as WCHAR).
Definition: exceptions.h:1001
LIST_HEAD KernelUserAlertExceptions
Linked list used for kernel-user mode exceptions that are added from alert.
Definition: exceptions.h:128
BOOLEAN User
This field is set to TRUE for a write due to an injection from user-mode.
Definition: exceptions.h:985
QWORD Rsp
The value of the guest RSP register at the moment of execution.
Definition: exceptions.h:931
The modified object is inside an integrity hook.
Definition: exceptions.h:749
The exception is valid only for CR4.SMAP write.
Definition: exceptions.h:615
WIN_DRIVER_OBJECT * DriverObject
Used when a driver object / fastio dispatch table is modified.
Definition: exceptions.h:870
DWORD LibraryNameHash
The name-hash of the modified library.
Definition: exceptions.h:440
DWORD Hash
The hash of the modified zone.
Definition: exceptions.h:380
_EXCEPTION_FLG
Describes the flags that can be used by an exception.
Definition: exceptions.h:593
Describes an injection.
Definition: exceptions.h:820
DWORD Flags
Contains any flags from _EXCEPTION_FLG.
Definition: exceptions.h:322
struct _KM_EXCEPTION * PKM_EXCEPTION
WORD SigCount
Contains the number of signatures.
Definition: exceptions.h:299
DWORD Flags
Contains any flags from SIGNATURE_FLG.
Definition: exceptions.h:475
LIX_TASK_OBJECT * LixProc
The Linux process that&#39;s modifying the memory (always present).
Definition: exceptions.h:1008
LIST_HEAD KernelFeedbackExceptions
Linked list used for kernel-mode exceptions that have the feedback flag.
Definition: exceptions.h:115
Holds information about a driver object.
Definition: windrvobj.h:13
struct _EXCEPTION_UM_ORIGINATOR * PEXCEPTION_UM_ORIGINATOR
struct _SIG_PROCESS_CREATION * PSIG_PROCESS_CREATION
LIST_ENTRY Link
Definition: exceptions.h:310
The exception is valid only for execute violation.
Definition: exceptions.h:607
INTSTATUS IntExceptGetVictimEpt(void *Context, QWORD Gpa, QWORD Gva, INTRO_OBJECT_TYPE Type, DWORD ZoneFlags, EXCEPTION_VICTIM_ZONE *Victim)
Fills an EXCEPTION_VICTIM_ZONE with relevant information from an EPT violation.
Definition: exceptions.c:742
DWORD VictimNameHash
Contains the victim name-hash.
Definition: exceptions.h:259
unsigned long long QWORD
Definition: intro_types.h:53
The modified object is only the driver&#39;s code sections.
Definition: exceptions.h:159
The name is the operating system kernel name.
Definition: exceptions.h:642
enum _EXCEPTION_TYPE EXCEPTION_TYPE
The type of an exception.
The signature is valid only on 32 bit systems/processes.
Definition: exceptions.h:705
struct _SIG_VERSION_INTRO * PSIG_VERSION_INTRO
struct _EXCEPTION_VICTIM_DTR * PEXCEPTION_VICTIM_DTR
QWORD Gpa
The modified guest physical address.
Definition: exceptions.h:762
enum _EXCEPTION_FLG EXCEPTION_FLG
Describes the flags that can be used by an exception.
void IntExceptUserLogInformation(EXCEPTION_VICTIM_ZONE *Victim, EXCEPTION_UM_ORIGINATOR *Originator, INTRO_ACTION Action, INTRO_ACTION_REASON Reason)
Print the information about a user-mode violation, dumps the code-blocks and the injection buffer...
The name is any object belonging to this process (child not included).
Definition: exceptions.h:688
struct _SIG_IDT * PSIG_IDT
EXCEPTION_SIGNATURE_ID Id
An unique id (EXCEPTION_SIGNATURE_ID).
Definition: exceptions.h:474
INTSTATUS IntExceptGetVictimCr(QWORD NewValue, QWORD OldValue, DWORD Cr, EXCEPTION_VICTIM_ZONE *Victim)
This function is used to get the information about the CR victim.
INTSTATUS IntExceptGetVictimMsr(QWORD NewValue, QWORD OldValue, DWORD Msr, EXCEPTION_VICTIM_ZONE *Victim)
This function is used to get the information about the MSR victim.
LIST_ENTRY Link
Definition: exceptions.h:277
_KM_EXCEPTION_OBJECT
Object type of the kernel-mode exception.
Definition: exceptions.h:153
QWORD StartVirtualAddress
The start address of the integrity zone.
Definition: exceptions.h:802
Describe a value signature hash.
Definition: exceptions.h:376
Describes a introspection version signature.
Definition: exceptions.h:531
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:493
INTSTATUS IntExceptGetVictimIntegrity(INTEGRITY_REGION *IntegrityRegion, DWORD *Offset, EXCEPTION_VICTIM_ZONE *Victim)
This function is used to get the information about the modified zone from the integrity region...
The exception is valid only if the write comes due to an injection from kernel-mode.
Definition: exceptions.h:631
struct _SIG_EXPORT SIG_EXPORT
Describes a export signature.
The range-identifier used for version operating system signature.
Definition: exceptions.h:72
Allow modification of it&#39;s own driver object.
Definition: exceptions.h:641
EXCEPTION_VICTIM_DTR Dtr
Valid if the modified zone is DTR.
Definition: exceptions.h:907
INTSTATUS IntExceptKernelUser(EXCEPTION_VICTIM_ZONE *Victim, EXCEPTION_KM_ORIGINATOR *Originator, INTRO_ACTION *Action, INTRO_ACTION_REASON *Reason)
This function iterates through exception lists and tries to find an exception that matches the origin...
struct _EXCEPTIONS::@26 Version
Loaded exceptions binary version.
The modified object is SSDT (valid only on windows x86).
Definition: exceptions.h:162
The modified object is the self map entry inside PDBR.
Definition: exceptions.h:168
DWORD NameHash
The hash of the modified object.
Definition: exceptions.h:854
Describes the internal exceptions data.
Definition: exceptions.h:86
DWORD Flags
Contains any flags from SIGNATURE_FLG.
Definition: exceptions.h:438
EXCEPTION_SIGNATURE_ID Id
An unique id (EXCEPTION_SIGNATURE_ID).
Definition: exceptions.h:490
LIST_ENTRY Link
Definition: exceptions.h:472
void IntExceptKernelLogInformation(EXCEPTION_VICTIM_ZONE *Victim, EXCEPTION_KM_ORIGINATOR *Originator, INTRO_ACTION Action, INTRO_ACTION_REASON Reason)
Print the information about a kernel-mode violation and dumps the code-blocks.
Describes a victim object.
Definition: exceptions.h:850
INTSTATUS IntExceptUserVerifyExtraGlobMatch(EXCEPTION_VICTIM_ZONE *Victim, EXCEPTION_UM_ORIGINATOR *Originator, UM_EXCEPTION_GLOB *Exception)
This function is used as an extra step in exception mechanism that verify the initialization flags of...
Kernel-mode exception.
Definition: exceptions.h:61
DWORD Length
The length of the instruction.
Definition: exceptions.h:934
LIST_ENTRY Link
Definition: exceptions.h:255
INTRO_OBJECT_TYPE Type
The type of the modified object.
Definition: exceptions.h:852
Describes a export signature.
Definition: exceptions.h:433
ZONE_TYPE ZoneType
The type of the modified zone.
Definition: exceptions.h:897
DWORD NameHash
Contains the originator name-hash.
Definition: exceptions.h:281
INTSTATUS IntExceptInit(void)
This function allocates the exceptions data and initialize the exception lists and the signature list...
Definition: exceptions.c:441
LIST_HEAD KernelUserFeedbackExceptions
Linked list used for kernel-user mode exceptions that have the feedback flag.
Definition: exceptions.h:117
enum _UM_EXCEPTION_NAME UM_EXCEPTION_NAME
The predefined names for user-mode exception.
The modified object is anything inside of the PEB32 structure.
Definition: exceptions.h:216
char * PCHAR
Definition: intro_types.h:56
DWORD Length
The length of the write.
Definition: exceptions.h:823
struct _SIG_VALUE_CODE * PSIG_VALUE_CODE
struct _EXCEPTION_VICTIM_MODULE EXCEPTION_VICTIM_MODULE
Describes a victim module.
The modified object is a MSR.
Definition: exceptions.h:747
DWORD Flags
Contains any flags from SIGNATURE_FLG.
Definition: exceptions.h:420
The name is the operating system HAL name (valid only for windows).
Definition: exceptions.h:669
The exception will take into consideration the return driver.
Definition: exceptions.h:614
The modified object is inside the process module&#39;s EAT.
Definition: exceptions.h:196
struct _SIG_VERSION_OS * PSIG_VERSION_OS
The modified object is the privileges field inside the nt!_TOKEN structure.
Definition: exceptions.h:175
INTSTATUS IntExceptUserGetOriginator(void *Process, BOOLEAN ModuleWrite, QWORD Address, INSTRUX *Instrux, EXCEPTION_UM_ORIGINATOR *Originator)
This function is used to get the information about the user-mode originator.
The modified object is SMEP and/or SMAP bits of CR4.
Definition: exceptions.h:166
struct _EXCEPTION_VICTIM_ZONE EXCEPTION_VICTIM_ZONE
Describes the modified zone.
DWORD Flags
Contains any flags from EXCEPTION_FLG.
Definition: exceptions.h:293
A descriptor table register. Valid for IDTR and GDTR.
Definition: introcpu.h:71
The modified object is inside the process module&#39;s IAT.
Definition: exceptions.h:211
Describes the modified zone.
Definition: exceptions.h:893
struct _UM_EXCEPTION_GLOB * PUM_EXCEPTION_GLOB
This exception will be ignored.
Definition: exceptions.h:609
The name can be any string.
Definition: exceptions.h:666
struct _UM_EXCEPTION * PUM_EXCEPTION
The modified object is IDTR.
Definition: exceptions.h:170
The modified object is inside the process module&#39;s IAT.
Definition: exceptions.h:195
Describe a kernel-mode exception.
Definition: exceptions.h:253
Used to indicate an invalid kernel-mode exception name.
Definition: exceptions.h:677
Describe a user-mode exception.
Definition: exceptions.h:308
uint16_t WCHAR
Definition: intro_types.h:63
struct _SIG_EXPORT_HASH * PSIG_EXPORT_HASH
struct _SIG_VALUE_HASH * PSIG_VALUE_HASH
Blocking exception.
Definition: exceptions.h:207
uint32_t DWORD
Definition: intro_types.h:49
int16_t INT16
Definition: intro_types.h:43
#define EXCEPTION_TABLE_SIZE
Definition: exceptions.h:49
The exception is valid only for integrity zone.
Definition: exceptions.h:618
The name is missing.
Definition: exceptions.h:670
LIST_ENTRY Link
Definition: exceptions.h:533
The modified object is anything inside the driver&#39;s fast IO dispatch table.
Definition: exceptions.h:164
LIST_HEAD GlobUserExceptions
Linked list used for user-mode exceptions that contains glob content.
Definition: exceptions.h:105
The name is the operating system vdso (valid only for Linux).
Definition: exceptions.h:646
DWORD Hash
The hash of the modified function name.
Definition: exceptions.h:390
BYTE Count
The number of hashes from the list.
Definition: exceptions.h:368
union _EXCEPTION_SIGNATURE_ID * PEXCEPTION_SIGNATURE_ID
The modified object is any with the modified name.
Definition: exceptions.h:156
enum _INTRO_ACTION INTRO_ACTION
Event actions.
LIST_HEAD ProcessCreationExceptions
Linked list used for process creations exceptions.
Definition: exceptions.h:110
struct _EXCEPTION_KM_ORIGINATOR * PEXCEPTION_KM_ORIGINATOR
_UM_EXCEPTION_NAME
The predefined names for user-mode exception.
Definition: exceptions.h:685
The exception is valid only if the modified process is a child of the originator process.
Definition: exceptions.h:623
QWORD Rip
The RIP from where the call to the exported function came.
Definition: exceptions.h:950
The name is the operating system vdso (valid only for Linux).
Definition: exceptions.h:689
Describes a CR victim.
Definition: exceptions.h:779
QWORD Gva
The modified guest virtual address.
Definition: exceptions.h:761
int IntExceptPrintWinKmModInfo(KERNEL_DRIVER *Module, char *Header, char *Line, int MaxLength, DWORD NameAlignment)
Print the information about the provided KERNEL_DRIVER (windows guest).
DWORD AccessSize
The actual size of the write.
Definition: exceptions.h:919
Signals an execution inside SharedUserData.
Definition: exceptions.h:225
LIST_HEAD GenericKernelExceptions
Linked list used for kernel-mode exceptions that have a generic originator (*).
Definition: exceptions.h:89
UM_EXCEPTION_OBJECT Type
Contains the type of the exception (UM_EXCEPTION_OBJECT).
Definition: exceptions.h:324
void IntExceptInvCbCacheByCr3(QWORD Cr3)
Invalidate the cache used for code blocks for a given CR3.
Definition: exceptions.c:102
UM_EXCEPTION_OBJECT Type
Contains the type of the exception (UM_EXCEPTION_OBJECT).
Definition: exceptions.h:354
WIN_PROCESS_OBJECT * WinProc
The internal structure of the modified Windows process.
Definition: exceptions.h:882
LIST_HEAD ValueSignatures
Linked list used for value signatures.
Definition: exceptions.h:132
DWORD Flags
Contains any flags from SIGNATURE_FLG.
Definition: exceptions.h:457
DWORD Flags
Contains any flags from SIGNATURE_FLG.
Definition: exceptions.h:491
The modified object is inside a process.
Definition: exceptions.h:750
QWORD ProtectionFlag
The protection flags of the modified zone.
Definition: exceptions.h:900
DWORD OriginatorNameHash
Contains the originator name-hash.
Definition: exceptions.h:312
The modified object is any IDT entry.
Definition: exceptions.h:169
struct _EXCEPTION_VICTIM_MSR * PEXCEPTION_VICTIM_MSR
The signature is valid only on Linux.
Definition: exceptions.h:713
LIST_ENTRY Link
Definition: exceptions.h:417
INTSTATUS IntExceptGetVictimProcess(void *Process, QWORD DestinationGva, DWORD Length, QWORD ZoneFlags, EXCEPTION_VICTIM_ZONE *Victim)
This function is used to get the information about the victim process for injection violations...
struct _SIG_EXPORT * PSIG_EXPORT
WORD SigCount
Contains the number of signatures.
Definition: exceptions.h:358
The modified object is inside the process modules.
Definition: exceptions.h:210
LIST_HEAD NoNameKernelUserExceptions
Linked list used for kernel-user mode exceptions that don&#39;t have a valid originator (-)...
Definition: exceptions.h:102
struct _EXCEPTION_KM_ORIGINATOR EXCEPTION_KM_ORIGINATOR
Describes a kernel-mode originator.
WIN_PROCESS_MODULE * WinLib
The windows library that&#39;s modifying the memory (if that&#39;s the case).
Definition: exceptions.h:1014
DWORD Type
Contains a type of signature (EXCEPTION_SIGNATURE_TYPE).
Definition: exceptions.h:243
LIST_HEAD ProcessCreationFeedbackExceptions
Linked list used for process-creation exceptions that have the feedback flag.
Definition: exceptions.h:119
The modified object is an ACL (SACL/DACL) of a process.
Definition: exceptions.h:179
void * Process
The internal structure of the modified process.
Definition: exceptions.h:881
Blocking exception.
Definition: exceptions.h:155
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:581
BYTE Score
The number of (minimum) hashes from a list that need to match.
Definition: exceptions.h:459
struct _EXCEPTION_VICTIM_INJECTION EXCEPTION_VICTIM_INJECTION
Describes an injection.
WIN_PROCESS_OBJECT * WinProc
The Windows process object from which the write originates.
Definition: exceptions.h:972
DWORD Flags
Contains any flags from SIGNATURE_FLG.
Definition: exceptions.h:536
LIST_HEAD UserFeedbackExceptions
Linked list used for user-mode exceptions that have the feedback flag.
Definition: exceptions.h:113
QWORD NewDriverBase
The module base where the new value is.
Definition: exceptions.h:771
The name is the operating system vsyscall (valid only for Linux).
Definition: exceptions.h:690
_SIGNATURE_FLG
Describes the flags that can be used by an signature.
Definition: exceptions.h:703
char * Name
The modified process name.
Definition: exceptions.h:858
WORD Length
The length of the opcode pattern.
Definition: exceptions.h:423
WCHAR * NameWide
The modified module name.
Definition: exceptions.h:859
LIST_HEAD KernelExceptions[EXCEPTION_TABLE_SIZE]
Array of linked lists used for kernel-mode exceptions.
Definition: exceptions.h:107
struct _SIG_VALUE_CODE SIG_VALUE_CODE
Describes a value signature.
Describes a DTR victim.
Definition: exceptions.h:791
BYTE ListsCount
The number of the list of hashes.
Definition: exceptions.h:405
_EXCEPTION_TYPE
The type of an exception.
Definition: exceptions.h:58
The modified object is WMI_LOGGER_CONTEXT.GetCpuClock used by InfinityHook (valid only on windows)...
Definition: exceptions.h:171
DWORD Msr
The MSR written.
Definition: exceptions.h:772
struct _SIG_VERSION_INTRO SIG_VERSION_INTRO
Describes a introspection version signature.
BOOLEAN IsEntryPoint
The the Return-Rip is insied the &#39;INIT&#39; section.
Definition: exceptions.h:980
EXCEPTION_VICTIM_INJECTION Injection
Valid if the modified zone is Injection.
Definition: exceptions.h:909
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:479
void IntExceptDumpSignatures(void *Originator, EXCEPTION_VICTIM_ZONE *Victim, BOOLEAN KernelMode, BOOLEAN ReturnDrv)
Dump code blocks from the originator&#39;s RIP.
Definition: exceptions.c:2978
INTSTATUS IntExceptGetOriginatorFromModification(EXCEPTION_VICTIM_ZONE *Victim, EXCEPTION_KM_ORIGINATOR *Originator)
This function is used for integrity violations to get the information about the kernel-mode originato...
INTSTATUS IntExceptUserGetExecOriginator(void *Process, EXCEPTION_UM_ORIGINATOR *Originator)
This function is used to get the originator for heap execution.
QWORD Value
Contains the minimum build number of the operating system (used for windows).
Definition: exceptions.h:507
The modified object is an interrupt object from KPRCB.
Definition: exceptions.h:181
The modified object is any with the modified name.
Definition: exceptions.h:208
The range-identifier used for codeblocks signature.
Definition: exceptions.h:79
LIST_HEAD GenericKernelUserExceptions
Linked list used for kernel-user mode exceptions that have a generic originator(*).
Definition: exceptions.h:94
Describes a idt signature.
Definition: exceptions.h:470
struct _EXCEPTION_VICTIM_CR EXCEPTION_VICTIM_CR
Describes a CR victim.
int IntExceptPrintLixTaskInfo(const LIX_TASK_OBJECT *Task, char *Header, char *Line, int MaxLength, DWORD NameAlignment)
Print the information about the provided LIX_TASK_OBJECT.
DWORD Value
Contains an unique value.
Definition: exceptions.h:242
EXCEPTION_VICTIM_MODULE Library
The victim module of the modified library.
Definition: exceptions.h:877
The modified object is a CR.
Definition: exceptions.h:748
Kernel-User mode exception.
Definition: exceptions.h:63
struct _EXCEPTIONS * PEXCEPTIONS
struct _EXCEPTION_VICTIM_MSR EXCEPTION_VICTIM_MSR
Describes a MSR victim.
enum _INTRO_EVENT_TYPE INTRO_EVENT_TYPE
Event classes.
DWORD CreateMask
Contains the DPI mask.
Definition: exceptions.h:583
EXCEPTION_VICTIM_INTEGRITY Integrity
Valid if the modified zone is Integrity.
Definition: exceptions.h:908
_KM_EXCEPTION_NAME
The predefined names for kernel-user-mode exception.
Definition: exceptions.h:638
The modified object is the thread which was performed an asynchronous procedure call on...
Definition: exceptions.h:219
LIST_ENTRY Link
Definition: exceptions.h:454
VAD * Vad
The internal structure of the modified VAD.
Definition: exceptions.h:876
INTSTATUS IntExceptKernelUserMatchVictim(EXCEPTION_VICTIM_ZONE *Victim, EXCEPTION_KM_ORIGINATOR *Originator, KUM_EXCEPTION *Exception)
This function checks if the exception matches the originator and the modified zone.
The original RIP is outside a driver and it returns into a driver (which is the originator name)...
Definition: exceptions.h:612
Used for process-creation violations.
Definition: exceptions.h:752
Allow modification of it&#39;s own driver object.
Definition: exceptions.h:667
WORD SigCount
Contains the number of signatures.
Definition: exceptions.h:328
enum _KUM_EXCEPTION_OBJECT KUM_EXCEPTION_OBJECT
Object type of the kernel-user mode exception.
INT16 Offset
The displacement from the beginning of the modified zone.
Definition: exceptions.h:422
Structure that describes a stack trace.
Definition: guest_stack.h:42
INTSTATUS IntExceptUserMatchVictim(EXCEPTION_VICTIM_ZONE *Victim, EXCEPTION_UM_ORIGINATOR *Originator, void *Exception, EXCEPTION_TYPE ExceptionType)
This function checks if the exception matches the originator and the modified zone.
WIN_PROCESS_MODULE * WinMod
The internal structure of a windows module.
Definition: exceptions.h:837
The exception is valid only on 32 bit systems/process.
Definition: exceptions.h:596
INSTRUX * Instruction
The modifying/executing instruction (valid when Rip != 0).
Definition: exceptions.h:1043
The range-identifier used for version introspection signature.
Definition: exceptions.h:73
The modified object is anything inside the driver object.
Definition: exceptions.h:163
char CHAR
Definition: intro_types.h:56
BOOLEAN Smap
True if SMAP is modified.
Definition: exceptions.h:783
struct _EXCEPTION_UM_ORIGINATOR EXCEPTION_UM_ORIGINATOR
Describes a user-mode originator.
The exception is valid only for apphelp process.
Definition: exceptions.h:626
Used to indicate an invalid kernel-mode exception name.
Definition: exceptions.h:656
EXCEPTION_SIGNATURE_ID Id
An unique id (EXCEPTION_SIGNATURE_ID).
Definition: exceptions.h:535
The modified object is only the driver&#39;s resources sections.
Definition: exceptions.h:161
void * Process
The process object from which the write originates. Valid only for KM-UM writes due to an injection o...
Definition: exceptions.h:971
The name is the #VE Agent.
Definition: exceptions.h:649
BOOLEAN IsIntegrity
True if the originator is found by an integrity check.
Definition: exceptions.h:981
A representation of a Windows VAD structure.
Definition: winvad.h:80
Describes a codeblocks signature.
Definition: exceptions.h:397
INTSTATUS IntExceptGetVictimDtr(DTR *NewValue, DTR *OldValue, INTRO_OBJECT_TYPE Type, EXCEPTION_VICTIM_ZONE *Victim)
This function is used to get the information about the DTR victim.
DWORD Flags
Contains any flags from _SIGNATURE_FLG.
Definition: exceptions.h:402
LIST_ENTRY Link
Definition: exceptions.h:338
INTSTATUS IntExceptKernelGetOriginator(EXCEPTION_KM_ORIGINATOR *Originator, DWORD Options)
This function is used to get the information about the kernel-mode originator.
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:443
INTSTATUS IntExceptUser(EXCEPTION_VICTIM_ZONE *Victim, EXCEPTION_UM_ORIGINATOR *Originator, INTRO_ACTION *Action, INTRO_ACTION_REASON *Reason)
This function iterates through exception lists and tries to find an exception that matches the origin...
The exception is valid only once.
Definition: exceptions.h:625
LIST_HEAD NoNameUserExceptions
Linked list used for user-mode exceptions that don&#39;t have a valid originator (-). ...
Definition: exceptions.h:99
QWORD Rip
Where the write/exec came.
Definition: exceptions.h:1019
The modified object is the security descriptor pointer of a process.
Definition: exceptions.h:178
struct _UM_EXCEPTION_GLOB UM_EXCEPTION_GLOB
Describe a user-mode glob exception.
Describe a codeblocks signature hash.
Definition: exceptions.h:366
The name is the operating system HAL name (valid only for windows).
Definition: exceptions.h:643
WINUM_CACHE_EXPORT * Export
The export cache for the modified module.
Definition: exceptions.h:843
The process object creates another process using DPI flags.
Definition: exceptions.h:224
Describes a operating system version signature.
Definition: exceptions.h:486
void IntExcept(EXCEPTION_VICTIM_ZONE *Victim, void *Originator, EXCEPTION_TYPE Type, INTRO_ACTION *Action, INTRO_ACTION_REASON *Reason, INTRO_EVENT_TYPE EventClass)
This function is the entry point for the exception mechanism.
Definition: exceptions.c:3357
The object that has a NX zone is executed.
Definition: exceptions.h:212
The modified object is a MSR.
Definition: exceptions.h:165
struct _EXCEPTION_VICTIM_DTR EXCEPTION_VICTIM_DTR
Describes a DTR victim.
INTSTATUS IntExceptRemove(void)
This function removes and frees all exceptions and signatures that have been added from exception bin...
Definition: exceptions.c:257
LIST_ENTRY Link
Definition: exceptions.h:488
EXCEPTION_VICTIM_MSR Msr
Valid if the modified zone is MSR.
Definition: exceptions.h:905
struct _SIG_EXPORT_HASH SIG_EXPORT_HASH
Describe a export signature hash.
INTSTATUS IntExceptKernelMatchVictim(EXCEPTION_VICTIM_ZONE *Victim, EXCEPTION_KM_ORIGINATOR *Originator, KM_EXCEPTION *Exception)
This function checks if the exception matches the originator and the modified zone.
DWORD NameHash
The namehash of the originator return driver.
Definition: exceptions.h:947
This structure describes a running process inside the guest.
Definition: winprocess.h:83
enum _EXCEPTION_SIGNATURE_TYPE EXCEPTION_SIGNATURE_TYPE
The identifier that describes a range of signatures.
LIST_HEAD VersionOsSignatures
Linked list used for operating system version signatures.
Definition: exceptions.h:135
The modified object is inside the process modules.
Definition: exceptions.h:194