Skip to content

Commit

Permalink
#3
Browse files Browse the repository at this point in the history
All hooks are installed now.
Set warning level to 4, all warnings treats as errors now.
  • Loading branch information
T-Maxxx committed Jun 12, 2020
1 parent 883eca7 commit 4fa22fa
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
2 changes: 1 addition & 1 deletion src/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 1 addition & 2 deletions src/hooks/base_hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ namespace hooks
CBaseHook::CBaseHook(uint32_t Address_, uint32_t Size_)
: m_StartAddress(Address_)
, m_EndAddress(Address_ + Size_ - 1)
{
}
{}


CBaseHook::~CBaseHook()
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/base_hook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
};
}
4 changes: 2 additions & 2 deletions src/hooks/jump_hook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}
2 changes: 1 addition & 1 deletion src/hooks/native_function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ namespace hooks
m_Pointer = reinterpret_cast<Type_>(StartAddress_);
}

Type_ m_Pointer;
Type_ m_Pointer = nullptr;
};
}
2 changes: 1 addition & 1 deletion src/hooks/replace_function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ namespace hooks
#pragma pack(pop)

SJumpHook m_Original;
uint32_t m_iRawTarget;
uint32_t m_iRawTarget = 0;
};
}
1 change: 1 addition & 0 deletions src/module_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ class CModuleManager
private:
bool isModuleExist(const std::type_index& TI_) const;

private:
std::vector<std::pair<std::type_index, std::shared_ptr<CModule>>> m_vModules;
};
2 changes: 1 addition & 1 deletion src/modules/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/proxy_lib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ class CProxyLib
CProxyLib();
~CProxyLib();

HMODULE m_hOriginalLib;
HMODULE m_hOriginalLib = nullptr;
};

0 comments on commit 4fa22fa

Please sign in to comment.