89 WARNING(
"[WARNING] Unknown power action/reason: %d %d!\n", GuestPowerAction, GuestPowerState);
128 *RequestedPowerAction = buffer[0];
129 *RequestedPowerState = buffer[1];
149 BYTE hkbuff[4] = { 0xf3, 0x90, 0xeb, 0xfc };
151 LOG(
"[POW-SPIN-WAIT] IntWinPowEnableSpinWait called!\n");
160 ERROR(
"[ERROR] IntDetModifyPublicData failed: 0x%08x\n", status);
180 BYTE nopbuff[4] = { 0x66, 0x90, 0x66, 0x90 };
182 LOG(
"[POW-SPIN-WAIT] IntWinPowDisableSpinWait called!\n");
191 ERROR(
"[ERROR] IntDetModifyPublicData failed: 0x%08x\n", status);
229 LOG(
"Removing the PT Filter due to power state change...\n");
234 LOG(
"Removing the #VE Agent due to power state change...\n");
240 ERROR(
"[ERROR] IntPtiRemovePtFilter/IntVeRemoveAgent failed: 0x%08x (options: %016llx)\n",
249 ERROR(
"[ERROR] IntWinPowEnableSpinWait failed: 0x%08x\n", status);
288 DWORD requestedPowerState;
289 DWORD requestedPowerAction;
297 ERROR(
"[ERROR] We could not get the requested power state!");
301 LOG(
"[POWER-STATE] Entering power state %d, action %d\n", requestedPowerState, requestedPowerAction);
314 ERROR(
"[ERROR] IntWinPowHandleEventCommon failed: 0x%08x\n", status);
317 LOG(
"[POWER-STATE] Internal power state: %d\n", internalPowerState);
319 switch (internalPowerState)
337 ERROR(
"[ERROR] Power state %d requested, but we don't have any callback for it!\n", requestedPowerState);
INTSTATUS IntWinPowHandlePowerStateChange(void *Detour)
Detour callback which is called whenever NtSetSystemPowerState is called, resulting in a hypercall to...
#define INTRO_OPT_VE
Enable the Virtualization exception page table access pre-filtering agent (64-bit Windows only)...
INTSTATUS IntWinPowEnableSpinWait(void)
This function is called in order to re-enable spin waiting in the handler after it was previously dis...
IG_ARCH_REGS Regs
The current state of the guest registers.
#define INT_STATUS_SUCCESS
static INTRO_POWER_STATE IntWinPowFromGuestToIntroPowState(DWORD GuestPowerAction, DWORD GuestPowerState)
Converts in-guest parameters given to NtSetSystemPowerState to an internal introspection used power s...
INTSTATUS IntWinPowDisableSpinWait(void)
This function is called in order to disable spin waiting after everything we needed to be unloaded wa...
#define INT_SUCCESS(Status)
INTSTATUS IntResumeVcpus(void)
Resumes the VCPUs previously paused with IntPauseVcpus.
The guest is about to enter hibernate (S4).
#define INT_STATUS_NOT_NEEDED_HINT
int INTSTATUS
The status data type.
#define INT_STATUS_NOT_FOUND
The guest is about to enter a sleep state (S1, S2, S3).
INTSTATUS IntPauseVcpus(void)
Pauses all the guest VCPUs.
#define AG_OPT_INJECT_ON_RIP_POWSTATE_CHANGE
static INTSTATUS IntWinPowGetRequestedPowerState(DWORD *RequestedPowerAction, DWORD *RequestedPowerState)
Gets the parameters of NtSetSystemPowerState depending on OS architecture.
INTSTATUS IntDetModifyPublicData(DETOUR_TAG Tag, void const *Data, DWORD DataSize, char const *PublicDataName)
Modifies public parts of a detour handler.
BOOLEAN Guest64
True if this is a 64-bit guest, False if it is a 32-bit guest.
QWORD Current
The currently used options.
INTSTATUS IntVeRemoveAgent(DWORD AgOpts)
Removes the VE agent from guest memory.
The state is not among the known combinations or it is unused by the introspection engine...
static void IntWinPowHandleHibernateEvent(void)
Callback called when the change of guest power state to hibernate occurs.
#define UNREFERENCED_PARAMETER(P)
The guest is about to reboot.
enum _INTRO_POWER_STATE INTRO_POWER_STATE
Detected guest power states.
BOOLEAN EnterHibernate
True if the guest is entering into hibernate.
GUEST_STATE gGuest
The current guest state.
INTSTATUS IntKernVirtMemRead(QWORD KernelGva, DWORD Length, void *Buffer, DWORD *RetLength)
Reads data from a guest kernel virtual memory range.
static INTSTATUS IntWinPowHandleEventCommon(INTRO_POWER_STATE PowerState)
This function will be called on any power state change event. Everything that we want to uninit on ev...
INTSTATUS IntPtiRemovePtFilter(DWORD AgOpts)
Removes the PT filter.
VCPU_STATE * gVcpu
The state of the current VCPU.
void IntGuestUpdateCoreOptions(QWORD NewOptions)
Updates Introcore options.
#define INTRO_OPT_IN_GUEST_PT_FILTER
Enable in-guest page-table filtering (64-bit Windows only).
INTRO_PROT_OPTIONS CoreOptions
The activation and protection options for this guest.