diff --git a/CMakeLists.txt b/CMakeLists.txt index 45f3c3b..4e70b8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ file(GLOB_RECURSE INC src/*.hpp src/*.h) add_library(${PROJECT_NAME} SHARED ${SRC} ${INC}) target_include_directories(${PROJECT_NAME} PRIVATE src) +target_compile_options(${PROJECT_NAME} PRIVATE /WX /W4) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC} ${INC}) diff --git a/src/dllmain.cpp b/src/dllmain.cpp index 890ef61..9402d8f 100644 --- a/src/dllmain.cpp +++ b/src/dllmain.cpp @@ -4,7 +4,7 @@ #include "ep_patch.hpp" -BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) +BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lpReserved*/) { switch (ul_reason_for_call) { diff --git a/src/hooks/base_hook.cpp b/src/hooks/base_hook.cpp index 298d019..5886962 100644 --- a/src/hooks/base_hook.cpp +++ b/src/hooks/base_hook.cpp @@ -10,8 +10,7 @@ namespace hooks CBaseHook::CBaseHook(uint32_t Address_, uint32_t Size_) : m_StartAddress(Address_) , m_EndAddress(Address_ + Size_ - 1) - { - } + {} CBaseHook::~CBaseHook() diff --git a/src/hooks/base_hook.hpp b/src/hooks/base_hook.hpp index ed9c7c6..842f707 100644 --- a/src/hooks/base_hook.hpp +++ b/src/hooks/base_hook.hpp @@ -67,8 +67,8 @@ namespace hooks void SetInstalled(bool bState_); private: - uint32_t m_StartAddress; // Address of first byte. - uint32_t m_EndAddress; // Address of last byte. - bool m_bInstalled; // This hook is installed. + uint32_t m_StartAddress = 0; // Address of first byte. + uint32_t m_EndAddress = 0; // Address of last byte. + bool m_bInstalled = false; // This hook is installed. }; } diff --git a/src/hooks/jump_hook.hpp b/src/hooks/jump_hook.hpp index e058d11..2c24561 100644 --- a/src/hooks/jump_hook.hpp +++ b/src/hooks/jump_hook.hpp @@ -49,7 +49,7 @@ namespace hooks #pragma pack(pop) SJumpHook m_OriginalInstruction; - uint32_t m_iRawTarget; - bool m_bCallHook; + uint32_t m_iRawTarget = 0; + bool m_bCallHook = false; }; } diff --git a/src/hooks/native_function.hpp b/src/hooks/native_function.hpp index 0abe62a..fe7c75a 100644 --- a/src/hooks/native_function.hpp +++ b/src/hooks/native_function.hpp @@ -39,6 +39,6 @@ namespace hooks m_Pointer = reinterpret_cast(StartAddress_); } - Type_ m_Pointer; + Type_ m_Pointer = nullptr; }; } diff --git a/src/hooks/replace_function.hpp b/src/hooks/replace_function.hpp index 7385ddd..c87e490 100644 --- a/src/hooks/replace_function.hpp +++ b/src/hooks/replace_function.hpp @@ -49,6 +49,6 @@ namespace hooks #pragma pack(pop) SJumpHook m_Original; - uint32_t m_iRawTarget; + uint32_t m_iRawTarget = 0; }; } diff --git a/src/module_manager.hpp b/src/module_manager.hpp index 6f18ac4..ac07a71 100644 --- a/src/module_manager.hpp +++ b/src/module_manager.hpp @@ -32,5 +32,6 @@ class CModuleManager private: bool isModuleExist(const std::type_index& TI_) const; +private: std::vector>> m_vModules; }; diff --git a/src/modules/database.cpp b/src/modules/database.cpp index 12e0a9a..c2841b0 100644 --- a/src/modules/database.cpp +++ b/src/modules/database.cpp @@ -139,7 +139,7 @@ namespace modules *Dst_ = nullptr; if (g_streamPosIndex != 1) { - QASSERTFMT(g_streamDelayIndex < 0x1000, "g_streamDelayIndex doesn't index ARRAY_COUNT( g_streamDelayArray )\n\t%i not in [0, %i)", g_streamDelayIndex, 4096); + QASSERTFMT(g_streamDelayIndex < 0x1000, "g_streamDelayIndex doesn't index ARRAY_COUNT( g_streamDelayArray )\n\t%i not in [0, %i)", g_streamDelayIndex.Raw(), 4096); g_streamDelayArray[2 * g_streamDelayIndex] = (int)Src_; g_streamDelayArray[2 * g_streamDelayIndex + 1] = Size_; g_streamDelayIndex += 1; diff --git a/src/proxy_lib.hpp b/src/proxy_lib.hpp index d936687..69d6362 100644 --- a/src/proxy_lib.hpp +++ b/src/proxy_lib.hpp @@ -17,5 +17,5 @@ class CProxyLib CProxyLib(); ~CProxyLib(); - HMODULE m_hOriginalLib; + HMODULE m_hOriginalLib = nullptr; };