diff --git a/auth_bypass/main.cpp b/auth_bypass/main.cpp index 6e2be08..31d55f4 100644 --- a/auth_bypass/main.cpp +++ b/auth_bypass/main.cpp @@ -35,7 +35,7 @@ #define THROW_IF(expr, message) if (expr) { throw std::exception(message); } -static constexpr unsigned int Build[] = { 5875, 8606, 12340 }; +static constexpr unsigned int Build[] = { 5875, 8606, 12340, 15595 }; namespace @@ -70,6 +70,7 @@ using VER = misc::Version; extern "C" __declspec(dllexport) void Load1() { const misc::Offsets *currentVersion = nullptr; + auto cata = false; try { @@ -84,6 +85,10 @@ extern "C" __declspec(dllexport) void Load1() case Build[VER::WOTLK]: currentVersion = &misc::Versions[VER::WOTLK]; break; + case Build[VER::Cata]: + currentVersion = &misc::Versions[VER::Cata]; + cata = true; + break; default: throw std::exception("Unsupported version"); } @@ -94,12 +99,13 @@ extern "C" __declspec(dllexport) void Load1() } *const_cast(&misc::Offsets::Current) = currentVersion; - method::gMethod = std::make_unique(); + method::gMethod = std::make_unique(cata); } extern "C" __declspec(dllexport) void Load2() { const misc::Offsets *currentVersion = nullptr; + auto cata = false; try { @@ -114,6 +120,10 @@ extern "C" __declspec(dllexport) void Load2() case Build[VER::WOTLK]: currentVersion = &misc::Versions[VER::WOTLK]; break; + case Build[VER::Cata]: + currentVersion = &misc::Versions[VER::Cata]; + cata = true; + break; default: throw std::exception("Unsupported version"); } @@ -124,5 +134,5 @@ extern "C" __declspec(dllexport) void Load2() } *const_cast(&misc::Offsets::Current) = currentVersion; - method::gMethod = std::make_unique(); + method::gMethod = std::make_unique(cata); } \ No newline at end of file diff --git a/auth_bypass/method.cpp b/auth_bypass/method.cpp index 520a722..ce18312 100644 --- a/auth_bypass/method.cpp +++ b/auth_bypass/method.cpp @@ -152,28 +152,45 @@ namespace method { std::unique_ptr gMethod; -Interface::Interface() +Interface::Interface(bool cata) { const hadesmem::Process process(::GetCurrentProcessId()); - m_realmSendHook = std::make_unique>(process, - hadesmem::detail::AliasCastUnchecked(misc::Offsets::Current->WowConnection__SendRaw), - [&username = m_username] (hadesmem::PatchDetourBase *detourBase, WowConnection *realm, void *data, int len, bool disableEncryption) + if (cata) + { + m_realmSendCataHook = std::make_unique>(process, + hadesmem::detail::AliasCastUnchecked(misc::Offsets::Current->WowConnection__SendRaw), + [&username = m_username] (hadesmem::PatchDetourBase *detourBase, WowConnection *realm, void *data, int len) + { + AmmendRealmPacket(data, username); + auto const orig = detourBase->GetTrampolineT(); + return (realm->*orig)(data, len); + } + ); + + m_realmSendCataHook->Apply(); + } + else + { + m_realmSendHook = std::make_unique>(process, + hadesmem::detail::AliasCastUnchecked(misc::Offsets::Current->WowConnection__SendRaw), + [&username = m_username] (hadesmem::PatchDetourBase *detourBase, WowConnection *realm, void *data, int len, bool disableEncryption) { AmmendRealmPacket(data, username); auto const orig = detourBase->GetTrampolineT(); return (realm->*orig)(data, len, disableEncryption); } - ); + ); - m_realmSendHook->Apply(); + m_realmSendHook->Apply(); + } std::vector nopPatch(2, 0x90); m_ignoreSRP6Patch = std::make_unique(process, reinterpret_cast(misc::Offsets::Current->IgnoreServerSRP6), nopPatch); m_ignoreSRP6Patch->Apply(); } -One::One() +One::One(bool cata) : Interface(cata) { const hadesmem::Process process(::GetCurrentProcessId()); @@ -193,7 +210,7 @@ One::One() m_gruntClientLinkPatch->Apply(); } -Two::Two() +Two::Two(bool cata) : Interface(cata) { const hadesmem::Process process(::GetCurrentProcessId()); diff --git a/auth_bypass/method.hpp b/auth_bypass/method.hpp index d291021..3f165e1 100644 --- a/auth_bypass/method.hpp +++ b/auth_bypass/method.hpp @@ -43,9 +43,11 @@ class Interface }; using RealmSendT = int(__thiscall WowConnection::*)(void *data, int len, bool disableEncryption); + using RealmSendCataT = int(__thiscall WowConnection::*)(void *data, int len); private: std::unique_ptr> m_realmSendHook; + std::unique_ptr> m_realmSendCataHook; std::unique_ptr m_ignoreSRP6Patch; @@ -53,7 +55,7 @@ class Interface std::string m_username; public: - Interface(); + Interface(bool cata); const std::string &GetUsername() const { return m_username; } @@ -67,7 +69,7 @@ class One : public Interface std::unique_ptr m_gruntClientLinkPatch; public: - One(); + One(bool cata); virtual bool IsOne() const { return true; } }; @@ -92,7 +94,7 @@ class Two : public Interface std::unique_ptr> m_calculateProofHook; public: - Two(); + Two(bool cata); virtual bool IsOne() const { return false; } }; diff --git a/auth_bypass/misc.hpp b/auth_bypass/misc.hpp index b47dea4..6059288 100644 --- a/auth_bypass/misc.hpp +++ b/auth_bypass/misc.hpp @@ -62,7 +62,8 @@ enum Version { Classic = 0, TBC, - WOTLK + WOTLK, + Cata }; constexpr struct Offsets @@ -127,6 +128,21 @@ constexpr struct Offsets 0x00, 0x20, 0x48 + }, + // Cataclysm + { + 0x54E5A0, + 0xD27628, + 0xB03A36, + 0x4CF0E0, + 0xB79BB9, + 0xB3A580, + 0xA4, + 0xC8, + 0x1CC, + 0x00, + 0x20, + 0x48 } }; } \ No newline at end of file