Skip to content

Commit

Permalink
Fix exe detection for auto hook
Browse files Browse the repository at this point in the history
  • Loading branch information
BttrDrgn committed May 12, 2022
1 parent 7727e49 commit 96a677a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/app/hook/hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,19 @@ int CALLBACK hook::get_window(HWND hWnd, LPARAM lparam)

if (hook::auto_refresh)
{
for (const std::string& hook : hook::auto_hook)
for (std::string hook : hook::auto_hook)
{
//Make the detection lowercase
logger::to_lower(hook);

process_t proc = hook::processes[hook::processes.size() - 1];

if (proc.exe.find(hook))
std::vector<std::string> temp = logger::split(proc.exe, '\\');
std::string final_exe = temp[temp.size() - 1];
//Make the exe lowercase for comparison
logger::to_lower(final_exe);

if (!final_exe.compare(hook))
{
if (hook::injected_apps.size() > 0)
{
Expand Down
16 changes: 16 additions & 0 deletions src/utils/logger/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,20 @@ class logger

return output;
}

static void to_lower(std::string& string)
{
std::for_each(string.begin(), string.end(), ([](char& c)
{
c = std::tolower(c);
}));
}

static void yo_upper(std::string& string)
{
std::for_each(string.begin(), string.end(), ([](char& c)
{
c = std::toupper(c);
}));
}
};

0 comments on commit 96a677a

Please sign in to comment.