83 #define MSR_LBR_0_FROM_IP 0x00000680 84 #define MSR_LBR_1_FROM_IP 0x00000681 85 #define MSR_LBR_2_FROM_IP 0x00000682 86 #define MSR_LBR_3_FROM_IP 0x00000683 87 #define MSR_LBR_4_FROM_IP 0x00000684 88 #define MSR_LBR_5_FROM_IP 0x00000685 89 #define MSR_LBR_6_FROM_IP 0x00000686 90 #define MSR_LBR_7_FROM_IP 0x00000687 91 #define MSR_LBR_8_FROM_IP 0x00000688 92 #define MSR_LBR_9_FROM_IP 0x00000689 93 #define MSR_LBR_A_FROM_IP 0x0000068A 94 #define MSR_LBR_B_FROM_IP 0x0000068B 95 #define MSR_LBR_C_FROM_IP 0x0000068C 96 #define MSR_LBR_D_FROM_IP 0x0000068D 97 #define MSR_LBR_E_FROM_IP 0x0000068E 98 #define MSR_LBR_F_FROM_IP 0x0000068F 100 #define MSR_LBR_0_TO_IP 0x000006C0 101 #define MSR_LBR_1_TO_IP 0x000006C1 102 #define MSR_LBR_2_TO_IP 0x000006C2 103 #define MSR_LBR_3_TO_IP 0x000006C3 104 #define MSR_LBR_4_TO_IP 0x000006C4 105 #define MSR_LBR_5_TO_IP 0x000006C5 106 #define MSR_LBR_6_TO_IP 0x000006C6 107 #define MSR_LBR_7_TO_IP 0x000006C7 108 #define MSR_LBR_8_TO_IP 0x000006C8 109 #define MSR_LBR_9_TO_IP 0x000006C9 110 #define MSR_LBR_A_TO_IP 0x000006CA 111 #define MSR_LBR_B_TO_IP 0x000006CB 112 #define MSR_LBR_C_TO_IP 0x000006CC 113 #define MSR_LBR_D_TO_IP 0x000006CD 114 #define MSR_LBR_E_TO_IP 0x000006CE 115 #define MSR_LBR_F_TO_IP 0x000006CF 117 #define MSR_LER_FROM_IP 0x000001DD 118 #define MSR_LER_TO_IP 0x000001DE 120 #define LBR_STACK_SIZE 16 286 #define IntFreeXsaveArea(xa) HpFreeAndNullWithTag(&(xa).XsaveArea, IC_TAG_XSAVE) 317 #endif // _INTRO_CPU_H_ struct _SEGMENT_DESCRIPTOR32 SEGMENT_DESCRIPTOR32
Segment descriptor for 32-bit systems.
INTSTATUS IntIdtFindBase(DWORD CpuNumber, QWORD *Base, WORD *Limit)
Returns the IDT base and limit for a guest CPU.
Describes an XSAVE area format.
INTSTATUS IntGetXcr0(DWORD CpuNumber, QWORD *Xcr0Value)
Get the value of the guest XCR0 register.
Segment descriptor for 32-bit systems.
INTSTATUS IntIdtGetEntry(DWORD CpuNumber, DWORD Entry, QWORD *Handler)
Get the handler of an interrupt from the IDT.
INTSTATUS IntFsRead(DWORD CpuNumber, QWORD *FsValue)
Reads the IA32_FS_BASE guest MSR.
INTSTATUS IntGetGprs(DWORD CpuNumber, PIG_ARCH_REGS Regs)
Get the current guest GPR state.
DWORD IntGetCurrentCpu(void)
Returns the current CPU number.
INTSTATUS IntLbrRead(DWORD BuffersSize, QWORD *LbrFrom, QWORD *LbrTo)
Holds segment register state.
int INTSTATUS
The status data type.
INTSTATUS IntGetMaxGpfn(QWORD *MaxGpfn)
Get the last physical page frame number accessible by the guest.
INTSTATUS IntRipRead(DWORD CpuNumber, QWORD *Rip)
Reads the value of the guest RIP.
INTSTATUS IntGetAllRegisters(DWORD CpuNumber, PIG_ARCH_REGS Regs)
Returns the entire guest register state. This will return the GPRs, control registers, and IDT and GDT base and limit. This also bypasses the cache used by IntGetGprs.
#define _Out_writes_(expr)
INTSTATUS IntGetCurrentMode(DWORD CpuNumber, DWORD *Mode)
Read the current CS type.
union _INTERRUPT_GATE32 INTERRUPT_GATE32
An 32-bit interrupt gate as defined by the Intel docs.
INTSTATUS IntFindKernelPcr(DWORD CpuNumber, QWORD *Pcr)
Finds the address of the Windows kernel _KPCR.
INTSTATUS IntSysenterRead(DWORD CpuNumber, QWORD *SysCs, QWORD *SysEip, QWORD *SysEsp)
Queries the IA32_SYSENTER_CS, IA32_SYSENTER_EIP, and IA32_SYSENTER_ESP guest MSRs.
An 32-bit interrupt gate as defined by the Intel docs.
INTSTATUS IntCr0Read(DWORD CpuNumber, QWORD *Cr0Value)
Reads the value of the guest CR0.
INTSTATUS IntDebugCtlRead(DWORD CpuNumber, QWORD *DebugCtl)
Queries the IA32_DEBUGCTL guest MSR.
INTSTATUS IntGsRead(DWORD CpuNumber, QWORD *GsValue)
Reads the IA32_GS_BASE guest MSR.
An 64-bit interrupt gate as defined by the Intel docs.
A descriptor table register. Valid for IDTR and GDTR.
INTSTATUS IntSetXsaveArea(DWORD CpuNumber, XSAVE_AREA *XsaveArea)
Sets the contents of the guest XSAVE area.
INTSTATUS IntGetXsaveAreaSize(DWORD *Size)
Get the size of the guest XSAVE area on the current CPU.
INTSTATUS IntCr8Read(DWORD CpuNumber, QWORD *Cr8Value)
Reads the value of the guest CR8.
INTSTATUS IntSyscallRead(DWORD CpuNumber, QWORD *SysStar, QWORD *SysLstar)
Queries the IA32_STAR, and IA32_LSTAR guest MSRs.
union _INTERRUPT_GATE INTERRUPT_GATE
An 64-bit interrupt gate as defined by the Intel docs.
DWORD Size
The size of the XSAVE area. XsaveArea has at least Size bytes.
INTSTATUS IntSetGprs(DWORD CpuNumber, PIG_ARCH_REGS Regs)
Sets the values of the guest GPRs.
INTSTATUS IntLerRead(QWORD *LerFrom, QWORD *LerTo)
union _INTERRUPT_GATE * PINTERRUPT_GATE
union _INTERRUPT_GATE32 * PINTERRUPT_GATE32
INTSTATUS IntCr3Read(DWORD CpuNumber, QWORD *Cr3Value)
Reads the value of the guest CR3.
INTSTATUS IntCr4Read(DWORD CpuNumber, QWORD *Cr4Value)
Reads the value of the guest CR4.
struct _DTR DTR
A descriptor table register. Valid for IDTR and GDTR.
IG_XSAVE_AREA * XsaveArea
The contents of the XSAVE area.
INTSTATUS IntGdtFindBase(DWORD CpuNumber, QWORD *GdtBase, WORD *GdtLimit)
Returns the GDT base and limit for a guest CPU.
INTSTATUS IntGetSegs(DWORD CpuNumber, PIG_SEG_REGS Regs)
Read the guest segment registers.
INTSTATUS IntGetCurrentEptIndex(DWORD CpuNumber, DWORD *EptpIndex)
Get the EPTP index of the currently loaded EPT.
INTSTATUS IntGetCurrentRing(DWORD CpuNumber, DWORD *Ring)
Read the current protection level.
struct _SEGMENT_DESCRIPTOR32 * PSEGMENT_DESCRIPTOR32
INTSTATUS IntEferRead(QWORD CpuNumber, QWORD *Efer)
Reads the value of the guest IA32 EFER MSR.
INTSTATUS IntGetXsaveArea(DWORD CpuNumber, XSAVE_AREA *XsaveArea)
Get the contents of the guest XSAVE area.
struct _XSAVE_AREA XSAVE_AREA
XSAVE area container.