From 758f68b57d84fcaf747b13526e1a35dd4b93e77e Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 8 Oct 2025 12:35:19 -0700 Subject: [PATCH 1/4] Include `` instead of ``. --- CAPE/Scylla/ApiReader.h | 2 +- CAPE/Scylla/ImportsHandling.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CAPE/Scylla/ApiReader.h b/CAPE/Scylla/ApiReader.h index 8028ed5f..b08805fc 100644 --- a/CAPE/Scylla/ApiReader.h +++ b/CAPE/Scylla/ApiReader.h @@ -2,7 +2,7 @@ #include #include -#include +#include #include "ProcessAccessHelp.h" #include "Thunks.h" diff --git a/CAPE/Scylla/ImportsHandling.h b/CAPE/Scylla/ImportsHandling.h index 3c1ee9bf..e34ef0cf 100644 --- a/CAPE/Scylla/ImportsHandling.h +++ b/CAPE/Scylla/ImportsHandling.h @@ -2,7 +2,7 @@ #include #include -#include +#include class ImportThunk; class ImportModuleThunk; From 7f445f44c534cb7fc3dc334e8f5dfb8e84e4312d Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 8 Oct 2025 12:38:54 -0700 Subject: [PATCH 2/4] Use `std::unordered_multimap` instead of `stdext::hash_multimap`. --- CAPE/Scylla/ApiReader.cpp | 6 +++--- CAPE/Scylla/ApiReader.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CAPE/Scylla/ApiReader.cpp b/CAPE/Scylla/ApiReader.cpp index e3df4163..b66a9771 100644 --- a/CAPE/Scylla/ApiReader.cpp +++ b/CAPE/Scylla/ApiReader.cpp @@ -12,7 +12,7 @@ extern "C" void DebugOutput(_In_ LPCTSTR lpOutputString, ...); extern "C" void ErrorOutput(_In_ LPCTSTR lpOutputString, ...); extern "C" SIZE_T GetAllocationSize(PVOID Address); -stdext::hash_multimap ApiReader::apiList; //api look up table +std::unordered_multimap ApiReader::apiList; //api look up table std::map * ApiReader::moduleThunkList; //store found apis DWORD_PTR ApiReader::minApiAddress = (DWORD_PTR)-1; @@ -690,7 +690,7 @@ bool ApiReader::isApiAddressValid(DWORD_PTR virtualAddress) ApiInfo * ApiReader::getApiByVirtualAddress(DWORD_PTR virtualAddress, bool * isSuspect) { - stdext::hash_multimap::iterator it1, it2; + std::unordered_multimap::iterator it1, it2; size_t c = 0; size_t countDuplicates = apiList.count(virtualAddress); int countHighPriority = 0; @@ -773,7 +773,7 @@ ApiInfo * ApiReader::getApiByVirtualAddress(DWORD_PTR virtualAddress, bool * isS return (ApiInfo *) 1; } -ApiInfo * ApiReader::getScoredApi(stdext::hash_multimap::iterator it1,size_t countDuplicates, bool hasName, bool hasUnicodeAnsiName, bool hasNoUnderlineInName, bool hasPrioDll,bool hasPrio0Dll,bool hasPrio1Dll, bool hasPrio2Dll, bool firstWin ) +ApiInfo * ApiReader::getScoredApi(std::unordered_multimap::iterator it1,size_t countDuplicates, bool hasName, bool hasUnicodeAnsiName, bool hasNoUnderlineInName, bool hasPrioDll,bool hasPrio0Dll,bool hasPrio1Dll, bool hasPrio2Dll, bool firstWin ) { ApiInfo * foundApi = 0; ApiInfo * foundMatchingApi = 0; diff --git a/CAPE/Scylla/ApiReader.h b/CAPE/Scylla/ApiReader.h index b08805fc..d51308d3 100644 --- a/CAPE/Scylla/ApiReader.h +++ b/CAPE/Scylla/ApiReader.h @@ -11,7 +11,7 @@ typedef std::pair API_Pair; class ApiReader : public ProcessAccessHelp { public: - static stdext::hash_multimap apiList; //api look up table + static std::unordered_multimap apiList; //api look up table static std::map * moduleThunkList; //store found apis From 077fd913c2c06a87bd0b2d7a47c6c03007424520 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 8 Oct 2025 12:42:26 -0700 Subject: [PATCH 3/4] Fix: Use `unordered_multimap::iterator` instead of `hash_map::iterator`. In ApiReader.cpp, ApiReader::clearAll() is iterating through apiList, which is multi. In ApiReader.h, ApiReader::getScoredApi() should be declared as taking multi to match its definition in ApiReader.cpp, as it's taking iterators into apiList. This was compiling despite the single/multi mismatch because in MSVC's implementation, for both legacy hash_map and Standard unordered_map, the containers have the same iterator types regardless of single/multi, but it's still a conformance issue and should be fixed. --- CAPE/Scylla/ApiReader.cpp | 2 +- CAPE/Scylla/ApiReader.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CAPE/Scylla/ApiReader.cpp b/CAPE/Scylla/ApiReader.cpp index b66a9771..508f0308 100644 --- a/CAPE/Scylla/ApiReader.cpp +++ b/CAPE/Scylla/ApiReader.cpp @@ -1116,7 +1116,7 @@ void ApiReader::clearAll() minApiAddress = (DWORD_PTR)-1; maxApiAddress = 0; - for ( stdext::hash_map::iterator it = apiList.begin(); it != apiList.end(); ++it ) + for ( std::unordered_multimap::iterator it = apiList.begin(); it != apiList.end(); ++it ) { delete it->second; } diff --git a/CAPE/Scylla/ApiReader.h b/CAPE/Scylla/ApiReader.h index d51308d3..008e909b 100644 --- a/CAPE/Scylla/ApiReader.h +++ b/CAPE/Scylla/ApiReader.h @@ -70,6 +70,6 @@ class ApiReader : public ProcessAccessHelp bool isApiBlacklisted( const char * functionName ); bool isWinSxSModule( ModuleInfo * module ); - ApiInfo * getScoredApi(stdext::hash_map::iterator it1,size_t countDuplicates, bool hasName, bool hasUnicodeAnsiName, bool hasNoUnderlineInName, bool hasPrioDll,bool hasPrio0Dll,bool hasPrio1Dll, bool hasPrio2Dll, bool firstWin ); + ApiInfo * getScoredApi(std::unordered_multimap::iterator it1,size_t countDuplicates, bool hasName, bool hasUnicodeAnsiName, bool hasNoUnderlineInName, bool hasPrioDll,bool hasPrio0Dll,bool hasPrio1Dll, bool hasPrio2Dll, bool firstWin ); }; From 11fe56c7bdeccda1ed95e8bb8375375777239501 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 8 Oct 2025 12:51:10 -0700 Subject: [PATCH 4/4] Remove `_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS`. --- capemon.vcxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/capemon.vcxproj b/capemon.vcxproj index e01a1f72..b67161d8 100644 --- a/capemon.vcxproj +++ b/capemon.vcxproj @@ -97,7 +97,7 @@ - CUCKOODBG;WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS_DEBUG;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;%(PreprocessorDefinitions);_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS + CUCKOODBG;WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS_DEBUG;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;%(PreprocessorDefinitions) MultiThreadedDebug Level3 ProgramDatabase @@ -122,7 +122,7 @@ - CUCKOODBG;WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS_DEBUG;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;%(PreprocessorDefinitions);_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS + CUCKOODBG;WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS_DEBUG;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;%(PreprocessorDefinitions) MultiThreadedDebug Level3 ProgramDatabase @@ -145,7 +145,7 @@ - WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGSNDEBUG;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;%(PreprocessorDefinitions);_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS + WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGSNDEBUG;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;%(PreprocessorDefinitions) MultiThreaded Level3 ProgramDatabase @@ -180,7 +180,7 @@ - WIN32;_WIN64;_CRT_SECURE_NO_WARNINGS;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;%(PreprocessorDefinitions) + WIN32;_WIN64;_CRT_SECURE_NO_WARNINGS;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;%(PreprocessorDefinitions) MultiThreaded Level3 ProgramDatabase