Skip to content

Commit

Permalink
Added Cataclysm support
Browse files Browse the repository at this point in the history
  • Loading branch information
namreeb committed Apr 24, 2017
1 parent 474b817 commit 7443cdc
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 15 deletions.
16 changes: 13 additions & 3 deletions auth_bypass/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -70,6 +70,7 @@ using VER = misc::Version;
extern "C" __declspec(dllexport) void Load1()
{
const misc::Offsets *currentVersion = nullptr;
auto cata = false;

try
{
Expand All @@ -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");
}
Expand All @@ -94,12 +99,13 @@ extern "C" __declspec(dllexport) void Load1()
}

*const_cast<const misc::Offsets **>(&misc::Offsets::Current) = currentVersion;
method::gMethod = std::make_unique<method::One>();
method::gMethod = std::make_unique<method::One>(cata);
}

extern "C" __declspec(dllexport) void Load2()
{
const misc::Offsets *currentVersion = nullptr;
auto cata = false;

try
{
Expand All @@ -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");
}
Expand All @@ -124,5 +134,5 @@ extern "C" __declspec(dllexport) void Load2()
}

*const_cast<const misc::Offsets **>(&misc::Offsets::Current) = currentVersion;
method::gMethod = std::make_unique<method::Two>();
method::gMethod = std::make_unique<method::Two>(cata);
}
33 changes: 25 additions & 8 deletions auth_bypass/method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,28 +152,45 @@ namespace method
{
std::unique_ptr<method::Interface> gMethod;

Interface::Interface()
Interface::Interface(bool cata)
{
const hadesmem::Process process(::GetCurrentProcessId());

m_realmSendHook = std::make_unique<hadesmem::PatchDetour<RealmSendT>>(process,
hadesmem::detail::AliasCastUnchecked<RealmSendT>(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<hadesmem::PatchDetour<RealmSendCataT>>(process,
hadesmem::detail::AliasCastUnchecked<RealmSendCataT>(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<RealmSendCataT>();
return (realm->*orig)(data, len);
}
);

m_realmSendCataHook->Apply();
}
else
{
m_realmSendHook = std::make_unique<hadesmem::PatchDetour<RealmSendT>>(process,
hadesmem::detail::AliasCastUnchecked<RealmSendT>(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<RealmSendT>();
return (realm->*orig)(data, len, disableEncryption);
}
);
);

m_realmSendHook->Apply();
m_realmSendHook->Apply();
}

std::vector<std::uint8_t> nopPatch(2, 0x90);
m_ignoreSRP6Patch = std::make_unique<hadesmem::PatchRaw>(process, reinterpret_cast<PVOID>(misc::Offsets::Current->IgnoreServerSRP6), nopPatch);
m_ignoreSRP6Patch->Apply();
}

One::One()
One::One(bool cata) : Interface(cata)
{
const hadesmem::Process process(::GetCurrentProcessId());

Expand All @@ -193,7 +210,7 @@ One::One()
m_gruntClientLinkPatch->Apply();
}

Two::Two()
Two::Two(bool cata) : Interface(cata)
{
const hadesmem::Process process(::GetCurrentProcessId());

Expand Down
8 changes: 5 additions & 3 deletions auth_bypass/method.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,19 @@ 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<hadesmem::PatchDetour<RealmSendT>> m_realmSendHook;
std::unique_ptr<hadesmem::PatchDetour<RealmSendCataT>> m_realmSendCataHook;

std::unique_ptr<hadesmem::PatchRaw> m_ignoreSRP6Patch;

protected:
std::string m_username;

public:
Interface();
Interface(bool cata);

const std::string &GetUsername() const { return m_username; }

Expand All @@ -67,7 +69,7 @@ class One : public Interface
std::unique_ptr<hadesmem::PatchRaw> m_gruntClientLinkPatch;

public:
One();
One(bool cata);

virtual bool IsOne() const { return true; }
};
Expand All @@ -92,7 +94,7 @@ class Two : public Interface
std::unique_ptr<hadesmem::PatchDetour<CalculateProofT>> m_calculateProofHook;

public:
Two();
Two(bool cata);

virtual bool IsOne() const { return false; }
};
Expand Down
18 changes: 17 additions & 1 deletion auth_bypass/misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ enum Version
{
Classic = 0,
TBC,
WOTLK
WOTLK,
Cata
};

constexpr struct Offsets
Expand Down Expand Up @@ -127,6 +128,21 @@ constexpr struct Offsets
0x00,
0x20,
0x48
},
// Cataclysm
{
0x54E5A0,
0xD27628,
0xB03A36,
0x4CF0E0,
0xB79BB9,
0xB3A580,
0xA4,
0xC8,
0x1CC,
0x00,
0x20,
0x48
}
};
}

0 comments on commit 7443cdc

Please sign in to comment.