From f56011ea4d54fd202827e99171acecb09e7d599e Mon Sep 17 00:00:00 2001 From: Mattiwatti Date: Sat, 30 Mar 2019 02:14:23 +0100 Subject: EfiDSEFix: read input value for '--enable' as hex to match '--disable' --- Application/EfiDSEFix/src/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Application/EfiDSEFix/src/main.cpp') 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(_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 -- cgit v1.2.3