Bitdefender Hypervisor Memory Introspection
winprocess.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
11 
12 #ifndef _WINPROCESS_H_
13 #define _WINPROCESS_H_
14 
15 #include "winumpath.h"
16 #include "winguest.h"
17 #include "update_guests.h"
18 #include "windpi.h"
19 #include "winsecdesc.h"
20 
21 struct _WIN_PROCESS_OBJECT;
22 
23 #define WIN_STATUS_ACCESS_DENIED 0xC0000022
24 #define WIN_STATUS_SUCCESS 0x00000000
25 
26 
30 typedef enum _WIN_SUBSYTEM_TYPE
31 {
36 
41 {
42  winProcExitVad = 0x01,
49 
50 
54 typedef struct _WIN_PROCESS_SUBSYSTEM
55 {
58 
60 
63 
69 
71 
75 
79 
83 typedef struct _WIN_PROCESS_OBJECT
84 {
89 
93 
96 
97 
102 
105 
107 
109 
112 
115 
117 
118  union
119  {
122 
123  struct
124  {
127 
137  DWORD Lsass : 1;
138 
141 
145 
147 
152 
155 
158 
161 
165 
168 
170  };
171  };
172 
175 
178 
181 
185 
188 
190 
193 
196 
197  union
198  {
201 
202  struct
203  {
210  DWORD ProtThreadCtx : 1;
212 
214  DWORD ProtCreation: 1;
216 
221  DWORD ProtRemediate : 1;
223 
225  DWORD ProtBeta : 1;
227  };
228  };
229 
232 
234 
238 
242 
244  void *VasMonRoot;
246 
248 
252 
256 
258 
259  void *SelfMapHook;
261 
264 
267 
270 
274 
278 
279  struct
280  {
282 
285 
288 
290 
294 
296 
299 
302  } CreationInfo;
303 
305 
308  PWIN_PROCESS_SUBSYSTEM Subsystemx86;
309 
312  PWIN_PROCESS_SUBSYSTEM Subsystemx64;
313 
314  void *TokenHook;
315 
323 
327 
331 
335 
343 
352 
353  struct
354  {
357 
360 
363 
366 
369  } SecurityDescriptor;
370 
372 
373 
374 static __forceinline QWORD
377  )
386 {
387  return Process->SystemProcess ? INTRO_OPT_PROT_UM_SYS_PROCS : INTRO_OPT_PROT_UM_MISC_PROCS;
388 }
389 
390 static __forceinline BOOLEAN
393  _In_ QWORD Flag
394  )
404 {
405  return Process->BetaDetections ||
407  (Process->BetaMask & Flag) != 0;
408 }
409 
410 static __forceinline BOOLEAN
413  _In_ QWORD Flag
414  )
424 {
425  return ((Process->FeedbackMask & Flag) ||
427 }
428 
429 INTSTATUS
431  _In_ void *Detour
432  );
433 
434 INTSTATUS
436  _In_ void *Detour
437  );
438 
439 INTSTATUS
441  _In_ void *Detour
442  );
443 
444 INTSTATUS
446  _In_ void *Detour
447  );
448 
449 INTSTATUS
451  _In_ void *Detour
452  );
453 
454 INTSTATUS
456  _In_ QWORD FunctionAddress,
457  _In_ void *Handler,
458  _In_ void *Descriptor
459  );
460 
461 INTSTATUS
463  _In_ QWORD FunctionAddress,
464  _In_ void *Handler,
465  _In_ void *Descriptor
466  );
467 
468 INTSTATUS
470  _In_ QWORD FunctionAddress,
471  _In_ void *Handler,
472  _In_ void *Descriptor
473  );
474 
475 INTSTATUS
477  _In_ QWORD FunctionAddress,
478  _In_ void *Handler,
479  _In_ void *Descriptor
480  );
481 
482 INTSTATUS
485  );
486 
487 INTSTATUS
490  );
491 
494  _In_ PWCHAR Path,
495  _In_ BOOLEAN IsSystem
496  );
497 
498 INTSTATUS
500  void
501  );
502 
503 INTSTATUS
506  _In_ QWORD EprocessAddress,
507  _In_ PBYTE EprocessBuffer,
508  _In_ QWORD ParentEprocess,
509  _In_ QWORD RealParentEprocess,
510  _In_ QWORD Cr3,
511  _In_ DWORD Pid,
512  _In_ BOOLEAN StaticScan
513  );
514 
515 INTSTATUS
517  void
518  );
519 
520 INTSTATUS
522  _In_ const WCHAR *Path,
523  _In_ DWORD ProtectionMask,
524  _In_ QWORD Context
525  );
526 
527 INTSTATUS
529  _In_ const WCHAR *Path
530  );
531 
532 INTSTATUS
534  void
535  );
536 
537 void
539  void
540  );
541 
542 void
544  void
545  );
546 
547 INTSTATUS
549  _In_ DWORD Pid,
551  );
552 
553 INTSTATUS
556  );
557 
558 INTSTATUS
561  _In_ DWORD OldMask,
562  _In_ DWORD NewMask
563  );
564 
565 void
567  _In_ const void *Name,
568  _In_ const CAMI_STRING_ENCODING Encoding,
569  _In_ const CAMI_PROT_OPTIONS *Options
570  );
571 
572 INTSTATUS
574  _In_ void *Detour
575  );
576 
577 INTSTATUS
579  _In_ QWORD FunctionAddress,
580  _In_ void *Handler,
581  _In_ void *Descriptor
582  );
583 
584 #endif // _WINPROCESS_H_
DWORD CommandLineSize
Includes the NULL terminator.
Definition: winprocess.h:116
PCHAR CommandLine
The command line with which the process was created (can be NULL).
Definition: winprocess.h:114
INTSTATUS IntWinProcPatchPspInsertProcess86(QWORD FunctionAddress, void *Handler, void *Descriptor)
This functions is responsible for patching the detour that handles the "PspInsertProcess".
Definition: winprocess.c:2346
uint16_t * PWCHAR
Definition: intro_types.h:63
Process subsystem type unknown.
Definition: winprocess.h:32
PWIN_PROCESS_SUBSYSTEM Subsystemx64
The x64 subsystem. Note that a 32 bit process on a 64 bit OS may have both subsystems valid...
Definition: winprocess.h:312
INTSTATUS IntWinProcHandleInstrument(void *Detour)
Handles an exit on NtSetInformationProcess calls where the InformationClass argument is 40 (instrumen...
Definition: winprocess.c:4433
BOOLEAN EnforcedDep
TRUE is the DEP (Data Execution Prevention) has been enforced.
Definition: winprocess.h:189
#define _Out_
Definition: intro_sal.h:22
_Bool BOOLEAN
Definition: intro_types.h:58
DWORD Flags
Windows process flags (possible values for this bitmask are described below).
Definition: winprocess.h:121
DWORD NtdllSize
The size of ntdll.dll.
Definition: winprocess.h:77
DWORD MonitorModules
TRUE if we need to monitor module load/unloads.
Definition: winprocess.h:163
BOOLEAN PrivsChangeOneBit
Set to TRUE when the difference between Enabled and Present privileges is just one bit...
Definition: winprocess.h:351
void * UserCr3PageLockObject
The UserCR3 will be locked in memory, to prevent the OS from dynamically modifying the CR3 of a runni...
Definition: winprocess.h:241
uint8_t BYTE
Definition: intro_types.h:47
_WINPROC_GUEST_EXITS
Windows guest exit types.
Definition: winprocess.h:40
Describe the introcore protection options.
struct _WIN_PROCESS_OBJECT * PWIN_PROCESS_OBJECT
LIST_ENTRY Link
Entry within gWinProcesses (Doubly Linked List).
Definition: winprocess.h:85
const WCHAR * SystemDirPath
The location of the system directory (where the system DLLs are located). For wow64 processes...
Definition: winprocess.h:68
#define _In_
Definition: intro_sal.h:21
DWORD ProtInstrument
Protect the process agains instrumentation callback attacks.
Definition: winprocess.h:219
QWORD RealParentEprocess
The active EPROCESS at the moment of creation.
Definition: winprocess.h:92
INTSTATUS IntWinProcRemoveAllProtectedProcesses(void)
This function removed all the processes from the protected process list.
Definition: winprocess.c:3880
uint16_t WORD
Definition: intro_types.h:48
enum _WIN_SUBSYTEM_TYPE WIN_SUBSYTEM_TYPE
The Windows subsystem types.
CAMI_STRING_ENCODING
Describes the encoding of a string received from the CAMI file.
Definition: update_guests.h:52
void * ParamsSwapHandle
The swap memory handle for Process->Peb->ProcessParameters (used to read the command line of the proc...
Definition: winprocess.h:251
DWORD ProtCoreModules
Protect the core module loaded by the process.
Definition: winprocess.h:205
QWORD FeedbackMask
The protection mask in feedback mode.
Definition: winprocess.h:231
Exits caused by "MmCopyVirtualMemory".
Definition: winprocess.h:43
ACL Dacl
The Discretionary Access Control List header.
Definition: winprocess.h:368
INTSTATUS IntWinProcUnprotect(WIN_PROCESS_OBJECT *Process)
Remove a process from protection.
Definition: winprocess.c:3247
DWORD Lsass
TRUE if this is the lsass process.
Definition: winprocess.h:137
BOOLEAN LastExceptionContinuable
TRUE if the last exception is continuable (for example a #PF that was caused due to the way the OS do...
Definition: winprocess.h:184
INTSTATUS IntWinProcSwapOut(void *Detour)
Detour handler for the KiOutSwapProcess Windows kernel API.The detour on KiOutSwapProcess is set afte...
Definition: winprocess.c:4318
#define INTRO_SECURITY_DESCRIPTOR_SIZE
The size of the buffers in which we store the security descriptors. The security descriptor is compos...
Definition: intro_types.h:740
QWORD SecurityDescriptorGva
Security descriptor address.
Definition: winprocess.h:356
static BOOLEAN IntWinProcPolicyIsFeedback(const WIN_PROCESS_OBJECT *Process, QWORD Flag)
Checks if the given process is protected with the provided flag (in feedback mode).
Definition: winprocess.h:411
Definition: rbtree.h:34
DWORD ProtReserved1
RESERVED.
Definition: winprocess.h:204
INTSTATUS IntWinProcSwapIn(void *Detour)
Detour handler for the MmInSwapProcess Windows kernel API.The detour on MmInSwapProcess is set inside...
Definition: winprocess.c:4214
QWORD Context
Context from integrator if the process is protected, 0 otherwise.
Definition: winprocess.h:266
BOOLEAN FirstDominoJavaIgnored
TRUE if the first Domino Java execution VAD was ignored.
Definition: winprocess.h:195
Windows process subsystem.
Definition: winprocess.h:54
DWORD UnpackProtected
TRUE if the main module has been protected against unpacks.
Definition: winprocess.h:133
WORD OriginalSpareValue
We put in guest * and some flags in order to decide whether to raise a VM exit on a process...
Definition: winprocess.h:273
BYTE InjectionsCount
The number of injections allowed at the initialization.
Definition: winprocess.h:173
BYTE PebWrittenCount
The number writes to the (Process Environment Block).
Definition: winprocess.h:174
Exits caused by "NtQueueApcThreadEx".
Definition: winprocess.h:46
DWORD RawBufferSize
The used actual size of the RawBuffer.
Definition: winprocess.h:362
#define _Outptr_
Definition: intro_sal.h:19
INTSTATUS IntWinProcHandleTerminate(void *Detour)
This functions handles the termination of a Windows process.This function is invoked every time "MmCl...
Definition: winprocess.c:2682
INTSTATUS IntWinProcPrepareInstrument(QWORD FunctionAddress, void *Handler, void *Descriptor)
This function is responsible for patching the detour that handles "NtSetInformationProcess".
Definition: winprocess.c:4623
int INTSTATUS
The status data type.
Definition: introstatus.h:24
BOOLEAN ImageIsFromNativeSubsystem
TRUE if the process image is from the native subsystem.
Definition: winprocess.h:268
struct _WIN_PROCESS_OBJECT WIN_PROCESS_OBJECT
This structure describes a running process inside the guest.
DWORD OneTimeInjectionDone
The one time injection already took place (exception).
Definition: winprocess.h:153
struct _WIN_PROCESS_SUBSYSTEM * PWIN_PROCESS_SUBSYSTEM
DWORD NameHash
Name hash, as used by the exceptions module.
Definition: winprocess.h:101
ACL Sacl
The System Access Control List header.
Definition: winprocess.h:365
DWORD ProtectedModulesCount
Number of protected modules inside this process.
Definition: winprocess.h:61
QWORD Peb64Address
PEB 64 address (on x86 OSes, this will be 0).
Definition: winprocess.h:103
QWORD DebuggerEprocess
This will keep the EPROCESS of the debugger process (if any).
Definition: winprocess.h:284
void * UserSelfMapHook
The user self mapping memory hook.
Definition: winprocess.h:260
#define IMAGE_BASE_NAME_LEN
The maximum length of a process name.
Definition: winguest.h:15
BOOLEAN IntPolicyIsCoreOptionFeedback(QWORD Flag)
Checks if a core protection option is in feedback-only mode.
Definition: introcore.c:2829
QWORD MainModuleAddress
The address of the main module.
Definition: winprocess.h:106
BOOLEAN IsDominoJava
True if this is a Java IBM process and j9jit.dll is loaded.
Definition: winprocess.h:194
_WIN_SUBSYTEM_TYPE
The Windows subsystem types.
Definition: winprocess.h:30
QWORD ParentEprocess
The EPROCESS of the parent process.
Definition: winprocess.h:91
#define INTRO_OPT_PROT_UM_SYS_PROCS
Enable user-mode system processes protection (injection only).
Definition: intro_types.h:437
Process subsystem type 32 bit.
Definition: winprocess.h:34
INTSTATUS IntWinProcValidateSystemCr3(void)
This function checks if the system CR3 value was modified and if GUEST_STATE::KernelBetaDetections is...
Definition: winprocess.c:3371
DWORD Protected
TRUE if this is a protected process. If this is FALSE, most of the above fields aren't used at all...
Definition: winprocess.h:130
An access control list.
Definition: wddefs.h:637
Encapsulates a protected Windows process.
Definition: winguest.h:24
DWORD Wow64Process
TRUE if this is a 32 bit process on a 64 bit OS.
Definition: winprocess.h:125
DWORD InjectedApphelp
TRUE if AppHelp was injected.
Definition: winprocess.h:144
BOOLEAN IntPolicyCoreIsOptionBeta(QWORD Flag)
Checks if one of the kernel protection options is in log-only mode.
Definition: introcore.c:2603
const PROTECTED_PROCESS_INFO * IntWinProcGetProtectedInfoEx(PWCHAR Path, BOOLEAN IsSystem)
Returns a pointer to the PROTECTED_PROCESS_INFO structure for the given process Path.
Definition: winprocess.c:1070
static BOOLEAN IntWinProcPolicyIsBeta(const WIN_PROCESS_OBJECT *Process, QWORD Flag)
Checks if the given process is protected with the provided flag (in beta mode).
Definition: winprocess.h:391
DWORD LastPebWriteDone
TRUE if the write into PEB is done (used for initialization checks).
Definition: winprocess.h:143
QWORD NtdllBase
The base address for ntdll.dll.
Definition: winprocess.h:76
QWORD Cr3
Process PDBR. Includes PCID.
Definition: winprocess.h:98
DWORD MainModuleLoaded
TRUE if the main module has been loaded.
Definition: winprocess.h:132
BOOLEAN MainModuleLoaded
TRUE if the MainModule was loaded.
Definition: winprocess.h:72
QWORD OriginalPresentPrivs
Saved value of the Privileges Present bitfield inside the nt!_TOKEN structure assigned to the current...
Definition: winprocess.h:326
DWORD LateProtection
TRUE if the protection was not activated right from start.
Definition: winprocess.h:154
QWORD CreationTime
The creation time of the process, as stored inside the EPROCESS.
Definition: winprocess.h:95
INTSTATUS IntWinProcPatchCopyMemoryDetour(QWORD FunctionAddress, void *Handler, void *Descriptor)
This functions is responsible for patching the detour that handles the "MmCopyVirtualMemory".This function is invoked every time "MmCopyVirtualMemory" is called (a process is writing/reading another process) but before the actual handler IntWinProcHandleCopyMemory, its purpose being to modify the hook code (see winhkhnd.c).
Definition: winprocess.c:2746
BOOLEAN ParentHasEditedAcl
The parent process has an altered ACL (SACL/DACL).
Definition: winprocess.h:301
static QWORD IntWinProcGetProtOption(const WIN_PROCESS_OBJECT *Process)
Get the protection type for the given process.
Definition: winprocess.h:375
WINUM_PATH * Path
Will point inside the loaded modules list to the full process path.
Definition: winprocess.h:111
void IntWinProcDumpProtected(void)
Log all the protected processes.
Definition: winprocess.c:3912
INTSTATUS IntWinProcAddProtectedProcess(const WCHAR *Path, DWORD ProtectionMask, QWORD Context)
This function adds the provided process to the protected process list.
Definition: winprocess.c:3712
uint8_t * PBYTE
Definition: intro_types.h:47
DWORD IsPreviousAgent
TRUE if this is an agent injected in a previous session.
Definition: winprocess.h:164
DWORD ProtDoubleAgent
Protect the process against double agent attacks.
Definition: winprocess.h:217
RBNODE NodeEproc
Entry within gWinProcTreeEprocess (RB Tree).
Definition: winprocess.h:88
#define INTRO_OPT_PROT_UM_MISC_PROCS
Definition: intro_types.h:435
unsigned long long QWORD
Definition: intro_types.h:53
Exits caused by "NtSetInformationProcess".
Definition: winprocess.h:47
DWORD LoadedModulesCount
The number of modules that were loaded.
Definition: winprocess.h:62
BOOLEAN HasNaClEnabled
Only valid for chromium-based browsers; TRUE if this is a NaCl process.
Definition: winprocess.h:187
QWORD UserCr3
Process user PDBR. Includes PCID.
Definition: winprocess.h:99
DWORD Terminating
TRUE if the process is terminating (cleanup pending).
Definition: winprocess.h:126
BYTE NtdllLoadCount
Number of ntdll.dll loads.
Definition: winprocess.h:73
void * TokenSwapHook
Hook object for notifications over the swap-in/swap-out of the current process TOKEN. We need to place this hook in order to verify on translation modifications of the current TOKEN if it is still assigned to the current process. The token might get deallocated in the mean-time and the page can be used, for example, for mapping other physical pages, thus leading to translation violations when the hashes of the contents are checked. For this purpose we will verify on every translation modification event if the current token is still used, and re-establish the hook over the token if it was previously de-allocated.
Definition: winprocess.h:322
DWORD StartInitializing
TRUE if the process actually started initializing (there is a time windows from the moment we add the...
Definition: winprocess.h:151
DWORD ProtectionMask
Protection mask: tells us what level of protection will be activated for this process.
Definition: winprocess.h:200
BOOLEAN ParentThreadSuspicious
The parent thread start address was considered suspicious.
Definition: winprocess.h:295
QWORD LastExceptionRip
The RIP of the last exception that took place.
Definition: winprocess.h:180
DWORD ExitStatus
The exit status of the process (used when sending the process terminated event).
Definition: winprocess.h:192
DWORD Peb64ContextWritten
TURE if the Process Environment Block (x64) context was written (valid only on Windows 7)...
Definition: winprocess.h:160
DPI_EXTRA_INFO DpiExtraInfo
Represents the gathered extra info while checking the DPI heuristics.
Definition: winprocess.h:304
INTSTATUS IntWinProcPatchSwapOut64(QWORD FunctionAddress, void *Handler, void *Descriptor)
This functions is responsible for patching the detour that handles the "KiOutSwapProcesses".
Definition: winprocess.c:2387
Exits caused by "MiCommitExistingVad".
Definition: winprocess.h:42
INTSTATUS IntWinProcGetObjectByPid(DWORD Pid, WIN_PROCESS_OBJECT **Process)
This function looks for a process with the given PID inside gWinProcesses and returns its WIN_PROCESS...
Definition: winprocess.c:4003
struct _WIN_PROCESS_OBJECT * Process
The process object related to this subsystem.
Definition: winprocess.h:56
Exposes the definitions used by the CAMI parser and the functions used to load guest support informat...
void * TokenHook
Hook object for the ept hook over nt!_TOKEN Privileges field.
Definition: winprocess.h:314
QWORD SelfMapEntryValue
The self mapping memory entry value.
Definition: winprocess.h:262
char * PCHAR
Definition: intro_types.h:56
QWORD BetaMask
The protection mask in beta mode.
Definition: winprocess.h:230
BYTE Kernel32LoadCount
Number of kernel32.dll loads.
Definition: winprocess.h:74
INTSTATUS IntWinProcCreateProcessObject(WIN_PROCESS_OBJECT **Process, QWORD EprocessAddress, PBYTE EprocessBuffer, QWORD ParentEprocess, QWORD RealParentEprocess, QWORD Cr3, DWORD Pid, BOOLEAN StaticScan)
Allocates a WIN_PROCESS_OBJECT structure for the given process.
Definition: winprocess.c:1544
DWORD Pid
Process ID (the one used by Windows).
Definition: winprocess.h:100
Process subsystem type 64 bit.
Definition: winprocess.h:33
QWORD TokenStolenFromEprocess
This will keep the EPROCESS of the process from which the current process stole the token...
Definition: winprocess.h:287
RBTREE VadTree
RB-Tree of process VADs.
Definition: winprocess.h:243
DWORD InjectedAppHelpSize
The size of the injected apphelp (during initialization).
Definition: winprocess.h:177
DWORD BetaDetections
TRUE if BETA is enabled for this particular process.
Definition: winprocess.h:135
INTSTATUS IntWinProcChangeProtectionFlags(WIN_PROCESS_OBJECT *Process, DWORD OldMask, DWORD NewMask)
This function changes the protection flags for the given process.
Definition: winprocess.c:4046
void * SelfMapHook
The self mapping memory hook.
Definition: winprocess.h:259
#define __forceinline
Definition: introtypes.h:61
uint16_t WCHAR
Definition: intro_types.h:63
QWORD Peb32Address
PEB 32 address (on pure x64 processes, this will be 0).
Definition: winprocess.h:104
uint32_t DWORD
Definition: intro_types.h:49
void IntWinProcUninit(void)
This function removes all process objects from the list, and registers the calls the cleanup function...
Definition: winprocess.c:3940
QWORD OriginalTokenPtr
Original Token pointer inside EPROCESS (should never change).
Definition: winprocess.h:247
enum _WINPROC_GUEST_EXITS WINPROC_GUEST_EXITS
Windows guest exit types.
BOOLEAN PrivsChangeDetected
Set to TRUE when a token privilege change has been detected. This is useful for DPI, in the case where a write has been detected over the privileges, but because of the detect only mechanism, we have overwritten the OriginalPresentPrivs and OriginalEnabledPrivs values, thus DPI will not raise an alert on process creation due to the fact that the mechanism doesn't see any change. For this purpose, we'll analyze every process creation in DPI from the moment the privileges have changed and a detection took place on integrity.
Definition: winprocess.h:342
Definition: rbtree.h:84
INTSTATUS IntWinProcPatchSwapOut32(QWORD FunctionAddress, void *Handler, void *Descriptor)
This functions is responsible for patching the detour that handles the "KiOutSwapProcesses".
Definition: winprocess.c:2443
void * Cr3PageLockObject
The CR3 will be locked in memory, to prevent the OS from dynamically modifying the CR3 of a running p...
Definition: winprocess.h:237
LIST_HEAD ProcessModules
List of process modules.
Definition: winprocess.h:70
RBNODE NodeUserCr3
Entry within gWinProcTreeUserCr3 (RB Tree).
Definition: winprocess.h:87
QWORD UserSelfMapEntryValue
The user self mapping memory entry value.
Definition: winprocess.h:263
void * CmdBufSwapHandle
The swap memory handle for the command line buffer.
Definition: winprocess.h:257
DWORD ExploitGuardEnabled
TRUE if any Exploit Guard mitigation option is set for this process.
Definition: winprocess.h:167
INTSTATUS IntWinProcHandleCopyMemory(void *Detour)
This functions is responsible handling process read/write operations.This function is invoked every t...
Definition: winprocess.c:2870
DWORD ProtWriteMem
Protect the the memory against writes.
Definition: winprocess.h:207
QWORD EprocessAddress
This will be the address of the ActiveProcess field.
Definition: winprocess.h:90
BOOLEAN SkipPrivsNextCheck
Signals whether the next privileges check on integrity should be skipped for the current process...
Definition: winprocess.h:334
QWORD OriginalEnabledPrivs
Saved value of the Privileges Enabled bitfield inside the nt!_TOKEN structure assigned to the current...
Definition: winprocess.h:330
void IntWinProcUpdateProtectedProcess(const void *Name, const CAMI_STRING_ENCODING Encoding, const CAMI_PROT_OPTIONS *Options)
This function updates the protection for the given process.
Definition: winprocess.c:3657
DWORD ParentWow64
TRUE if the parent is a 32 bit process on a 64 bit OS.
Definition: winprocess.h:146
DWORD SystemProcess
TRUE if this is a system process.
Definition: winprocess.h:136
INTSTATUS IntWinProcUpdateProtection(void)
Iterates trough the global process list (gWinProcesses) in order to update the protection state for e...
Definition: winprocess.c:1162
DWORD ProtScanCmdLine
Scan the cmd line of the process.
Definition: winprocess.h:218
void * CmdLineSwapHandle
The swap memory handle for the UNICODE_STRING containing the command line of the a process...
Definition: winprocess.h:255
INTSTATUS IntWinProcHandleCreate(void *Detour)
Detour handler for the PspInsertProcess Windows kernel API.The actual process creation is handled by ...
Definition: winprocess.c:2610
WIN_SUBSYTEM_TYPE SubsystemType
Process subsystem type.
Definition: winprocess.h:57
QWORD PebAddress
The Process Environment Block of this subsystem.
Definition: winprocess.h:59
INTSTATUS IntWinProcProtect(WIN_PROCESS_OBJECT *Process)
Protects a new process.
Definition: winprocess.c:3287
DWORD MonitorVad
TRUE if we need to handle VAD events for this process.
Definition: winprocess.h:162
DWORD StaticDetected
TRUE if the process was detected using a static scan (during static init).
Definition: winprocess.h:140
void * VasMonRoot
Virtual Address Space monitor root.
Definition: winprocess.h:244
DWORD LastException
The code of the last exception that took place.
Definition: winprocess.h:179
struct _WIN_PROCESS_SUBSYSTEM WIN_PROCESS_SUBSYSTEM
Windows process subsystem.
DWORD ProtUnpack
Protect process against unpacking attempts.
Definition: winprocess.h:206
BOOLEAN IsVerifierLoaded
TRUE if app verifier is loaded.
Definition: winprocess.h:269
DWORD IsAgent
TRUE if this is an injected agent.
Definition: winprocess.h:131
DWORD Outswapped
TRUE if the process is outswapped.
Definition: winprocess.h:169
INTSTATUS IntWinProcReadCommandLine(WIN_PROCESS_OBJECT *Process)
Reads the command line of the given process using IntSwapMemReadData.
Definition: winprocess.c:900
BOOLEAN ParentHasAlteredSecDescPtr
The parent process has an altered security descriptor pointer.
Definition: winprocess.h:298
Exits caused by "MmCopyVirtualMemory".
Definition: winprocess.h:44
Exits caused by "PspSetContextThreadInternal".
Definition: winprocess.h:45
DWORD ProtWsockModules
Protect the Windows Socket related modules.
Definition: winprocess.h:208
BOOLEAN ParentHasBeenHeapSprayed
The parent process has been heap sprayed.
Definition: winprocess.h:289
char CHAR
Definition: intro_types.h:56
void * MainModuleVad
Used for keeping the main module VAD (used for dereferencing paths) as the unprotected processes don'...
Definition: winprocess.h:277
PWIN_PROCESS_SUBSYSTEM Subsystemx86
The x86 subsystem. Note that a 32 bit process on a 64 bit OS may have both subsystems valid...
Definition: winprocess.h:308
RBNODE NodeCr3
Entry within gWinProcTreeCr3 (RB Tree).
Definition: winprocess.h:86
Exposes the functions responsible for DPI (Deep Process Inspection) information gathering (used to de...
DWORD AgentTag
If IsAgent is TRUE, this will be the agent tag.
Definition: winprocess.h:233
QWORD InjectedApphelpAddress
The address of the injected apphelp (during initialization).
Definition: winprocess.h:176
BOOLEAN ParentHasPivotedStack
The parent process has a pivoted stack.
Definition: winprocess.h:281
DWORD Peb32ContextWritten
TURE if the Process Environment Block (x86) context was written (valid only on Windows 7)...
Definition: winprocess.h:157
BOOLEAN ParentHasTokenPrivsAltered
The parent process has the token privileges altered in a malicious way, most probably due to a privil...
Definition: winprocess.h:293
INTSTATUS IntWinProcRemoveProtectedProcess(const WCHAR *Path)
This function removed the provided process from the protected process list.
Definition: winprocess.c:3826
LIST_HEAD * VadPages
Vad pages Hash-Table.
Definition: winprocess.h:245
This structure describes a running process inside the guest.
Definition: winprocess.h:83