diff options
author | Mattiwatti <mattiwatti@gmail.com> | 2019-03-30 02:14:23 +0100 |
---|---|---|
committer | Mattiwatti <mattiwatti@gmail.com> | 2019-03-30 02:14:23 +0100 |
commit | f56011ea4d54fd202827e99171acecb09e7d599e (patch) | |
tree | b1840f3a7bb6b2fa29dbe3c46ac3e2888491add1 | |
parent | ae0dd3bc75a29907060608a46d3f49e136e3a0d4 (diff) |
EfiDSEFix: read input value for '--enable' as hex to match '--disable'
-rw-r--r-- | Application/EfiDSEFix/src/EfiDSEFix.h | 8 | ||||
-rw-r--r-- | Application/EfiDSEFix/src/main.cpp | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/Application/EfiDSEFix/src/EfiDSEFix.h b/Application/EfiDSEFix/src/EfiDSEFix.h index b22336f..68dc238 100644 --- a/Application/EfiDSEFix/src/EfiDSEFix.h +++ b/Application/EfiDSEFix/src/EfiDSEFix.h @@ -111,10 +111,12 @@ _vsnwprintf( ); NTSYSAPI -int +ULONG __cdecl -_wtoi( - _In_ PCWCHAR Str +wcstoul( + _In_ PCWCHAR String, + _Out_opt_ PWCHAR* EndPtr, + _In_ LONG Radix ); // Console functions 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 |