HyperDbg Debugger
|
Hook headers. More...
Go to the source code of this file.
Classes | |
struct | _SSDTStruct |
SSDT structure. More... | |
struct | _HIDDEN_HOOKS_DETOUR_DETAILS |
Details of detours style EPT hooks. More... | |
struct | _SYSTEM_MODULE_ENTRY |
Module entry. More... | |
struct | _SYSTEM_MODULE_INFORMATION |
System Information for modules. More... | |
Macros | |
#define | IS_SYSRET_INSTRUCTION(Code) |
As we have just on sysret in all the Windows, we use the following variable to hold its address this way, we're not force to check for the instruction so we remove the memory access to check for sysret in this case. | |
#define | IS_SYSCALL_INSTRUCTION(Code) |
#define | IMAGE_DOS_SIGNATURE 0x5A4D |
Special signatures. | |
#define | IMAGE_OS2_SIGNATURE 0x454E |
#define | IMAGE_OS2_SIGNATURE_LE 0x454C |
#define | IMAGE_VXD_SIGNATURE 0x454C |
#define | IMAGE_NT_SIGNATURE 0x00004550 |
#define | MAX_EXEC_TRAMPOLINE_SIZE 100 |
Maximum number of supported execution trampoline. | |
Typedefs | |
typedef struct _SSDTStruct | SSDTStruct |
SSDT structure. | |
typedef struct _SSDTStruct * | PSSDTStruct |
typedef struct _HIDDEN_HOOKS_DETOUR_DETAILS | HIDDEN_HOOKS_DETOUR_DETAILS |
Details of detours style EPT hooks. | |
typedef struct _HIDDEN_HOOKS_DETOUR_DETAILS * | PHIDDEN_HOOKS_DETOUR_DETAILS |
typedef struct _SYSTEM_MODULE_ENTRY | SYSTEM_MODULE_ENTRY |
Module entry. | |
typedef struct _SYSTEM_MODULE_ENTRY * | PSYSTEM_MODULE_ENTRY |
typedef struct _SYSTEM_MODULE_INFORMATION | SYSTEM_MODULE_INFORMATION |
System Information for modules. | |
typedef struct _SYSTEM_MODULE_INFORMATION * | PSYSTEM_MODULE_INFORMATION |
typedef enum _SYSTEM_INFORMATION_CLASS | SYSTEM_INFORMATION_CLASS |
System information class. | |
typedef enum _SYSTEM_INFORMATION_CLASS * | PSYSTEM_INFORMATION_CLASS |
typedef NTSTATUS(NTAPI * | ZWQUERYSYSTEMINFORMATION) (IN SYSTEM_INFORMATION_CLASS SystemInformationClass, OUT PVOID SystemInformation, IN ULONG SystemInformationLength, OUT PULONG ReturnLength OPTIONAL) |
Enumerations | |
enum | _SYSTEM_INFORMATION_CLASS { SystemModuleInformation = 11 , SystemKernelDebuggerInformation = 35 } |
System information class. More... | |
Functions | |
VOID | SyscallHookTest () |
Make examples for testing hidden hooks. | |
VOID | SyscallHookConfigureEFER (VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN EnableEFERSyscallHook) |
This function enables or disables EFER syscall hoo. | |
BOOLEAN | SyscallHookHandleUD (_Inout_ VIRTUAL_MACHINE_STATE *VCpu) |
BOOLEAN | SyscallHookEmulateSYSRET (_Inout_ VIRTUAL_MACHINE_STATE *VCpu) |
BOOLEAN | SyscallHookEmulateSYSCALL (_Inout_ VIRTUAL_MACHINE_STATE *VCpu) |
BOOLEAN | EptHookPerformPageHook (VIRTUAL_MACHINE_STATE *VCpu, PVOID TargetAddress, CR3_TYPE ProcessCr3) |
Hook in VMX Root Mode with hidden breakpoints (A pre-allocated buffer should be available) | |
BOOLEAN | EptHookPerformPageHookMonitorAndInlineHook (VIRTUAL_MACHINE_STATE *VCpu, PVOID HookingDetails, CR3_TYPE ProcessCr3, UINT32 PageHookMask) |
Hook in VMX Root Mode with hidden detours and monitor (A pre-allocated buffer should be available) | |
BOOLEAN | EptHook (PVOID TargetAddress, UINT32 ProcessId) |
Hook in VMX non-root Mode (hidden breakpoint) | |
BOOLEAN | EptHookFromVmxRoot (PVOID TargetAddress) |
This function invokes a direct VMCALL to setup the hook. | |
BOOLEAN | EptHookInlineHook (VIRTUAL_MACHINE_STATE *VCpu, PVOID TargetAddress, PVOID HookFunction, UINT32 ProcessId) |
Hook in VMX non-root mode (hidden detours) | |
BOOLEAN | EptHookMonitorHook (VIRTUAL_MACHINE_STATE *VCpu, EPT_HOOKS_ADDRESS_DETAILS_FOR_MEMORY_MONITOR *HookingDetails, UINT32 ProcessId) |
This function applies monitor hooks to the target EPT table. | |
BOOLEAN | EptHookInlineHookFromVmxRoot (VIRTUAL_MACHINE_STATE *VCpu, PVOID TargetAddress, PVOID HookFunction) |
Hook in VMX root-mode (hidden detours) | |
BOOLEAN | EptHookMonitorFromVmxRoot (VIRTUAL_MACHINE_STATE *VCpu, EPT_HOOKS_ADDRESS_DETAILS_FOR_MEMORY_MONITOR *MemoryAddressDetails) |
This function applies EPT monitor hooks to the target EPT table. | |
BOOLEAN | EptHookHandleHookedPage (VIRTUAL_MACHINE_STATE *VCpu, EPT_HOOKED_PAGE_DETAIL *HookedEntryDetails, VMX_EXIT_QUALIFICATION_EPT_VIOLATION ViolationQualification, SIZE_T PhysicalAddress, EPT_HOOKS_CONTEXT *LastContext, BOOLEAN *IgnoreReadOrWriteOrExec, BOOLEAN *IsExecViolation) |
Handle hooked pages in Vmx-root mode. | |
BOOLEAN | EptHookRestoreSingleHookToOriginalEntry (VIRTUAL_MACHINE_STATE *VCpu, SIZE_T PhysicalAddress, UINT64 OriginalEntry) |
Remove a special hook from the hooked pages lists. | |
VOID | EptHookRestoreAllHooksToOriginalEntry (VIRTUAL_MACHINE_STATE *VCpu) |
Remove all hooks from the hooked pages lists (Should be called in vmx-root) | |
VOID | EptHookUnHookAll () |
Remove all hooks from the hooked pages lists. | |
BOOLEAN | EptHookUnHookAllByHookingTag (UINT64 HookingTag) |
Remove all hooks from the hooked pages by the given hooking tag. | |
BOOLEAN | EptHookUnHookSingleAddress (UINT64 VirtualAddress, UINT64 PhysAddress, UINT32 ProcessId) |
Remove single hook from the hooked pages list and invalidate TLB From VMX non-root mode. | |
BOOLEAN | EptHookUnHookSingleHookByHookingTagFromVmxRoot (UINT64 HookingTag, EPT_SINGLE_HOOK_UNHOOKING_DETAILS *TargetUnhookingDetails) |
Remove single hook from the hooked pages by the given hooking tag. | |
BOOLEAN | EptHookUnHookSingleAddressFromVmxRoot (UINT64 VirtualAddress, UINT64 PhysAddress, EPT_SINGLE_HOOK_UNHOOKING_DETAILS *TargetUnhookingDetails) |
Remove single hook from the hooked pages list and invalidate TLB From VMX root-mode. | |
UINT32 | EptHookGetCountOfEpthooks (BOOLEAN IsEptHook2) |
get the length of active EPT hooks (!epthook and !epthook2) | |
BOOLEAN | EptHookRemoveEntryAndFreePoolFromEptHook2sDetourList (UINT64 Address) |
Remove an entry from g_EptHook2sDetourListHead. | |
PVOID | EptHook2GeneralDetourEventHandler (PGUEST_REGS Regs, PVOID CalledFrom) |
routines to generally handle breakpoint hit for detour | |
VOID | EptHookAllocateExtraHookingPagesForMemoryMonitorsAndExecEptHooks (UINT32 Count) |
Allocate (reserve) extra pages for storing details of page hooks for memory monitor and regular hidden breakpoit exec EPT hooks. | |
VOID | EptHookReservePreallocatedPoolsForEptHooks (UINT32 Count) |
Allocate pre-allocated pools for EPT hooks. | |
BOOLEAN | EptHookModifyInstructionFetchState (VIRTUAL_MACHINE_STATE *VCpu, PVOID PhysicalAddress, BOOLEAN IsUnset) |
Change PML EPT state for execution (execute) @detail should be called from VMX-root. | |
BOOLEAN | EptHookModifyPageReadState (VIRTUAL_MACHINE_STATE *VCpu, PVOID PhysicalAddress, BOOLEAN IsUnset) |
Change PML EPT state for read @detail should be called from VMX-root. | |
BOOLEAN | EptHookModifyPageWriteState (VIRTUAL_MACHINE_STATE *VCpu, PVOID PhysicalAddress, BOOLEAN IsUnset) |
Change PML EPT state for write @detail should be called from VMX-root. | |
VOID | EptHookHandleMonitorTrapFlag (VIRTUAL_MACHINE_STATE *VCpu) |
Handle vm-exits for Monitor Trap Flag to restore previous state. | |
Variables | |
PHANDLE | FileHandle |
PHANDLE ACCESS_MASK | DesiredAccess |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES | ObjectAttributes |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK | IoStatusBlock |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK PLARGE_INTEGER | AllocationSize |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK PLARGE_INTEGER ULONG | FileAttributes |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK PLARGE_INTEGER ULONG ULONG | ShareAccess |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK PLARGE_INTEGER ULONG ULONG ULONG | CreateDisposition |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK PLARGE_INTEGER ULONG ULONG ULONG ULONG | CreateOptions |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK PLARGE_INTEGER ULONG ULONG ULONG ULONG PVOID | EaBuffer |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK PLARGE_INTEGER ULONG ULONG ULONG ULONG PVOID ULONG | EaLength |
POOL_TYPE | PoolType |
POOL_TYPE SIZE_T | NumberOfBytes |
POOL_TYPE SIZE_T ULONG | Tag |
Hook headers.
#define IMAGE_DOS_SIGNATURE 0x5A4D |
Special signatures.
#define IMAGE_NT_SIGNATURE 0x00004550 |
#define IMAGE_OS2_SIGNATURE 0x454E |
#define IMAGE_OS2_SIGNATURE_LE 0x454C |
#define IMAGE_VXD_SIGNATURE 0x454C |
#define IS_SYSCALL_INSTRUCTION | ( | Code | ) |
#define IS_SYSRET_INSTRUCTION | ( | Code | ) |
As we have just on sysret in all the Windows, we use the following variable to hold its address this way, we're not force to check for the instruction so we remove the memory access to check for sysret in this case.
Check for instruction sysret and syscall
#define MAX_EXEC_TRAMPOLINE_SIZE 100 |
Maximum number of supported execution trampoline.
typedef struct _HIDDEN_HOOKS_DETOUR_DETAILS HIDDEN_HOOKS_DETOUR_DETAILS |
Details of detours style EPT hooks.
typedef struct _HIDDEN_HOOKS_DETOUR_DETAILS * PHIDDEN_HOOKS_DETOUR_DETAILS |
typedef struct _SSDTStruct * PSSDTStruct |
typedef enum _SYSTEM_INFORMATION_CLASS * PSYSTEM_INFORMATION_CLASS |
typedef struct _SYSTEM_MODULE_ENTRY * PSYSTEM_MODULE_ENTRY |
typedef struct _SYSTEM_MODULE_INFORMATION * PSYSTEM_MODULE_INFORMATION |
typedef struct _SSDTStruct SSDTStruct |
SSDT structure.
typedef enum _SYSTEM_INFORMATION_CLASS SYSTEM_INFORMATION_CLASS |
System information class.
typedef struct _SYSTEM_MODULE_ENTRY SYSTEM_MODULE_ENTRY |
Module entry.
typedef struct _SYSTEM_MODULE_INFORMATION SYSTEM_MODULE_INFORMATION |
System Information for modules.
typedef NTSTATUS(NTAPI * ZWQUERYSYSTEMINFORMATION) (IN SYSTEM_INFORMATION_CLASS SystemInformationClass, OUT PVOID SystemInformation, IN ULONG SystemInformationLength, OUT PULONG ReturnLength OPTIONAL) |
System information class.
Enumerator | |
---|---|
SystemModuleInformation | |
SystemKernelDebuggerInformation |
Hook in VMX non-root Mode (hidden breakpoint)
TargetAddress | |
ProcessId |
Hook in VMX non-root Mode (hidden breakpoint)
this command uses hidden breakpoints (0xcc) to hook, THIS FUNCTION SHOULD BE CALLED WHEN THE VMLAUNCH ALREADY EXECUTED, it is because, broadcasting to enable exception bitmap for breakpoint is not clear here, if we want to broadcast to enable exception bitmaps on all cores when vmlaunch is not executed then that's ok but a user might call this function when we didn't configure the vmcs, it's a problem! we can solve it by giving a hint to vmcs configure function to make it ok for future configuration but that sounds stupid, I think it's better to not support this feature. Btw, debugger won't use this function in the above mentioned method, so we won't have any problem with this This function should be called from VMX non-root mode
TargetAddress | The address of function or memory address to be hooked |
ProcessId | The process id to translate based on that process's cr3 |
PVOID EptHook2GeneralDetourEventHandler | ( | PGUEST_REGS | Regs, |
PVOID | CalledFrom ) |
routines to generally handle breakpoint hit for detour
Regs | |
CalledFrom |
Allocate (reserve) extra pages for storing details of page hooks for memory monitor and regular hidden breakpoit exec EPT hooks.
Count |
BOOLEAN EptHookFromVmxRoot | ( | PVOID | TargetAddress | ) |
This function invokes a direct VMCALL to setup the hook.
TargetAddress |
the caller of this function should make sure to 1) broadcast to all cores to intercept breakpoints (#BPs) and after calling this function 2) the caller should broadcast to all cores to invalidate their EPTPs This function should be called from VMX root-mode
TargetAddress | The address of function or memory address to be hooked |
get the length of active EPT hooks (!epthook and !epthook2)
return UINT32
IsEptHook2 | Whether the length should be for !epthook or !epthook2 |
BOOLEAN EptHookHandleHookedPage | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
EPT_HOOKED_PAGE_DETAIL * | HookedEntryDetails, | ||
VMX_EXIT_QUALIFICATION_EPT_VIOLATION | ViolationQualification, | ||
SIZE_T | PhysicalAddress, | ||
EPT_HOOKS_CONTEXT * | LastContext, | ||
BOOLEAN * | IgnoreReadOrWriteOrExec, | ||
BOOLEAN * | IsExecViolation ) |
Handle hooked pages in Vmx-root mode.
VCpu | |
HookedEntryDetails | |
ViolationQualification | |
PhysicalAddress | |
LastContext | |
IgnoreReadOrWriteOrExec | |
IsExecViolation |
Handle hooked pages in Vmx-root mode.
VCpu | The virtual processor's state |
HookedEntryDetails | The entry that describes the hooked page |
ViolationQualification | The exit qualification of vm-exit |
PhysicalAddress | The physical address that cause this vm-exit |
LastContext | The last (current) context of the execution |
IgnoreReadOrWriteOrExec | Whether to ignore the event effects or not |
IsExecViolation | Whether it's execution violation or not executing the post triggering of the event or not |
VOID EptHookHandleMonitorTrapFlag | ( | VIRTUAL_MACHINE_STATE * | VCpu | ) |
Handle vm-exits for Monitor Trap Flag to restore previous state.
VCpu | The virtual processor's state |
BOOLEAN EptHookInlineHook | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
PVOID | TargetAddress, | ||
PVOID | HookFunction, | ||
UINT32 | ProcessId ) |
Hook in VMX non-root mode (hidden detours)
VCpu | |
TargetAddress | |
HookFunction | |
ProcessId |
Hook in VMX non-root mode (hidden detours)
this function should be called from VMX non-root mode
VCpu | The virtual processor's state |
TargetAddress | The address of function or memory address to be hooked |
HookFunction | The function that will be called when hook triggered |
ProcessId | The process id to translate based on that process's cr3 |
BOOLEAN EptHookInlineHookFromVmxRoot | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
PVOID | TargetAddress, | ||
PVOID | HookFunction ) |
Hook in VMX root-mode (hidden detours)
VCpu | |
TargetAddress | |
HookFunction |
Hook in VMX root-mode (hidden detours)
this function should be called from VMX root-mode
VCpu | The virtual processor's state |
TargetAddress | The address of function or memory address to be hooked |
HookFunction | The function that will be called when hook triggered |
BOOLEAN EptHookModifyInstructionFetchState | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
PVOID | PhysicalAddress, | ||
BOOLEAN | IsUnset ) |
Change PML EPT state for execution (execute) @detail should be called from VMX-root.
VCpu | The virtual processor's state |
PhysicalAddress | Target physical address |
IsUnset | Is unsetting bit or setting bit |
BOOLEAN EptHookModifyPageReadState | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
PVOID | PhysicalAddress, | ||
BOOLEAN | IsUnset ) |
Change PML EPT state for read @detail should be called from VMX-root.
VCpu | The virtual processor's state |
PhysicalAddress | Target physical address |
IsUnset | Is unsetting bit or setting bit |
BOOLEAN EptHookModifyPageWriteState | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
PVOID | PhysicalAddress, | ||
BOOLEAN | IsUnset ) |
Change PML EPT state for write @detail should be called from VMX-root.
VCpu | The virtual processor's state |
PhysicalAddress | Target physical address |
IsUnset | Is unsetting bit or setting bit |
BOOLEAN EptHookMonitorFromVmxRoot | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
EPT_HOOKS_ADDRESS_DETAILS_FOR_MEMORY_MONITOR * | MemoryAddressDetails ) |
This function applies EPT monitor hooks to the target EPT table.
this function should be called from VMX root-mode
VCpu | |
MemoryAddressDetails |
this function should be called from VMX root-mode
VCpu | The virtual processor's state |
MemoryAddressDetails | details of the target memory |
BOOLEAN EptHookMonitorHook | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
EPT_HOOKS_ADDRESS_DETAILS_FOR_MEMORY_MONITOR * | HookingDetails, | ||
UINT32 | ProcessId ) |
This function applies monitor hooks to the target EPT table.
this function should be called from VMX non-root mode
VCpu | |
HookingDetails | |
ProcessId |
this function should be called from VMX non-root mode
VCpu | The virtual processor's state |
HookingDetails | Monitor hooking details |
ProcessId | The process id to translate based on that process's cr3 |
BOOLEAN EptHookPerformPageHook | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
PVOID | TargetAddress, | ||
CR3_TYPE | ProcessCr3 ) |
Hook in VMX Root Mode with hidden breakpoints (A pre-allocated buffer should be available)
VCpu | |
TargetAddress | |
ProcessCr3 |
Hook in VMX Root Mode with hidden breakpoints (A pre-allocated buffer should be available)
This function returns false in VMX Non-Root Mode if the VM is already initialized This function have to be called through a VMCALL in VMX Root Mode
VCpu | The virtual processor's state |
TargetAddress | The address of function or memory address to be hooked |
ProcessCr3 | The process cr3 to translate based on that process's cr3 |
BOOLEAN EptHookPerformPageHookMonitorAndInlineHook | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
PVOID | HookingDetails, | ||
CR3_TYPE | ProcessCr3, | ||
UINT32 | PageHookMask ) |
Hook in VMX Root Mode with hidden detours and monitor (A pre-allocated buffer should be available)
VCpu | |
HookingDetails | |
ProcessCr3 | |
PageHookMask |
Hook in VMX Root Mode with hidden detours and monitor (A pre-allocated buffer should be available)
This function returns false in VMX Non-Root Mode if the VM is already initialized This function have to be called through a VMCALL in VMX Root Mode
VCpu | The virtual processor's state |
HookingDetails | The address of function or memory address to be hooked |
ProcessCr3 | The process cr3 to translate based on that process's cr3 |
PageHookMask | Mask hook of the page |
Remove an entry from g_EptHook2sDetourListHead.
Address |
Remove an entry from g_EptHook2sDetourListHead.
Address | Address to remove |
Allocate pre-allocated pools for EPT hooks.
Count | number of hooks |
Allocate pre-allocated pools for EPT hooks.
Count | number of hooks |
VOID EptHookRestoreAllHooksToOriginalEntry | ( | VIRTUAL_MACHINE_STATE * | VCpu | ) |
Remove all hooks from the hooked pages lists (Should be called in vmx-root)
VCpu |
Remove all hooks from the hooked pages lists (Should be called in vmx-root)
VCpu | The virtual processor's state |
BOOLEAN EptHookRestoreSingleHookToOriginalEntry | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
SIZE_T | PhysicalAddress, | ||
UINT64 | OriginalEntry ) |
Remove a special hook from the hooked pages lists.
VCpu | |
PhysicalAddress | |
OriginalEntry |
Remove a special hook from the hooked pages lists.
VCpu | The virtual processor's state |
PhysicalAddress | |
OriginalEntry |
VOID EptHookUnHookAll | ( | ) |
Remove all hooks from the hooked pages lists.
Remove all hooks from the hooked pages lists.
Remove all hooks from the hooked pages by the given hooking tag.
Should be called from Vmx Non-root
HookingTag | The hooking tag to unhook |
Remove single hook from the hooked pages list and invalidate TLB From VMX non-root mode.
VirtualAddress | |
PhysAddress | |
ProcessId |
Remove single hook from the hooked pages list and invalidate TLB From VMX non-root mode.
Should be called from VMX non-root
VirtualAddress | Virtual address to unhook |
PhysAddress | Physical address to unhook (optional) |
ProcessId | The process id of target process |
in unhooking for some hooks only physical address is availables
BOOLEAN EptHookUnHookSingleAddressFromVmxRoot | ( | UINT64 | VirtualAddress, |
UINT64 | PhysAddress, | ||
EPT_SINGLE_HOOK_UNHOOKING_DETAILS * | TargetUnhookingDetails ) |
Remove single hook from the hooked pages list and invalidate TLB From VMX root-mode.
VirtualAddress | |
PhysAddress | |
TargetUnhookingDetails |
Remove single hook from the hooked pages list and invalidate TLB From VMX root-mode.
Should be called from VMX root-mode
VirtualAddress | Virtual address to unhook |
PhysAddress | Physical address to unhook (optional) |
TargetUnhookingDetails | Target data for the caller to restore EPT entry and invalidate EPT caches. Only when applied in VMX-root mode directly |
BOOLEAN EptHookUnHookSingleHookByHookingTagFromVmxRoot | ( | UINT64 | HookingTag, |
EPT_SINGLE_HOOK_UNHOOKING_DETAILS * | TargetUnhookingDetails ) |
Remove single hook from the hooked pages by the given hooking tag.
Should be called from Vmx root-mode
HookingTag | The hooking tag to unhook |
VOID SyscallHookConfigureEFER | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
BOOLEAN | EnableEFERSyscallHook ) |
This function enables or disables EFER syscall hoo.
This function should be called for the first time that we want to enable EFER hook because after calling this function EFER MSR is loaded from GUEST_EFER instead of loading from the regular EFER MSR.
VCpu | The virtual processor's state |
EnableEFERSyscallHook | Determines whether we want to enable syscall hook or disable syscall hook |
BOOLEAN SyscallHookEmulateSYSCALL | ( | _Inout_ VIRTUAL_MACHINE_STATE * | VCpu | ) |
BOOLEAN SyscallHookEmulateSYSRET | ( | _Inout_ VIRTUAL_MACHINE_STATE * | VCpu | ) |
BOOLEAN SyscallHookHandleUD | ( | _Inout_ VIRTUAL_MACHINE_STATE * | VCpu | ) |
VOID SyscallHookTest | ( | ) |
Make examples for testing hidden hooks.
THIS EXAMPLE IS NOT VALID ANYMORE, PLEASE USE !syscall OR !epthook2 COMMANDS
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK PLARGE_INTEGER AllocationSize |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK PLARGE_INTEGER ULONG ULONG ULONG CreateDisposition |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK PLARGE_INTEGER ULONG ULONG ULONG ULONG CreateOptions |
PHANDLE ACCESS_MASK DesiredAccess |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK PLARGE_INTEGER ULONG ULONG ULONG ULONG PVOID EaBuffer |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK PLARGE_INTEGER ULONG ULONG ULONG ULONG PVOID ULONG EaLength |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK PLARGE_INTEGER ULONG FileAttributes |
PHANDLE FileHandle |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES PIO_STATUS_BLOCK IoStatusBlock |
POOL_TYPE SIZE_T NumberOfBytes |
PHANDLE ACCESS_MASK POBJECT_ATTRIBUTES ObjectAttributes |
POOL_TYPE PoolType |
POOL_TYPE SIZE_T ULONG Tag |