diff --git a/include/memory.hpp b/include/memory.hpp index d822931..c8b3efc 100644 --- a/include/memory.hpp +++ b/include/memory.hpp @@ -35,7 +35,9 @@ namespace Memory uint8_t* wchar_Scan(void* module, const wchar_t* value); uint8_t* u32_Scan(void* module, uint32_t value); uint8_t* u64_Scan(void* module, uint64_t value); +#if !defined(WINXP) std::string GetVersionString(); std::vector string_to_ints(const std::string& s, char delimiter); std::wstring GetVersionProductName(); +#endif } diff --git a/source/CrysisWarhead.Patches/CMakeLists.txt b/source/CrysisWarhead.Patches/CMakeLists.txt index 8ba6873..7e4dfb2 100644 --- a/source/CrysisWarhead.Patches/CMakeLists.txt +++ b/source/CrysisWarhead.Patches/CMakeLists.txt @@ -3,6 +3,8 @@ string(REPLACE " " "_" ProjectId ${PROJECT_NAME}) project(${PROJECT_NAME}) include(win32) +ADD_DEFINITIONS(-DWINXP) + file(GLOB SOURCES "*.cpp" "*.h" @@ -11,6 +13,13 @@ file(GLOB SOURCES "../../include/*.hpp") add_library(${PROJECT_NAME} SHARED ${SOURCES}) +# static link c runtime for +# hopefully compatibility with nt 5.2 x64 +set_property(TARGET ${PROJECT_NAME} + PROPERTY + MSVC_RUNTIME_LIBRARY + "MultiThreaded$<$:Debug>") + include(win32_install) install( diff --git a/source/Shared/helper.cpp b/source/Shared/helper.cpp index 055141f..28f045e 100644 --- a/source/Shared/helper.cpp +++ b/source/Shared/helper.cpp @@ -392,6 +392,8 @@ void SendInputWrapper(WORD inputKey) #define str(s) #s #define xstr(s) str(s) +#if !defined(WINXP) + static void CooldownDefault(const wchar_t* inifile) { HANDLE fd = CreateFile(inifile, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); @@ -470,3 +472,4 @@ void CheckScriptFile() } } } +#endif diff --git a/source/Shared/memory.cpp b/source/Shared/memory.cpp index 716cf69..3782691 100644 --- a/source/Shared/memory.cpp +++ b/source/Shared/memory.cpp @@ -394,6 +394,7 @@ namespace Memory return nullptr; } +#if !defined(WINXP) std::string GetVersionString() { auto hInst = GetModuleHandle(NULL); @@ -462,4 +463,5 @@ namespace Memory VerQueryValue(buffer.data(), query, (LPVOID*)&p, &n_chars); return std::wstring(p, p + n_chars); } +#endif }