aboutsummaryrefslogtreecommitdiff
path: root/Application/EfiDSEFix/src/main.cpp
diff options
context:
space:
mode:
authorMattiwatti <mattiwatti@gmail.com>2019-03-30 02:14:23 +0100
committerMattiwatti <mattiwatti@gmail.com>2019-03-30 02:14:23 +0100
commitf56011ea4d54fd202827e99171acecb09e7d599e (patch)
treeb1840f3a7bb6b2fa29dbe3c46ac3e2888491add1 /Application/EfiDSEFix/src/main.cpp
parentae0dd3bc75a29907060608a46d3f49e136e3a0d4 (diff)
EfiDSEFix: read input value for '--enable' as hex to match '--disable'
Diffstat (limited to 'Application/EfiDSEFix/src/main.cpp')
-rw-r--r--Application/EfiDSEFix/src/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Application/EfiDSEFix/src/main.cpp b/Application/EfiDSEFix/src/main.cpp
index 1c7e8da..8409ee3 100644
--- a/Application/EfiDSEFix/src/main.cpp
+++ b/Application/EfiDSEFix/src/main.cpp
@@ -21,7 +21,9 @@ PrintUsage(
int wmain(int argc, wchar_t** argv)
{
NT_ASSERT(argc != 0);
- if (argc == 1 || argc > 3 || (argc == 3 && _wtoi(argv[2]) == 0))
+
+ if (argc == 1 || argc > 3 ||
+ (argc == 3 && wcstoul(argv[2], nullptr, 16) == 0))
{
// Print help text
PrintUsage(argv[0]);
@@ -50,7 +52,7 @@ int wmain(int argc, wchar_t** argv)
{
if (NtCurrentPeb()->OSBuildNumber >= 9200)
{
- CiOptionsValue = argc == 3 ? static_cast<ULONG>(_wtoi(argv[2])) : CODEINTEGRITY_OPTION_ENABLED;
+ CiOptionsValue = argc == 3 ? wcstoul(argv[2], nullptr, 16) : CODEINTEGRITY_OPTION_ENABLED;
Printf(L"(Re)enabling DSE [g_CiOptions value = 0x%X]...\n", CiOptionsValue);
}
else