Skip to content

Commit

Permalink
Code correctness. Show green "no" if legacy optimization is used inst…
Browse files Browse the repository at this point in the history
…ead of INVPCID. Enable CFG/GS cookies. Set warning level to maximum.
  • Loading branch information
ionescu007 committed Jan 10, 2018
1 parent e7454bd commit 57d0290
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions SpecuCheck.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<Optimization>Full</Optimization>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ControlFlowGuard>false</ControlFlowGuard>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies);onecoreuap.lib;libucrt.lib;ntdll.lib</AdditionalDependencies>
Expand Down
9 changes: 6 additions & 3 deletions specucheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ Module Name:
#define WIN32_NO_STATUS
#include <windows.h>
#include <winternl.h>
#include <wchar.h>

//
// Internal structures and information classes
//
#pragma warning(push)
#pragma warning(disable:4214)
#define SystemSpeculationControlInformation (SYSTEM_INFORMATION_CLASS)201
typedef struct _SYSTEM_SPECULATION_CONTROL_INFORMATION
{
Expand Down Expand Up @@ -60,6 +63,7 @@ typedef struct _SYSTEM_KERNEL_VA_SHADOW_INFORMATION
ULONG Reserved : 28;
} KvaShadowFlags;
} SYSTEM_KERNEL_VA_SHADOW_INFORMATION, *PSYSTEM_KERNEL_VA_SHADOW_INFORMATION;
#pragma warning(pop)

//
// ANSI Check
Expand All @@ -70,7 +74,7 @@ BOOL g_SupportsAnsi;
// Welcome Banner
//
const WCHAR WelcomeString[] =
L"SpecuCheck v1.0.4 -- Copyright(c) 2018 Alex Ionescu\n"
L"SpecuCheck v1.0.5 -- Copyright(c) 2018 Alex Ionescu\n"
L"https://ionescu007.github.io/SpecuCheck/ -- @aionescu\n"
L"-------------------------------------------------------\n\n";

Expand Down Expand Up @@ -179,7 +183,6 @@ SpcMain (
{
HANDLE hStdOut;
NTSTATUS status;
BOOL boolResult;
SYSTEM_KERNEL_VA_SHADOW_INFORMATION kvaInfo;
SYSTEM_SPECULATION_CONTROL_INFORMATION specInfo;
SPC_ERROR_CODES errorCode;
Expand Down Expand Up @@ -261,7 +264,7 @@ SpcMain (
GetGreenYesString() : GetRedNoString(),
GetResetString(),
kvaInfo.KvaShadowFlags.KvaShadowUserGlobal ?
GetGreenYesString() : GetRedNoString(),
GetRedYesString() : GetGreenNoString(),
GetResetString(),
kvaInfo.KvaShadowFlags.KvaShadowPcid ?
GetGreenYesString() : GetRedNoString(),
Expand Down

0 comments on commit 57d0290

Please sign in to comment.