Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion polyhook2/PE/IatHook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class IatHook : public IHook {
return HookType::IAT;
}
protected:
IMAGE_THUNK_DATA* FindIatThunk(const std::string& dllName, const std::string& apiName, const std::wstring moduleName = L"");
IMAGE_THUNK_DATA* FindIatThunk(const std::string& dllName, const std::string& apiName, const std::wstring& moduleName = L"");
IMAGE_THUNK_DATA* FindIatThunkInModule(void* moduleBase, const std::string& dllName, const std::string& apiName);

std::string m_dllName;
Expand Down
6 changes: 3 additions & 3 deletions sources/IatHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ PLH::IatHook::IatHook(const std::string& dllName, const std::string& apiName, co

bool PLH::IatHook::hook() {
assert(m_userOrigVar != nullptr);
IMAGE_THUNK_DATA* pThunk = FindIatThunk(m_dllName, m_apiName);
IMAGE_THUNK_DATA* pThunk = FindIatThunk(m_dllName, m_apiName, m_moduleName);
if (pThunk == nullptr)
return false;

Expand All @@ -34,7 +34,7 @@ bool PLH::IatHook::unHook() {
if (!m_hooked)
return false;

IMAGE_THUNK_DATA* pThunk = FindIatThunk(m_dllName, m_apiName);
IMAGE_THUNK_DATA* pThunk = FindIatThunk(m_dllName, m_apiName, m_moduleName);
if (pThunk == nullptr)
return false;

Expand All @@ -45,7 +45,7 @@ bool PLH::IatHook::unHook() {
return true;
}

IMAGE_THUNK_DATA* PLH::IatHook::FindIatThunk(const std::string& dllName, const std::string& apiName, const std::wstring moduleName /* = L"" */) {
IMAGE_THUNK_DATA* PLH::IatHook::FindIatThunk(const std::string& dllName, const std::string& apiName, const std::wstring& moduleName /* = L"" */) {
#if defined(_WIN64)
PEB* peb = (PPEB)__readgsqword(0x60);
#else
Expand Down