@@ -161,8 +161,7 @@ namespace details {
161161 _In_ ULONG MinorVersion,
162162 _In_ ULONG BuildNumber
163163 ) {
164- NtVersion version{};
165- RtlSecureZeroMemory (&version, sizeof (NtVersion));
164+ NtVersion version = { 0 };
166165 RtlCurrentVersion (&version);
167166 if (version.MajorVersion == MajorVersion) {
168167 if (version.MinorVersion == MinorVersion) return version.BuildNumber >= BuildNumber;
@@ -177,8 +176,7 @@ namespace details {
177176 _In_ ULONG BuildNumber,
178177 _In_ BYTE Flags
179178 ) {
180- NtVersion version{};
181- RtlSecureZeroMemory (&version, sizeof (NtVersion));
179+ NtVersion version = { 0 };
182180 RtlCurrentVersion (&version);
183181 if (version.MajorVersion == MajorVersion &&
184182 ((Flags & RTL_VERIFY_FLAGS_MINOR_VERSION) ? version.MinorVersion == MinorVersion : true ) &&
@@ -331,7 +329,7 @@ namespace details {
331329 ULONG old;
332330
333331 if (!MrdataBase) {
334- MEMORY_BASIC_INFORMATION mbi{ };
332+ MEMORY_BASIC_INFORMATION mbi= { 0 };
335333 status = NtQueryVirtualMemory (NtCurrentProcess (), mrdata, MemoryBasicInformation, &mbi, sizeof (mbi), nullptr );
336334 if (!NT_SUCCESS (status))return status;
337335 MrdataBase = mbi.BaseAddress ;
@@ -362,9 +360,9 @@ namespace details {
362360 if (!hNtdll) return nullptr ;
363361 auto NtdllHeaders = reinterpret_cast <PIMAGE_NT_HEADERS>(RtlImageNtHeader (hNtdll));
364362 PIMAGE_NT_HEADERS ModuleHeaders = nullptr ;
365- _RTL_INVERTED_FUNCTION_TABLE_ENTRY_64 entry{ };
363+ _RTL_INVERTED_FUNCTION_TABLE_ENTRY_64 entry = { 0 };
366364 PIMAGE_DATA_DIRECTORY dir = nullptr ;
367- SEARCH_CONTEXT SearchContext{ };
365+ SEARCH_CONTEXT SearchContext= { 0 };
368366 SearchContext.SearchPattern = reinterpret_cast <LPBYTE>(&entry);
369367 SearchContext.PatternSize = sizeof (entry);
370368 RtlSecureZeroMemory (&entry, sizeof (entry));
@@ -491,7 +489,7 @@ namespace details {
491489 ULONG CurrentSize = InvertedTable->Count ;
492490 PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionTable = nullptr ;
493491 ULONG SizeOfTable = 0 ;
494- bool IsWin8OrGreater = RtlIsWindowsVersionOrGreater (6 , 2 , 0 );
492+ BOOL IsWin8OrGreater = RtlIsWindowsVersionOrGreater (6 , 2 , 0 );
495493 ULONG Index = static_cast <ULONG>(IsWin8OrGreater);
496494
497495 if (CurrentSize != InvertedTable->MaxCount ) {
@@ -590,7 +588,7 @@ namespace details {
590588#ifdef _DEBUG
591589 std::cout << " Found exception table: " << std::hex << table << std::endl;
592590#endif
593- bool need_virtual_protect = RtlIsWindowsVersionOrGreater (6 , 3 , 0 );
591+ BOOL need_virtual_protect = RtlIsWindowsVersionOrGreater (6 , 3 , 0 );
594592 // Windows 8.1 and above require to set PAGE_READWRITE protection
595593#ifdef _DEBUG
596594 std::cout << " Need virtual protect: " << std::boolalpha << need_virtual_protect << std::endl;
@@ -621,5 +619,5 @@ bool peconv::setup_exceptions(IN BYTE* modulePtr, IN size_t moduleSize)
621619 }
622620 moduleSize = img_size;
623621 }
624- return NT_SUCCESS (details::RtlInsertInvertedFunctionTable (modulePtr, moduleSize));
622+ return NT_SUCCESS (details::RtlInsertInvertedFunctionTable (modulePtr, (ULONG) moduleSize)) ? true : false ;
625623}
0 commit comments