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 // NOTE: When the PathHash is missing we use the NameHash;
49 //
50 #define EXCEPTION_TABLE_SIZE 0x10
51 #define EXCEPTION_TABLE_ID(H) (((H) & 0xF0000000) >> 0x1c)
52 
54 #define EXCEPTION_CODEBLOCKS_OFFSET 0x250
55 
59 typedef enum _EXCEPTION_TYPE
60 {
66 
67 
72 {
82 
83 
87 typedef struct _EXCEPTIONS
88 {
93 
96 
101 
104 
107 
112 
121 
130 
139 
140  struct
141  {
145  } Version;
146 
149 
150 
155 {
156  kmObjNone = 0,
178 
179  // Add more as needed
181 
182 
187 {
193 
194  // Add more as needed
196 
197 
202 {
203  umObjNone = 0,
222 
223  // Add more as needed
225 
226 
227 
231 #pragma pack(push)
232 #pragma pack(4)
234 {
235  struct
236  {
237  DWORD Value : 22;
238  DWORD Type : 10;
239  } Field;
240 
241  DWORD Value;
243 
244 
248 typedef struct _KM_EXCEPTION
249 {
251 
253 
255 
257 
259 
261 
263  EXCEPTION_SIGNATURE_ID Signatures[];
265 
266 
270 typedef struct _KUM_EXCEPTION
271 {
273 
275 
276  struct
277  {
279  DWORD ProcessHash;
281  } Victim;
282 
284 
286 
288 
290  EXCEPTION_SIGNATURE_ID Signatures[];
292 
293 
294 
298 typedef struct _UM_EXCEPTION
299 {
301 
303 
304  struct
305  {
307  DWORD ProcessHash;
310  } Victim;
311 
313 
315 
317 
319  EXCEPTION_SIGNATURE_ID Signatures[];
321 
322 
326 typedef struct _UM_EXCEPTION_GLOB
327 {
329 
331  char OriginatorNameGlob[EXCEPTION_UM_GLOB_LENGTH];
332 
333  struct
334  {
340  } Victim;
341 
343 
345 
347 
349  EXCEPTION_SIGNATURE_ID Signatures[];
351 
352 
356 typedef struct _SIG_CODEBLOCK_HASH
357 {
359  DWORD Hashes[];
361 
362 
366 typedef struct _SIG_VALUE_HASH
367 {
372 
373 
377 typedef struct _SIG_EXPORT_HASH
378 {
382 
383 
388 {
390 
393 
397 
398  CHAR Object[];
400 
401 
405 typedef struct _SIG_VALUE_CODE
406 {
408 
411 
415 
416  WORD Object[];
418 
419 
423 typedef struct _SIG_EXPORT
424 {
426 
429 
431 
434 
435  CHAR Object[];
437 
438 
442 typedef struct _SIG_VALUE
443 {
445 
448 
452 
453  CHAR Object[];
455 
456 
460 typedef struct _SIG_IDT
461 {
463 
466 
468 
470 } SIG_IDT, *PSIG_IDT;
471 
472 
476 typedef struct _SIG_VERSION_OS
477 {
479 
482 
484 
485  union
486  {
488  struct
489  {
494  BYTE _Reserved[2];
495  };
496 
498  } Minimum;
499 
500  union
501  {
503  struct
504  {
505  BYTE Version;
506  BYTE Patch;
507  WORD Sublevel;
508  WORD Backport;
509  BYTE _Reserved[2];
510  };
511 
512  QWORD Value;
513  } Maximum;
514 
516 
517 
521 typedef struct _SIG_VERSION_INTRO
522 {
524 
527 
529 
530  union
531  {
533  struct
534  {
539  };
540 
542  } Minimum;
543 
544  union
545  {
547  struct
548  {
549  WORD Major;
550  WORD Minor;
551  WORD Revision;
552  WORD Build;
553  };
554 
555  QWORD Raw;
556  } Maximum;
557 
559 
560 
564 typedef struct _SIG_PROCESS_CREATION
565 {
567 
570 
572 
574 
576 
577 #pragma pack(pop)
578 
579 
583 typedef enum _EXCEPTION_FLG
584 {
585  EXCEPTION_FLG_FEEDBACK = 0x00000001,
586  EXCEPTION_FLG_32 = 0x00000002,
587  EXCEPTION_FLG_64 = 0x00000004,
588  EXCEPTION_FLG_INIT = 0x00000008,
591  EXCEPTION_FLG_RETURN = 0x00000010,
592 
593  EXCEPTION_FLG_LINUX = 0x00000080,
594 
595  EXCEPTION_FLG_READ = 0x10000000,
596  EXCEPTION_FLG_WRITE = 0x20000000,
597  EXCEPTION_FLG_EXECUTE = 0x40000000,
598 
599  EXCEPTION_FLG_IGNORE = 0x80000000,
600 
605  EXCEPTION_KM_FLG_SMAP = 0x00000400,
606  EXCEPTION_KM_FLG_SMEP = 0x00000800,
607 
609 
614 
617 
618 } EXCEPTION_FLG;
619 
620 
624 typedef enum _KM_EXCEPTION_NAME
625 {
631 
632  // Note: Add new names only from this line on, because the exception generation
633  // script depends on the ordering of these values.
634 
637 
639 
640  // Add more as needed
641 
643 
645 
646 
650 typedef enum _UM_EXCEPTION_NAME
651 {
656 
658 
659  // Add more as needed
660 
663 
664 
668 typedef enum _SIGNATURE_FLG
669 {
670  SIGNATURE_FLG_32 = 0x00000001,
671  SIGNATURE_FLG_64 = 0x00000002,
672 
673  SIGNATURE_FLG_CB_MEDIUM = 0x00000004,
674 
677 
678  SIGNATURE_FLG_LINUX = 0x00000080,
679 
680 } SIGNATURE_FLG;
681 
682 
683 //
684 // Zone flags
685 //
686 #define ZONE_LIB_IMPORTS 0x000000001ULL
687 #define ZONE_LIB_EXPORTS 0x000000002ULL
688 #define ZONE_LIB_CODE 0x000000004ULL
689 #define ZONE_LIB_DATA 0x000000008ULL
690 #define ZONE_LIB_RESOURCES 0x000000010ULL
692 
693 #define ZONE_PROC_THREAD_CTX 0x000000020ULL
694 #define ZONE_PROC_THREAD_APC 0x000000040ULL
695 #define ZONE_DEP_EXECUTION 0x000000080ULL
696 #define ZONE_MODULE_LOAD 0x000000100ULL
697 
698 #define ZONE_WRITE 0x010000000ULL
699 #define ZONE_READ 0x020000000ULL
700 #define ZONE_EXECUTE 0x040000000ULL
701 
702 #define ZONE_INTEGRITY 0x100000000ULL
703 
704 
708 typedef enum _ZONE_TYPE
709 {
716 } ZONE_TYPE;
717 
718 
722 typedef struct _EXCEPTION_VICTIM_EPT
723 {
727 
728 
732 typedef struct _EXCEPTION_VICTIM_MSR
733 {
737 
738 
742 typedef struct _EXCEPTION_VICTIM_CR
743 {
745 
749 
750 
754 typedef struct _EXCEPTION_VICTIM_DTR
755 {
758 
759 
764 {
769 
770 
775 {
778 
782 
787 {
788  union
789  {
790  void *Module;
792 
793  };
794 
795  char SectionName[9];
796 
799 
800 
805 {
807 
809 
810  union
811  {
812  char *Name;
814  };
815 
818 
819  union
820  {
821  union
822  {
825  };
826 
827  // All of the fields can be valid (injection into a library which has a VAD for eg.).
828  struct
829  {
830  VAD *Vad;
832 
833  union
834  {
835  void *Process;
838  };
839  };
840  };
842 
843 
848 {
850 
853 
855 
856  union
857  {
864  };
865 
866  union
867  {
868  struct
869  {
870  QWORD OldValue[8];
871  QWORD NewValue[8];
872 
874  } WriteInfo;
875 
876  struct
877  {
878  QWORD Value[8];
879 
880  DWORD AccessSize;
881  } ReadInfo;
882 
883  struct
884  {
889  } ExecInfo;
890  };
892 
893 
898 {
899  struct
900  {
905  CHAR Section[9];
906  } Return;
907 
908  STACK_ELEMENT StackElements[8];
910 
911  // Only valid in kernel exceptions
912  struct
913  {
914  DWORD NameHash;
915  DWORD PathHash;
916  KERNEL_DRIVER *Driver;
917  QWORD Rip;
918  CHAR Section[9];
919  } Original;
920 
923  INSTRUX *Instruction;
924 
928 
929 
934 {
936 
937  union
938  {
941  };
942 
943  union
944  {
945  void *Process;
948  };
949 
950  union
951  {
952  void *Library;
954  };
955 
956  union
957  {
960  };
961 
962  struct
963  {
964  DWORD NameHash;
965  union
966  {
967  PCHAR Name;
968  PWCHAR NameWide;
969 
970  };
971  QWORD Rip;
972 
973  union
974  {
975  void *Library;
976  WIN_PROCESS_MODULE *WinLib;
977  };
978  } Return;
979 
981 
982  INSTRUX *Instruction;
983 
986 
987 
992 #define EXCEPTION_KM_ORIGINATOR_OPT_DO_NOT_BLOCK 0x00000001u
993 
994 
995 //
996 // Helpers
997 //
998 #define for_each_km_exception(_ex_head, _var_name) \
999  list_for_each(_ex_head, KM_EXCEPTION, _var_name)
1000 #define for_each_kum_exception(_ex_head, _var_name) \
1001  list_for_each(_ex_head, KUM_EXCEPTION, _var_name)
1002 #define for_each_um_exception(_ex_head, _var_name) \
1003  list_for_each(_ex_head, UM_EXCEPTION, _var_name)
1004 #define for_each_um_glob_exception(_ex_head, _var_name) \
1005  list_for_each(_ex_head, UM_EXCEPTION_GLOB, _var_name)
1006 #define for_each_cb_signature(_ex_head, _var_name) \
1007  list_for_each(_ex_head, SIG_CODEBLOCKS, _var_name)
1008 #define for_each_export_signature(_ex_head, _var_name) \
1009  list_for_each(_ex_head, SIG_EXPORT, _var_name)
1010 #define for_each_value_signature(_ex_head, _var_name) \
1011  list_for_each(_ex_head, SIG_VALUE, _var_name)
1012 #define for_each_value_code_signature(_ex_head, _var_name) \
1013  list_for_each(_ex_head, SIG_VALUE_CODE, _var_name)
1014 #define for_each_idt_signature(_ex_head, _var_name) \
1015  list_for_each(_ex_head, SIG_IDT, _var_name)
1016 #define for_each_version_os_signature(_ex_head, _var_name) \
1017  list_for_each(_ex_head, SIG_VERSION_OS, _var_name)
1018 #define for_each_version_intro_signature(_ex_head, _var_name) \
1019  list_for_each(_ex_head, SIG_VERSION_INTRO, _var_name)
1020 #define for_each_process_creation_signature(_ex_head, _var_name) \
1021  list_for_each(_ex_head, SIG_PROCESS_CREATION, _var_name)
1022 
1023 
1024 //
1025 // Functions
1026 //
1027 
1028 INTSTATUS
1030  void
1031  );
1032 
1033 INTSTATUS
1035  void
1036  );
1037 
1038 INTSTATUS
1040  void
1041  );
1042 
1043 INTSTATUS
1045  void
1046  );
1047 
1048 int
1050  _In_opt_ const LIX_TASK_OBJECT *Task,
1051  _In_ char *Header,
1052  _Out_ char *Line,
1053  _In_ int MaxLength,
1054  _In_opt_ DWORD NameAlignment
1055  );
1056 
1057 int
1059  _In_ WIN_PROCESS_MODULE *Module,
1060  _In_ char *Header,
1061  _Out_ char *Line,
1062  _In_ int MaxLength,
1063  _In_opt_ DWORD NameAlignment
1064  );
1065 
1066 int
1068  _In_ WIN_PROCESS_OBJECT *Process,
1069  _In_ char *Header,
1070  _Out_ char *Line,
1071  _In_ int MaxLength,
1072  _In_opt_ DWORD NameAlignment
1073  );
1074 
1075 int
1077  _In_ KERNEL_DRIVER *Module,
1078  _In_ char *Header,
1079  _Out_ char *Line,
1080  _In_ int MaxLength,
1081  _In_opt_ DWORD NameAlignment
1082  );
1083 
1084 void
1086  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1087  _In_ EXCEPTION_UM_ORIGINATOR *Originator,
1088  _In_ INTRO_ACTION Action,
1089  _In_ INTRO_ACTION_REASON Reason
1090  );
1091 
1092 void
1094  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1095  _In_ EXCEPTION_KM_ORIGINATOR *Originator,
1096  _In_ INTRO_ACTION Action,
1097  _In_ INTRO_ACTION_REASON Reason
1098  );
1099 
1100 void
1102  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1103  _In_ EXCEPTION_KM_ORIGINATOR *Originator,
1104  _In_ INTRO_ACTION Action,
1105  _In_ INTRO_ACTION_REASON Reason
1106  );
1107 
1108 void
1110  _In_ void *Originator,
1111  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1112  _In_ BOOLEAN KernelMode,
1113  _In_ BOOLEAN ReturnDrv
1114  );
1115 
1116 INTSTATUS
1118  _Out_ EXCEPTION_KM_ORIGINATOR *Originator,
1119  _In_ DWORD Options
1120  );
1121 
1122 INTSTATUS
1124  _In_ void *Process,
1125  _Out_ EXCEPTION_UM_ORIGINATOR *Originator
1126  );
1127 
1128 INTSTATUS
1130  _In_ void *Process,
1131  _In_ BOOLEAN ModuleWrite,
1132  _In_ QWORD Address,
1133  _In_opt_ INSTRUX *Instrux,
1134  _Out_ EXCEPTION_UM_ORIGINATOR *Originator
1135  );
1136 
1137 INTSTATUS
1139  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1140  _Out_ EXCEPTION_KM_ORIGINATOR *Originator
1141  );
1142 
1143 INTSTATUS
1145  _In_ QWORD NewValue,
1146  _In_ QWORD OldValue,
1147  _In_ DWORD Cr,
1149  );
1150 
1151 INTSTATUS
1153  _In_opt_ void *Context,
1154  _In_ QWORD Gpa,
1155  _In_ QWORD Gva,
1156  _In_ INTRO_OBJECT_TYPE Type,
1157  _In_ DWORD ZoneFlags,
1159  );
1160 
1161 INTSTATUS
1163  _In_ void *Process,
1164  _In_ QWORD DestinationGva,
1165  _In_ DWORD Length,
1166  _In_ QWORD ZoneFlags,
1168  );
1169 
1170 INTSTATUS
1172  _In_ INTEGRITY_REGION *IntegrityRegion,
1173  _Inout_ DWORD *Offset,
1175  );
1176 
1177 INTSTATUS
1179  _In_ QWORD NewValue,
1180  _In_ QWORD OldValue,
1181  _In_ DWORD Msr,
1183  );
1184 
1185 INTSTATUS
1187  _In_ DTR *NewValue,
1188  _In_ DTR *OldValue,
1189  _In_ INTRO_OBJECT_TYPE Type,
1191  );
1192 
1193 INTSTATUS
1195  _In_ void *Process,
1196  _In_ INTRO_OBJECT_TYPE ObjectType,
1198  );
1199 
1200 INTSTATUS
1202  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1203  _In_ EXCEPTION_UM_ORIGINATOR *Originator,
1204  _In_ UM_EXCEPTION *Exception
1205  );
1206 
1207 INTSTATUS
1209  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1210  _In_ EXCEPTION_UM_ORIGINATOR *Originator,
1211  _In_ UM_EXCEPTION *Exception
1212  );
1213 
1214 INTSTATUS
1216  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1217  _In_ EXCEPTION_UM_ORIGINATOR *Originator,
1218  _In_ UM_EXCEPTION *Exception
1219  );
1220 
1221 INTSTATUS
1223  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1224  _In_ EXCEPTION_UM_ORIGINATOR *Originator,
1225  _In_ UM_EXCEPTION_GLOB *Exception
1226  );
1227 
1228 INTSTATUS
1230  _In_ void *Victim,
1231  _In_ void *Originator,
1232  _In_ void *Exception,
1233  _In_ EXCEPTION_TYPE ExceptionType,
1234  _Out_ INTRO_ACTION *Action,
1235  _Out_ INTRO_ACTION_REASON *Reason
1236  );
1237 
1238 INTSTATUS
1240  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1241  _In_ EXCEPTION_KM_ORIGINATOR *Originator,
1242  _In_ KM_EXCEPTION *Exception
1243  );
1244 
1245 INTSTATUS
1247  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1248  _In_ EXCEPTION_UM_ORIGINATOR *Originator,
1249  _In_ void *Exception,
1250  _In_ EXCEPTION_TYPE ExceptionType
1251  );
1252 
1253 INTSTATUS
1255  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1256  _In_ EXCEPTION_KM_ORIGINATOR *Originator,
1257  _In_ KUM_EXCEPTION *Exception
1258  );
1259 
1260 INTSTATUS
1262  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1263  _In_ EXCEPTION_KM_ORIGINATOR *Originator,
1264  _Out_ INTRO_ACTION *Action,
1265  _Out_ INTRO_ACTION_REASON *Reason
1266  );
1267 
1268 INTSTATUS
1270  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1271  _In_ EXCEPTION_UM_ORIGINATOR *Originator,
1272  _Out_ INTRO_ACTION *Action,
1273  _Out_ INTRO_ACTION_REASON *Reason
1274  );
1275 
1276 INTSTATUS
1278  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1279  _In_ EXCEPTION_KM_ORIGINATOR *Originator,
1280  _Out_ INTRO_ACTION *Action,
1281  _Out_ INTRO_ACTION_REASON *Reason
1282  );
1283 
1284 void
1285 IntExcept(
1286  _In_ EXCEPTION_VICTIM_ZONE *Victim,
1287  _In_ void *Originator,
1288  _In_ EXCEPTION_TYPE Type,
1289  _Out_ INTRO_ACTION *Action,
1290  _Out_ INTRO_ACTION_REASON *Reason,
1291  _In_ INTRO_EVENT_TYPE EventClass
1292  );
1293 
1294 void
1296  _In_ QWORD Gva
1297  );
1298 
1299 void
1301  _In_ QWORD Cr3
1302  );
1303 
1304 BOOLEAN
1306  void
1307  );
1308 
1316 #define IntExceptErase(Ptr, Tag) \
1317  do { \
1318  RemoveEntryList(&((Ptr)->Link)); \
1319  HpFreeAndNullWithTag(&(Ptr), (Tag)); \
1320  } while(0)
1321 
1322 #endif // _EXCEPTIONS_H_
The range-identifier used for value-code signature.
Definition: exceptions.h:79
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:409
void * Module
The internal structure of a module.
Definition: exceptions.h:790
The object allows only dlls which are detected as suspicous (e.g. module loads before kernel32...
Definition: exceptions.h:219
EXCEPTION_VICTIM_CR Cr
Valid if the modified zone is CR.
Definition: exceptions.h:860
#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:262
QWORD Context
Contains the context given by the integrator.
Definition: exceptions.h:316
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:786
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:396
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:233
The value hash is for the process command line (valid only for value signature).
Definition: exceptions.h:676
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:377
QWORD ZoneFlags
The flags of the modified zone.
Definition: exceptions.h:852
struct _EXCEPTION_VICTIM_OBJECT * PEXCEPTION_VICTIM_OBJECT
Describes a process-creation signature.
Definition: exceptions.h:564
LIST_HEAD KernelUserExceptions[EXCEPTION_TABLE_SIZE]
Array of linked lists used for kernel-user mode exceptions.
Definition: exceptions.h:109
LIST_HEAD ValueCodeSignatures
Linked list used for value-code signatures.
Definition: exceptions.h:134
The modified object is anything inside the HAL heap zone.
Definition: exceptions.h:168
#define _In_
Definition: intro_sal.h:21
Describe a kernel-user mode exception.
Definition: exceptions.h:270
The signature is valid only on 64 bit systems/processes.
Definition: exceptions.h:671
BYTE Score
The number of (minimum) hashes from a list that need to match.
Definition: exceptions.h:394
QWORD Context
Contains the context given by the integrator.
Definition: exceptions.h:287
EXCEPTION_VICTIM_EPT Ept
Valid if the modified zone is EPT.
Definition: exceptions.h:858
WORD Offset
The displacement from the beginning of the modified zone.
Definition: exceptions.h:368
LIST_HEAD NoNameKernelExceptions
Linked list used for kernel-mode exceptions that don&#39;t have a valid originator (-).
Definition: exceptions.h:98
The name can be any string.
Definition: exceptions.h:626
uint16_t WORD
Definition: intro_types.h:48
struct _SIG_VALUE SIG_VALUE
Describes a value signature.
Describes a value signature.
Definition: exceptions.h:405
WORD Delta
The number of bytes that are modified.
Definition: exceptions.h:379
The modified object is only the driver&#39;s EAT.
Definition: exceptions.h:159
DWORD Cr
The CR written.
Definition: exceptions.h:744
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:722
struct _EXCEPTION_VICTIM_INJECTION * PEXCEPTION_VICTIM_INJECTION
DWORD Build
Definition: exceptions.h:142
User-mode exception.
Definition: exceptions.h:61
LIST_HEAD GenericUserExceptions
Linked list used for user-mode exceptions that have a generic originator(*).
Definition: exceptions.h:92
QWORD Context
Contains the context given by the integrator.
Definition: exceptions.h:346
struct _EXCEPTION_VICTIM_MODULE * PEXCEPTION_VICTIM_MODULE
Blocking exception.
Definition: exceptions.h:188
The modified object is anything inside the structure CONTEXT (valid only for windows).
Definition: exceptions.h:211
QWORD Context
Contains the context given by the integrator.
Definition: exceptions.h:260
LIST_HEAD ExportSignatures
Linked list used for export signatures.
Definition: exceptions.h:132
union _EXCEPTION_SIGNATURE_ID EXCEPTION_SIGNATURE_ID
The exception ID. The layout consists of the exception type and the unique identifier of the exceptio...
LIST_HEAD ProcessCreationAlertExceptions
Linked list used for process-creation exceptions that are added from alert.
Definition: exceptions.h:123
struct _KUM_EXCEPTION * PKUM_EXCEPTION
The exception sends a feedback alert.
Definition: exceptions.h:585
The exception will take into consideration the return driver/dll.
Definition: exceptions.h:591
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:258
QWORD StackBase
The stack base for the thread that attempted the execution.
Definition: exceptions.h:886
The name is the operating system vsyscall (valid only for Linux).
Definition: exceptions.h:636
EXCEPTION_SIGNATURE_ID Id
An unique id (_EXCEPTION_SIGNATURE_ID).
Definition: exceptions.h:391
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:252
INTRO_PC_VIOLATION_TYPE
Process creation violation flags.
Definition: intro_types.h:1516
EXCEPTION_SIGNATURE_ID Id
An unique id (EXCEPTION_SIGNATURE_ID).
Definition: exceptions.h:568
The modified object is inside an EPT hook.
Definition: exceptions.h:710
LIST_HEAD VersionIntroSignatures
Linked list used for introspection version signatures.
Definition: exceptions.h:137
BOOLEAN IntUpdateAreExceptionsLoaded(void)
Checks if the exceptions are loaded.
QWORD Gva
The guest virtual address to be written.
Definition: exceptions.h:776
Describe a user-mode glob exception.
Definition: exceptions.h:326
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.
LIST_HEAD ProcessCreationSignatures
Linked list used for process-creation signatures.
Definition: exceptions.h:138
BYTE ListsCount
The number of the list of hashes.
Definition: exceptions.h:432
The exception is valid only for read violation.
Definition: exceptions.h:595
_EXCEPTION_SIGNATURE_TYPE
The identifier that describes a range of signatures.
Definition: exceptions.h:71
LIST_HEAD IdtSignatures
Linked list used for IDT signatures.
Definition: exceptions.h:135
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:451
EXCEPTION_SIGNATURE_ID Id
An unique id (EXCEPTION_SIGNATURE_ID).
Definition: exceptions.h:427
BYTE Entry
The number of the IDT entry.
Definition: exceptions.h:467
LIST_HEAD UserAlertExceptions
Linked list used for user-mode exceptions that are added from alert.
Definition: exceptions.h:125
Describes a user-mode originator.
Definition: exceptions.h:933
Used to indicate an invalid user-mode exception name.
Definition: exceptions.h:661
LIST_ENTRY Link
Definition: exceptions.h:425
KERNEL_DRIVER * Driver
The driver that&#39;s modifying the memory.
Definition: exceptions.h:903
INSTRUX * Instruction
The modifying instruction (at the OriginalRip). There&#39;s no point in getting the instruction at Rip...
Definition: exceptions.h:923
The modified object is only the driver&#39;s data sections.
Definition: exceptions.h:161
struct _SIG_VALUE_HASH SIG_VALUE_HASH
Describe a value signature hash.
The name can be any string.
Definition: exceptions.h:652
The range-identifier used for idt signature.
Definition: exceptions.h:78
LIST_HEAD UserExceptions[EXCEPTION_TABLE_SIZE]
Array of linked lists used for user-mode exceptions.
Definition: exceptions.h:110
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:3127
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:887
DWORD TotalLength
The length of the integrity zone.
Definition: exceptions.h:767
BYTE * Buffer
The buffer to be written.
Definition: exceptions.h:779
DWORD NameHash
The namehash of the process.
Definition: exceptions.h:935
struct _EXCEPTION_VICTIM_EPT * PEXCEPTION_VICTIM_EPT
_ZONE_TYPE
Describes the zone types that can be excepted.
Definition: exceptions.h:708
BOOLEAN Loaded
True if the exceptions are loaded.
Definition: exceptions.h:147
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:285
The exception will match only for the init phase of a driver/process.
Definition: exceptions.h:589
The exception is valid only for Linux.
Definition: exceptions.h:593
The exception is valid only if the originator process is a system process.
Definition: exceptions.h:611
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:446
PCHAR Name
The process name of the originator (saved as CHAR).
Definition: exceptions.h:939
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:766
DWORD NameHash
Definition: exceptions.h:306
Describes a integrity victim.
Definition: exceptions.h:763
LIST_HEAD KernelAlertExceptions
Linked list used for kernel-mode exceptions that are added from alert.
Definition: exceptions.h:127
The name is missing.
Definition: exceptions.h:630
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-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:186
Describes a kernel-mode originator.
Definition: exceptions.h:897
LIX_TASK_OBJECT * LixProc
The internal structure of the modified Linux process.
Definition: exceptions.h:837
The modified object is only the driver&#39;s IAT.
Definition: exceptions.h:175
User-mode exception that accepts glob content.
Definition: exceptions.h:63
Describes a MSR victim.
Definition: exceptions.h:732
WORD Size
The size of of the modified zone.
Definition: exceptions.h:369
struct _EXCEPTION_CB_SIGNATURE SIG_CODEBLOCKS
Describes a codeblocks signature.
Codeblocks were extracted at a medium level.
Definition: exceptions.h:673
BOOLEAN Smep
True if SMEP is modified.
Definition: exceptions.h:747
The modified object is any with the modified name.
Definition: exceptions.h:189
INTRO_OBJECT_TYPE Type
The type of the modified object.
Definition: exceptions.h:756
The range-identifier used for value signature.
Definition: exceptions.h:77
void * Process
The process that&#39;s modifying the memory (always present).
Definition: exceptions.h:945
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:528
The exception is valid only for write violation.
Definition: exceptions.h:596
The range-identifier used for process creation signature.
Definition: exceptions.h:75
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:946
struct _EXCEPTION_VICTIM_CR * PEXCEPTION_VICTIM_CR
DWORD Flags
Contains any flags from EXCEPTION_FLG.
Definition: exceptions.h:256
INTRO_PC_VIOLATION_TYPE PcType
Valid if the current violation is DPI Process Creation Violation.
Definition: exceptions.h:980
struct _EXCEPTIONS EXCEPTIONS
Describes the internal exceptions data.
BYTE ListsCount
The number of the list of hashes.
Definition: exceptions.h:450
struct _KUM_EXCEPTION KUM_EXCEPTION
Describe a kernel-user mode exception.
enum _ZONE_TYPE ZONE_TYPE
Describes the zone types that can be excepted.
The modified object is anything inside the driver.
Definition: exceptions.h:158
QWORD SourceVA
The GVA from where the injection is.
Definition: exceptions.h:959
The name is missing.
Definition: exceptions.h:657
Describes a value signature.
Definition: exceptions.h:442
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:205
DWORD PathHash
The pathhash of the originator return driver.
Definition: exceptions.h:902
EXCEPTION_VICTIM_OBJECT Object
The modified object.
Definition: exceptions.h:849
struct _SIG_CODEBLOCK_HASH * PSIG_CODEBLOCK_HASH
DWORD Flags
Contains any flags from SIGNATURE_FLG.
Definition: exceptions.h:569
void * Library
The library that&#39;s modifying the memory (if that&#39;s the case).
Definition: exceptions.h:952
the modified object is IDTR/GDTR.
Definition: exceptions.h:715
EXCEPTION_VICTIM_MODULE Module
Used when a module is modified.
Definition: exceptions.h:823
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:414
struct _KM_EXCEPTION KM_EXCEPTION
Describe a kernel-mode exception.
_UM_EXCEPTION_OBJECT
Object type of the user-mode exception.
Definition: exceptions.h:201
LIST_HEAD CbSignatures
Linked list used for codeblocks signatures.
Definition: exceptions.h:131
#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:817
#define _Inout_
Definition: intro_sal.h:20
The exception is valid only for CR4.SMEP write.
Definition: exceptions.h:606
The range-identifier used for export signature.
Definition: exceptions.h:76
struct _EXCEPTION_VICTIM_EPT EXCEPTION_VICTIM_EPT
Describes an EPT victim.
DWORD Flags
Contains any flags from EXCEPTION_FLG.
Definition: exceptions.h:342
DWORD BufferSize
The buffer size to be written.
Definition: exceptions.h:780
PWCHAR NameWide
The module name of the originator (saved as WCHAR).
Definition: exceptions.h:940
LIST_HEAD KernelUserAlertExceptions
Linked list used for kernel-user mode exceptions that are added from alert.
Definition: exceptions.h:129
QWORD Rsp
The value of the guest RSP register at the moment of execution.
Definition: exceptions.h:885
The modified object is inside an integrity hook.
Definition: exceptions.h:713
The exception is valid only for CR4.SMAP write.
Definition: exceptions.h:605
WIN_DRIVER_OBJECT * DriverObject
Used when a driver object / fastio dispatch table is modified.
Definition: exceptions.h:824
DWORD LibraryNameHash
The name-hash of the modified library.
Definition: exceptions.h:430
DWORD Hash
The hash of the modified zone.
Definition: exceptions.h:370
_EXCEPTION_FLG
Describes the flags that can be used by an exception.
Definition: exceptions.h:583
Describes an injection.
Definition: exceptions.h:774
DWORD Flags
Contains any flags from _EXCEPTION_FLG.
Definition: exceptions.h:312
struct _KM_EXCEPTION * PKM_EXCEPTION
WORD SigCount
Contains the number of signatures.
Definition: exceptions.h:289
DWORD Flags
Contains any flags from SIGNATURE_FLG.
Definition: exceptions.h:465
LIX_TASK_OBJECT * LixProc
The Linux process that&#39;s modifying the memory (always present).
Definition: exceptions.h:947
LIST_HEAD KernelFeedbackExceptions
Linked list used for kernel-mode exceptions that have the feedback flag.
Definition: exceptions.h:116
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:300
The exception is valid only for execute violation.
Definition: exceptions.h:597
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:254
unsigned long long QWORD
Definition: intro_types.h:53
The modified object is only the driver&#39;s code sections.
Definition: exceptions.h:160
The name is the operating system kernel name.
Definition: exceptions.h:628
enum _EXCEPTION_TYPE EXCEPTION_TYPE
The type of an exception.
The signature is valid only on 32 bit systems/processes.
Definition: exceptions.h:670
struct _SIG_VERSION_INTRO * PSIG_VERSION_INTRO
struct _EXCEPTION_VICTIM_DTR * PEXCEPTION_VICTIM_DTR
QWORD Gpa
The modified guest physical address.
Definition: exceptions.h:725
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:653
struct _SIG_IDT * PSIG_IDT
DWORD OriginatorNameHash
Contains the originator name-hash.
Definition: exceptions.h:274
EXCEPTION_SIGNATURE_ID Id
An unique id (EXCEPTION_SIGNATURE_ID).
Definition: exceptions.h:464
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:272
_KM_EXCEPTION_OBJECT
Object type of the kernel-mode exception.
Definition: exceptions.h:154
QWORD StartVirtualAddress
The start address of the integrity zone.
Definition: exceptions.h:765
Describe a value signature hash.
Definition: exceptions.h:366
Describes a introspection version signature.
Definition: exceptions.h:521
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:483
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...
struct _SIG_EXPORT SIG_EXPORT
Describes a export signature.
The range-identifier used for version operating system signature.
Definition: exceptions.h:73
Allow modification of it&#39;s own driver object.
Definition: exceptions.h:627
EXCEPTION_VICTIM_DTR Dtr
Valid if the modified zone is DTR.
Definition: exceptions.h:861
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:163
The modified object is the self map entry inside PDBR.
Definition: exceptions.h:169
DWORD NameHash
The hash of the modified object.
Definition: exceptions.h:808
Describes the internal exceptions data.
Definition: exceptions.h:87
DWORD Flags
Contains any flags from SIGNATURE_FLG.
Definition: exceptions.h:428
EXCEPTION_SIGNATURE_ID Id
An unique id (EXCEPTION_SIGNATURE_ID).
Definition: exceptions.h:480
LIST_ENTRY Link
Definition: exceptions.h:462
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:804
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:62
DWORD Length
The length of the instruction.
Definition: exceptions.h:888
LIST_ENTRY Link
Definition: exceptions.h:250
INTRO_OBJECT_TYPE Type
The type of the modified object.
Definition: exceptions.h:806
Describes a export signature.
Definition: exceptions.h:423
ZONE_TYPE ZoneType
The type of the modified zone.
Definition: exceptions.h:851
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:118
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:212
char * PCHAR
Definition: intro_types.h:56
DWORD Length
The length of the write.
Definition: exceptions.h:777
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:711
DWORD Flags
Contains any flags from SIGNATURE_FLG.
Definition: exceptions.h:410
The exception will take into consideration the return driver.
Definition: exceptions.h:604
The modified object is inside the process module&#39;s EAT.
Definition: exceptions.h:192
struct _SIG_VERSION_OS * PSIG_VERSION_OS
The modified object is the privileges field inside the nt!_TOKEN structure.
Definition: exceptions.h:176
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:167
struct _EXCEPTION_VICTIM_ZONE EXCEPTION_VICTIM_ZONE
Describes the modified zone.
DWORD Flags
Contains any flags from EXCEPTION_FLG.
Definition: exceptions.h:283
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:207
Describes the modified zone.
Definition: exceptions.h:847
struct _UM_EXCEPTION_GLOB * PUM_EXCEPTION_GLOB
This exception will be ignored.
Definition: exceptions.h:599
struct _UM_EXCEPTION * PUM_EXCEPTION
The modified object is IDTR.
Definition: exceptions.h:171
The modified object is inside the process module&#39;s IAT.
Definition: exceptions.h:191
Describe a kernel-mode exception.
Definition: exceptions.h:248
Describe a user-mode exception.
Definition: exceptions.h:298
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:203
uint32_t DWORD
Definition: intro_types.h:49
int16_t INT16
Definition: intro_types.h:43
#define EXCEPTION_TABLE_SIZE
Definition: exceptions.h:50
The exception is valid only for integrity zone.
Definition: exceptions.h:608
LIST_ENTRY Link
Definition: exceptions.h:523
The modified object is anything inside the driver&#39;s fast IO dispatch table.
Definition: exceptions.h:165
LIST_HEAD GlobUserExceptions
Linked list used for user-mode exceptions that contains glob content.
Definition: exceptions.h:106
The name is the operating system vdso (valid only for Linux).
Definition: exceptions.h:635
DWORD Hash
The hash of the modified function name.
Definition: exceptions.h:380
BYTE Count
The number of hashes from the list.
Definition: exceptions.h:358
union _EXCEPTION_SIGNATURE_ID * PEXCEPTION_SIGNATURE_ID
The modified object is any with the modified name.
Definition: exceptions.h:157
enum _INTRO_ACTION INTRO_ACTION
Event actions.
LIST_HEAD ProcessCreationExceptions
Linked list used for process creations exceptions.
Definition: exceptions.h:111
struct _EXCEPTION_KM_ORIGINATOR * PEXCEPTION_KM_ORIGINATOR
_UM_EXCEPTION_NAME
The predefined names for user-mode exception.
Definition: exceptions.h:650
The exception is valid only if the modified process is a child of the originator process.
Definition: exceptions.h:613
QWORD Rip
The RIP from where the call to the exported function came.
Definition: exceptions.h:904
The name is the operating system vdso (valid only for Linux).
Definition: exceptions.h:654
Describes a CR victim.
Definition: exceptions.h:742
QWORD Gva
The modified guest virtual address.
Definition: exceptions.h:724
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:873
Signals an execution inside SharedUserData.
Definition: exceptions.h:221
LIST_HEAD GenericKernelExceptions
Linked list used for kernel-mode exceptions that have a generic originator (*).
Definition: exceptions.h:90
UM_EXCEPTION_OBJECT Type
Contains the type of the exception (UM_EXCEPTION_OBJECT).
Definition: exceptions.h:314
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:344
WIN_PROCESS_OBJECT * WinProc
The internal structure of the modified Windows process.
Definition: exceptions.h:836
The modified object represents an execution inside SharedUserData.
Definition: exceptions.h:177
LIST_HEAD ValueSignatures
Linked list used for value signatures.
Definition: exceptions.h:133
DWORD Flags
Contains any flags from SIGNATURE_FLG.
Definition: exceptions.h:447
DWORD Flags
Contains any flags from SIGNATURE_FLG.
Definition: exceptions.h:481
The modified object is inside a process.
Definition: exceptions.h:714
QWORD ProtectionFlag
The protection flags of the modified zone.
Definition: exceptions.h:854
DWORD OriginatorNameHash
Contains the originator name-hash.
Definition: exceptions.h:302
The modified object is any IDT entry.
Definition: exceptions.h:170
struct _EXCEPTION_VICTIM_MSR * PEXCEPTION_VICTIM_MSR
The signature is valid only on Linux.
Definition: exceptions.h:678
LIST_ENTRY Link
Definition: exceptions.h:407
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:348
The modified object is inside the process modules.
Definition: exceptions.h:206
LIST_HEAD NoNameKernelUserExceptions
Linked list used for kernel-user mode exceptions that don&#39;t have a valid originator (-)...
Definition: exceptions.h:103
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:953
DWORD Type
Contains a type of signature (EXCEPTION_SIGNATURE_TYPE).
Definition: exceptions.h:238
LIST_HEAD ProcessCreationFeedbackExceptions
Linked list used for process-creation exceptions that have the feedback flag.
Definition: exceptions.h:120
void * Process
The internal structure of the modified process.
Definition: exceptions.h:835
Blocking exception.
Definition: exceptions.h:156
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:571
BYTE Score
The number of (minimum) hashes from a list that need to match.
Definition: exceptions.h:449
struct _EXCEPTION_VICTIM_INJECTION EXCEPTION_VICTIM_INJECTION
Describes an injection.
DWORD Flags
Contains any flags from SIGNATURE_FLG.
Definition: exceptions.h:526
LIST_HEAD UserFeedbackExceptions
Linked list used for user-mode exceptions that have the feedback flag.
Definition: exceptions.h:114
QWORD NewDriverBase
The module base where the new value is.
Definition: exceptions.h:734
The name is the operating system vsyscall (valid only for Linux).
Definition: exceptions.h:655
_SIGNATURE_FLG
Describes the flags that can be used by an signature.
Definition: exceptions.h:668
char * Name
The modified process name.
Definition: exceptions.h:812
WORD Length
The length of the opcode pattern.
Definition: exceptions.h:413
WCHAR * NameWide
The modified module name.
Definition: exceptions.h:813
LIST_HEAD KernelExceptions[EXCEPTION_TABLE_SIZE]
Array of linked lists used for kernel-mode exceptions.
Definition: exceptions.h:108
struct _SIG_VALUE_CODE SIG_VALUE_CODE
Describes a value signature.
Describes a DTR victim.
Definition: exceptions.h:754
BYTE ListsCount
The number of the list of hashes.
Definition: exceptions.h:395
_EXCEPTION_TYPE
The type of an exception.
Definition: exceptions.h:59
The modified object is WMI_LOGGER_CONTEXT.GetCpuClock used by InfinityHook (valid only on windows)...
Definition: exceptions.h:172
DWORD Msr
The MSR written.
Definition: exceptions.h:735
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:925
EXCEPTION_VICTIM_INJECTION Injection
Valid if the modified zone is Injection.
Definition: exceptions.h:863
BOOLEAN AlertSignature
True if the signature is added from alert.
Definition: exceptions.h:469
void IntExceptDumpSignatures(void *Originator, EXCEPTION_VICTIM_ZONE *Victim, BOOLEAN KernelMode, BOOLEAN ReturnDrv)
Dump code blocks from the originator&#39;s RIP.
Definition: exceptions.c:2938
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:497
The modified object is any with the modified name.
Definition: exceptions.h:204
The range-identifier used for codeblocks signature.
Definition: exceptions.h:80
LIST_HEAD GenericKernelUserExceptions
Linked list used for kernel-user mode exceptions that have a generic originator(*).
Definition: exceptions.h:95
Describes a idt signature.
Definition: exceptions.h:460
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:237
EXCEPTION_VICTIM_MODULE Library
The victim module of the modified library.
Definition: exceptions.h:831
The modified object is a CR.
Definition: exceptions.h:712
Kernel-User mode exception.
Definition: exceptions.h:64
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:573
EXCEPTION_VICTIM_INTEGRITY Integrity
Valid if the modified zone is Integrity.
Definition: exceptions.h:862
_KM_EXCEPTION_NAME
The predefined names for kernel-mode exception.
Definition: exceptions.h:624
The modified object is the thread which was performed an asynchronous procedure call on...
Definition: exceptions.h:215
LIST_ENTRY Link
Definition: exceptions.h:444
VAD * Vad
The internal structure of the modified VAD.
Definition: exceptions.h:830
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:602
WORD SigCount
Contains the number of signatures.
Definition: exceptions.h:318
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:412
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:791
The exception is valid only on 32 bit systems/process.
Definition: exceptions.h:586
INSTRUX * Instruction
The modifying/executing instruction (valid when Rip != 0).
Definition: exceptions.h:982
The range-identifier used for version introspection signature.
Definition: exceptions.h:74
The modified object is anything inside the driver object.
Definition: exceptions.h:164
char CHAR
Definition: intro_types.h:56
BOOLEAN Smap
True if SMAP is modified.
Definition: exceptions.h:746
struct _EXCEPTION_UM_ORIGINATOR EXCEPTION_UM_ORIGINATOR
Describes a user-mode originator.
The exception is valid only for apphelp process.
Definition: exceptions.h:616
Used to indicate an invalid kernel-mode exception name.
Definition: exceptions.h:642
EXCEPTION_SIGNATURE_ID Id
An unique id (EXCEPTION_SIGNATURE_ID).
Definition: exceptions.h:525
The modified object is only the driver&#39;s resources sections.
Definition: exceptions.h:162
The name is the #VE Agent.
Definition: exceptions.h:638
BOOLEAN IsIntegrity
True if the originator is found by an integrity check.
Definition: exceptions.h:926
A representation of a Windows VAD structure.
Definition: winvad.h:80
Describes a codeblocks signature.
Definition: exceptions.h:387
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:392
LIST_ENTRY Link
Definition: exceptions.h:328
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:433
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:615
LIST_HEAD NoNameUserExceptions
Linked list used for user-mode exceptions that don&#39;t have a valid originator (-). ...
Definition: exceptions.h:100
QWORD Rip
Where the write/exec came.
Definition: exceptions.h:958
struct _UM_EXCEPTION_GLOB UM_EXCEPTION_GLOB
Describe a user-mode glob exception.
Describe a codeblocks signature hash.
Definition: exceptions.h:356
The name is the operating system HAL name (valid only for windows).
Definition: exceptions.h:629
WINUM_CACHE_EXPORT * Export
The export cache for the modified module.
Definition: exceptions.h:797
The process object creates another process using DPI flags.
Definition: exceptions.h:220
Describes a operating system version signature.
Definition: exceptions.h:476
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:3317
The object that has a NX zone is executed.
Definition: exceptions.h:208
The modified object is a MSR.
Definition: exceptions.h:166
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:478
EXCEPTION_VICTIM_MSR Msr
Valid if the modified zone is MSR.
Definition: exceptions.h:859
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:901
This structure describes a running process inside the guest.
Definition: winprocess.h:81
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:136
The modified object is inside the process modules.
Definition: exceptions.h:190