diff options
author | Matthijs Lavrijsen <mattiwatti@gmail.com> | 2023-05-12 00:25:55 +0200 |
---|---|---|
committer | Matthijs Lavrijsen <mattiwatti@gmail.com> | 2023-05-31 18:19:16 +0200 |
commit | 2233c19374a9d3e180921c68ec79de7c3f2edb3b (patch) | |
tree | 829754fc9af3b424ba8d08ed3a55d2fe1d86392a | |
parent | fe908769897f6d53cf13a0f4f1ffc7c5084aed3a (diff) |
EfiDSEFix: print help text on invalid usage
-rw-r--r-- | Application/EfiDSEFix/src/EfiDSEFix.vcxproj | 2 | ||||
-rw-r--r-- | Application/EfiDSEFix/src/main.cpp | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/Application/EfiDSEFix/src/EfiDSEFix.vcxproj b/Application/EfiDSEFix/src/EfiDSEFix.vcxproj index 39ae674..44675b5 100644 --- a/Application/EfiDSEFix/src/EfiDSEFix.vcxproj +++ b/Application/EfiDSEFix/src/EfiDSEFix.vcxproj @@ -70,6 +70,7 @@ <ControlFlowGuard>false</ControlFlowGuard> <AdditionalIncludeDirectories>$(SolutionDir)Include;$(SolutionDir)../MdePkg/Include;$(SolutionDir)../MdePkg/Include/X64;$(SolutionDir)../MdeModulePkg/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <IntrinsicFunctions>true</IntrinsicFunctions> + <BuildStlModules>false</BuildStlModules> </ClCompile> <Link> <SubSystem>Console</SubSystem> @@ -108,6 +109,7 @@ <ControlFlowGuard>false</ControlFlowGuard> <AdditionalIncludeDirectories>$(SolutionDir)Include;$(SolutionDir)../MdePkg/Include;$(SolutionDir)../MdePkg/Include/X64;$(SolutionDir)../MdeModulePkg/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <IntrinsicFunctions>true</IntrinsicFunctions> + <BuildStlModules>false</BuildStlModules> </ClCompile> <Link> <SubSystem>Native</SubSystem> diff --git a/Application/EfiDSEFix/src/main.cpp b/Application/EfiDSEFix/src/main.cpp index a648055..50e336a 100644 --- a/Application/EfiDSEFix/src/main.cpp +++ b/Application/EfiDSEFix/src/main.cpp @@ -38,7 +38,7 @@ int wmain(int argc, wchar_t** argv) const BOOLEAN Win8OrHigher = (RtlNtMajorVersion() >= 6 && RtlNtMinorVersion() >= 2) || RtlNtMajorVersion() > 6; const ULONG EnabledCiOptionsValue = Win8OrHigher ? 0x6 : CODEINTEGRITY_OPTION_ENABLED; const PCWCHAR CiOptionsName = Win8OrHigher ? L"g_CiOptions" : L"g_CiEnabled"; - ULONG CiOptionsValue = 0; + ULONG CiOptionsValue; BOOLEAN ReadOnly = FALSE; if (wcsncmp(argv[1], L"-c", sizeof(L"-c") / sizeof(WCHAR) - 1) == 0 || @@ -82,6 +82,11 @@ int wmain(int argc, wchar_t** argv) { return DumpSystemInformation(); } + else + { + PrintUsage(argv[0]); + return STATUS_INVALID_PARAMETER; + } // Trigger EFI driver exploit and write new value to g_CiOptions/g_CiEnabled ULONG OldCiOptionsValue; |