Skip to content

Commit

Permalink
Detect more skinhacks
Browse files Browse the repository at this point in the history
  • Loading branch information
moonshadow565 committed Jun 6, 2023
1 parent 9851650 commit 7715ce6
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions cslol-tools/lib/lol/patcher/patcher_win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ struct CodePayload {
extern "C" {
extern void* GetModuleHandleA(char const* name);
extern void* GetProcAddress(void* module, char const* name);
extern void* FindWindowExA(void* parent, void* after, char const* klass, char const* name);
}

struct Kernel32 {
Expand Down Expand Up @@ -270,9 +271,29 @@ struct Context {
}
};

static bool skinhack_detected() {
std::error_code ec = {};
return fs::exists("C:/Fraps/LOLPRO.exe", ec);
// I know it is tempting to remove this but:
// - modskinpro hooks some of the functions we hook as well
// - skin changers asume default skin which most of proper custom skins use
// this in turns make any people go "wHy No WeRk??"
static auto skinhack_detected() -> char const* {
static constexpr char const* forbiden_files[] = {
"C:/Fraps/LOLPRO.exe",
"C:/Fraps/data",
};
static constexpr char const* forbiden_titles[] = {
"R3nzSkin",
};
for (auto item : forbiden_files) {
if (std::error_code ec = {}; fs::exists(item, ec)) {
return item;
}
}
for (auto item : forbiden_titles) {
if (FindWindowExA(nullptr, nullptr, nullptr, item)) {
return item;
}
}
return nullptr;
}

[[noreturn]] static void newpatch_detected() {
Expand Down

0 comments on commit 7715ce6

Please sign in to comment.