VM-Exit handler for different exit reasons.
494{
496 PLIST_ENTRY TempList = 0;
497 PCHAR CurrentProcessName = 0;
500 HANDLE CurrentThreadId;
503
504
505
506
507 CurrrentTime = __rdtscp(&Aux);
508
509
510
511
513
514
515
516
519
520
521
522
525 {
526 TempList = TempList->Flink;
529 {
530
531
532
533 if (ProcessDetails->
ProcessId == CurrentProcessId)
534 {
535
536
537
538 IsProcessOnTransparencyList =
TRUE;
539 break;
540 }
541 }
542 else
543 {
544
545
546
548 {
549
550
551
552 IsProcessOnTransparencyList =
TRUE;
553 break;
554 }
555 }
556 }
557
558
559
560
561 if (!IsProcessOnTransparencyList)
562 {
563
564
565
567 }
568
569
570
571
572 CurrentThreadId = PsGetCurrentThreadId();
573
574
575
576
578 {
579
580
581
585 }
586
587
588
589
590
591 if (ExitReason == VMX_EXIT_REASON_EXECUTE_RDTSC || ExitReason == VMX_EXIT_REASON_EXECUTE_RDTSCP)
592 {
594 {
595
596
597
598
600 }
602 {
603
604
605
606
607
608
609 }
612 {
613
614
615
619 ;
620 }
621
622
623
624
625 VCpu->
Regs->
rax = 0x00000000ffffffff &
627
628 VCpu->
Regs->
rdx = 0x00000000ffffffff &
630
631
632
633
634 if (ExitReason == VMX_EXIT_REASON_EXECUTE_RDTSCP)
635 {
636 VCpu->
Regs->
rcx = 0x00000000ffffffff & Aux;
637 }
638
639
640
642 }
643 else if (ExitReason == VMX_EXIT_REASON_EXECUTE_CPUID &&
645 {
646
647
648
649
650
654
656 }
657
658 return Result;
659}
UCHAR BOOLEAN
Definition BasicTypes.h:39
#define NULL64_ZERO
Definition BasicTypes.h:52
#define TRUE
Definition BasicTypes.h:55
#define FALSE
Definition BasicTypes.h:54
unsigned __int64 UINT64
Definition BasicTypes.h:21
unsigned int UINT32
Definition BasicTypes.h:48
TRANSPARENCY_MEASUREMENTS * g_TransparentModeMeasurements
holds the measurements from the user-mode and kernel-mode
Definition GlobalVariables.h:56
int TransparentRandn(int Average, int Sigma)
Integer Gaussian Random Number Generator(GRNG) based on Box-Muller method. A Float to Integer mapping...
Definition Transparency.c:232
BOOLEAN CommonIsStringStartsWith(const char *pre, const char *str)
Detects whether the string starts with another string.
Definition Common.c:69
PCHAR CommonGetProcessNameFromProcessControlBlock(PEPROCESS Eprocess)
Get process name by eprocess.
Definition Common.c:48
UINT64 CpuidStandardDeviation
Definition Transparency.h:48
UINT64 CpuidAverage
Definition Transparency.h:47
LIST_ENTRY ProcessList
Definition Transparency.h:55
The ProcessList of TRANSPARENCY_MEASUREMENTS is from this architecture.
Definition Transparency.h:64
UINT32 ProcessId
Definition Transparency.h:65
BOOLEAN TrueIfProcessIdAndFalseIfProcessName
Definition Transparency.h:68
PVOID ProcessName
Definition Transparency.h:66
GUEST_REGS * Regs
Definition State.h:305
VM_EXIT_TRANSPARENCY TransparencyState
Definition State.h:330
UINT64 RevealedTimeStampCounterByRdtsc
Definition State.h:141
UINT64 PreviousTimeStampCounter
Definition State.h:138
HANDLE ThreadId
Definition State.h:140
BOOLEAN CpuidAfterRdtscDetected
Definition State.h:142
UINT64 rax
Definition BasicTypes.h:75
UINT64 rcx
Definition BasicTypes.h:76
UINT64 rdx
Definition BasicTypes.h:77