Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions HyperHide/HyperHide.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v145</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v145</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v145</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v145</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
14 changes: 7 additions & 7 deletions HyperHideDrv/Hider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ namespace Hider
HiddenThread = (PHIDDEN_THREAD)CONTAINING_RECORD(CurrentThread, HIDDEN_THREAD, HiddenThreadList);
CurrentThread = CurrentThread->Flink;

if (HiddenThread->ThreadObject == ThreadObject)
goto End;
}
if (HiddenThread->ThreadObject == ThreadObject)
goto End;
}

HiddenThread = (PHIDDEN_THREAD)ExAllocatePoolWithTag(NonPagedPool, sizeof(HIDDEN_THREAD), DRIVER_TAG);
if (HiddenThread == NULL)
return NULL;
HiddenThread = (PHIDDEN_THREAD)ExAllocatePool2(POOL_FLAG_NON_PAGED, sizeof(HIDDEN_THREAD), DRIVER_TAG);
if (HiddenThread == NULL)
return NULL;

RtlSecureZeroMemory(HiddenThread, sizeof(HIDDEN_THREAD));
HiddenThread->ThreadObject = ThreadObject;
Expand Down Expand Up @@ -325,7 +325,7 @@ namespace Hider

BOOLEAN CreateEntry(PEPROCESS DebuggerProcess, PEPROCESS DebuggedProcess)
{
PHIDDEN_PROCESS HiddenProcess = (PHIDDEN_PROCESS)ExAllocatePoolWithTag(NonPagedPool, sizeof(HIDDEN_PROCESS), DRIVER_TAG);
PHIDDEN_PROCESS HiddenProcess = (PHIDDEN_PROCESS)ExAllocatePool2(POOL_FLAG_NON_PAGED, sizeof(HIDDEN_PROCESS), DRIVER_TAG);
if (HiddenProcess == NULL)
{
LogError("Allocation failed");
Expand Down
68 changes: 49 additions & 19 deletions HyperHideDrv/HyperHideDrv.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
Expand All @@ -18,26 +18,26 @@
<Configuration>Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
<RootNamespace>HyperHideDrv</RootNamespace>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>Driver</ConfigurationType>
<DriverType>KMDF</DriverType>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation>
<Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation><EnableInf2cat>false</EnableInf2cat><SignMode>Off</SignMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>Driver</ConfigurationType>
<DriverType>KMDF</DriverType>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation>
<Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation><EnableInf2cat>false</EnableInf2cat><SignMode>Off</SignMode>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand All @@ -61,6 +61,7 @@
<AdditionalDependencies>%(AdditionalDependencies);$(KernelBufferOverflowLib);$(DDK_LIB_PATH)ntoskrnl.lib;$(DDK_LIB_PATH)hal.lib;$(DDK_LIB_PATH)wmilib.lib;$(KMDF_LIB_PATH)$(KMDF_VER_PATH)\WdfLdr.lib;$(KMDF_LIB_PATH)$(KMDF_VER_PATH)\WdfDriverEntry.lib</AdditionalDependencies>
</Link>
<ClCompile>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>MaxSpeed</Optimization>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<BufferSecurityCheck>false</BufferSecurityCheck>
Expand All @@ -69,6 +70,7 @@
<DisableSpecificWarnings>4603;4627;4986;4987;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<WholeProgramOptimization>true</WholeProgramOptimization>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand All @@ -77,27 +79,55 @@
<AdditionalOptions>/INTEGRITYCHECK %(AdditionalOptions)</AdditionalOptions>
</Link>
<ClCompile>
<TreatWarningAsError>false</TreatWarningAsError>
<BufferSecurityCheck>false</BufferSecurityCheck>
<LanguageStandard>stdcpp20</LanguageStandard>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<FilesToPackage Include="$(TargetPath)" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Dispatcher.cpp" />
<ClCompile Include="Driver.cpp" />
<ClCompile Include="Heap.cpp" />
<ClCompile Include="Hider.cpp" />
<ClCompile Include="HookHelper.cpp" />
<ClCompile Include="HypervisorGateway.cpp" />
<ClCompile Include="KuserSharedData.cpp" />
<ClCompile Include="Log.cpp" />
<ClCompile Include="Notifiers.cpp" />
<ClCompile Include="Peb.cpp" />
<ClCompile Include="HookedFunctions.cpp" />
<ClCompile Include="Ssdt.cpp" />
<ClCompile Include="Utils.cpp" />
<ClCompile Include="Dispatcher.cpp">
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ClCompile Include="Driver.cpp">
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ClCompile Include="Heap.cpp">
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ClCompile Include="Hider.cpp">
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ClCompile Include="HookHelper.cpp">
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ClCompile Include="HypervisorGateway.cpp">
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ClCompile Include="KuserSharedData.cpp">
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ClCompile Include="Log.cpp">
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ClCompile Include="Notifiers.cpp">
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ClCompile Include="Peb.cpp">
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ClCompile Include="HookedFunctions.cpp">
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ClCompile Include="Ssdt.cpp">
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ClCompile Include="Utils.cpp">
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Ioctl.h" />
Expand Down
6 changes: 2 additions & 4 deletions HyperHideDrv/Ntenums.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ enum _LDR_DLL_LOAD_REASON
LoadReasonUnknown = -1
};

typedef enum _PSCREATETHREADNOTIFYTYPE {
PsCreateThreadNotifyNonSystem = 0,
PsCreateThreadNotifySubsystems = 1
} PSCREATETHREADNOTIFYTYPE;
// _PSCREATETHREADNOTIFYTYPE is already defined in Windows 10 SDK
// Removed duplicate definition to avoid C2011 error

enum SYSDBG_COMMAND
{
Expand Down
12 changes: 6 additions & 6 deletions HyperHideDrv/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ BOOLEAN GetProcessInfo(CONST CHAR* Name, ULONG64& ImageSize, PVOID& ImageBase)
{
ULONG Bytes;
NTSTATUS Status = ZwQuerySystemInformation(SystemModuleInformation, 0, 0, &Bytes);
PSYSTEM_MODULE_INFORMATION Mods = (PSYSTEM_MODULE_INFORMATION)ExAllocatePoolWithTag(NonPagedPool, Bytes, DRIVER_TAG);
PSYSTEM_MODULE_INFORMATION Mods = (PSYSTEM_MODULE_INFORMATION)ExAllocatePool2(POOL_FLAG_NON_PAGED, Bytes, DRIVER_TAG);
if (Mods == NULL)
return FALSE;

Expand Down Expand Up @@ -224,7 +224,7 @@ PEPROCESS GetProcessByName(CONST WCHAR* ProcessName)
ULONG Bytes;

ZwQuerySystemInformation(SystemProcessInformation, NULL, NULL, &Bytes);
PSYSTEM_PROCESS_INFO ProcInfo = (PSYSTEM_PROCESS_INFO)ExAllocatePoolWithTag(NonPagedPool, Bytes, DRIVER_TAG);
PSYSTEM_PROCESS_INFO ProcInfo = (PSYSTEM_PROCESS_INFO)ExAllocatePool2(POOL_FLAG_NON_PAGED, Bytes, DRIVER_TAG);
if (ProcInfo == NULL)
return NULL;

Expand Down Expand Up @@ -383,7 +383,7 @@ BOOLEAN ClearBypassProcessFreezeFlag(PEPROCESS TargetProcess)
}

ZwQuerySystemInformation(SystemProcessInformation, NULL, NULL, &Bytes);
PSYSTEM_PROCESS_INFO ProcInfo = (PSYSTEM_PROCESS_INFO)ExAllocatePoolWithTag(NonPagedPool, Bytes, DRIVER_TAG);
PSYSTEM_PROCESS_INFO ProcInfo = (PSYSTEM_PROCESS_INFO)ExAllocatePool2(POOL_FLAG_NON_PAGED, Bytes, DRIVER_TAG);

if (ProcInfo == NULL)
return FALSE;
Expand Down Expand Up @@ -425,11 +425,11 @@ BOOLEAN ClearThreadHideFromDebuggerFlag(PEPROCESS TargetProcess)
ULONG Bytes;

ZwQuerySystemInformation(SystemProcessInformation, NULL, NULL, &Bytes);
PSYSTEM_PROCESS_INFO ProcInfo = (PSYSTEM_PROCESS_INFO)ExAllocatePoolWithTag(NonPagedPool, Bytes, DRIVER_TAG);
PSYSTEM_PROCESS_INFO ProcInfo = (PSYSTEM_PROCESS_INFO)ExAllocatePool2(POOL_FLAG_NON_PAGED, Bytes, DRIVER_TAG);

if (ProcInfo == NULL)
return FALSE;

RtlSecureZeroMemory(ProcInfo, Bytes);

Status = ZwQuerySystemInformation(SystemProcessInformation, ProcInfo, Bytes, &Bytes);
Expand Down Expand Up @@ -529,7 +529,7 @@ BOOLEAN ClearThreadBreakOnTerminationFlags(PEPROCESS TargetProcess)
ULONG Bytes;

ZwQuerySystemInformation(SystemProcessInformation, NULL, NULL, &Bytes);
PSYSTEM_PROCESS_INFO ProcInfo = (PSYSTEM_PROCESS_INFO)ExAllocatePoolWithTag(NonPagedPool, Bytes, DRIVER_TAG);
PSYSTEM_PROCESS_INFO ProcInfo = (PSYSTEM_PROCESS_INFO)ExAllocatePool2(POOL_FLAG_NON_PAGED, Bytes, DRIVER_TAG);
if (ProcInfo == NULL)
return FALSE;

Expand Down