aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2014-11-06 18:01:46 +0100
committerShauren <shauren.trinity@gmail.com>2014-11-06 18:01:46 +0100
commit7a18cc2987d5f3593124dfedf4b94c7042f2f42a (patch)
treef5149d5cb31dbe76020d45de9980b90ed404cff3
parentdb7c07246a9eff609c711971d6f98413d38be97f (diff)
Tools/Patcher: Removed "Connection" patch and added rsa modulus patch
-rw-r--r--src/tools/connection_patcher/CMakeLists.txt2
-rw-r--r--src/tools/connection_patcher/Patches/Common.hpp57
-rw-r--r--src/tools/connection_patcher/Patches/Mac.hpp2
-rw-r--r--src/tools/connection_patcher/Patches/Windows.hpp4
-rw-r--r--src/tools/connection_patcher/Patterns/Common.hpp36
-rw-r--r--src/tools/connection_patcher/Patterns/Mac.hpp2
-rw-r--r--src/tools/connection_patcher/Patterns/Windows.hpp4
-rw-r--r--src/tools/connection_patcher/Program.cpp11
8 files changed, 101 insertions, 17 deletions
diff --git a/src/tools/connection_patcher/CMakeLists.txt b/src/tools/connection_patcher/CMakeLists.txt
index 7af523589f7..b4fffdcb776 100644
--- a/src/tools/connection_patcher/CMakeLists.txt
+++ b/src/tools/connection_patcher/CMakeLists.txt
@@ -21,8 +21,10 @@ set(HEADER_FILES
Helper.hpp
Patcher.hpp
Constants/BinaryTypes.hpp
+ Patches/Common.hpp
Patches/Mac.hpp
Patches/Windows.hpp
+ Patterns/Common.hpp
Patterns/Mac.hpp
Patterns/Windows.hpp
)
diff --git a/src/tools/connection_patcher/Patches/Common.hpp b/src/tools/connection_patcher/Patches/Common.hpp
new file mode 100644
index 00000000000..9741e61f5a9
--- /dev/null
+++ b/src/tools/connection_patcher/Patches/Common.hpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2012-2014 Arctium Emulation <http://arctium.org>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef CONNECTION_PATCHER_PATCHES_COMMON_HPP
+#define CONNECTION_PATCHER_PATCHES_COMMON_HPP
+
+#include <vector>
+
+namespace Connection_Patcher
+{
+ namespace Patches
+ {
+ struct Common
+ {
+ static const std::vector<unsigned char> Portal() { return { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; }
+ static const std::vector<unsigned char> Modulus()
+ {
+ return
+ {
+ 0x5F, 0xD6, 0x80, 0x0B, 0xA7, 0xFF, 0x01, 0x40, 0xC7, 0xBC, 0x8E, 0xF5, 0x6B, 0x27, 0xB0, 0xBF,
+ 0xF0, 0x1D, 0x1B, 0xFE, 0xDD, 0x0B, 0x1F, 0x3D, 0xB6, 0x6F, 0x1A, 0x48, 0x0D, 0xFB, 0x51, 0x08,
+ 0x65, 0x58, 0x4F, 0xDB, 0x5C, 0x6E, 0xCF, 0x64, 0xCB, 0xC1, 0x6B, 0x2E, 0xB8, 0x0F, 0x5D, 0x08,
+ 0x5D, 0x89, 0x06, 0xA9, 0x77, 0x8B, 0x9E, 0xAA, 0x04, 0xB0, 0x83, 0x10, 0xE2, 0x15, 0x4D, 0x08,
+ 0x77, 0xD4, 0x7A, 0x0E, 0x5A, 0xB0, 0xBB, 0x00, 0x61, 0xD7, 0xA6, 0x75, 0xDF, 0x06, 0x64, 0x88,
+ 0xBB, 0xB9, 0xCA, 0xB0, 0x18, 0x8B, 0x54, 0x13, 0xE2, 0xCB, 0x33, 0xDF, 0x17, 0xD8, 0xDA, 0xA9,
+ 0xA5, 0x60, 0xA3, 0x1F, 0x4E, 0x27, 0x05, 0x98, 0x6F, 0xAA, 0xEE, 0x14, 0x3B, 0xF3, 0x97, 0xA8,
+ 0x12, 0x02, 0x94, 0x0D, 0x84, 0xDC, 0x0E, 0xF1, 0x76, 0x23, 0x95, 0x36, 0x13, 0xF9, 0xA9, 0xC5,
+ 0x48, 0xDB, 0xDA, 0x86, 0xBE, 0x29, 0x22, 0x54, 0x44, 0x9D, 0x9F, 0x80, 0x7B, 0x07, 0x80, 0x30,
+ 0xEA, 0xD2, 0x83, 0xCC, 0xCE, 0x37, 0xD1, 0xD1, 0xCF, 0x85, 0xBE, 0x91, 0x25, 0xCE, 0xC0, 0xCC,
+ 0x55, 0xC8, 0xC0, 0xFB, 0x38, 0xC5, 0x49, 0x03, 0x6A, 0x02, 0xA9, 0x9F, 0x9F, 0x86, 0xFB, 0xC7,
+ 0xCB, 0xC6, 0xA5, 0x82, 0xA2, 0x30, 0xC2, 0xAC, 0xE6, 0x98, 0xDA, 0x83, 0x64, 0x43, 0x7F, 0x0D,
+ 0x13, 0x18, 0xEB, 0x90, 0x53, 0x5B, 0x37, 0x6B, 0xE6, 0x0D, 0x80, 0x1E, 0xEF, 0xED, 0xC7, 0xB8,
+ 0x68, 0x9B, 0x4C, 0x09, 0x7B, 0x60, 0xB2, 0x57, 0xD8, 0x59, 0x8D, 0x7F, 0xEA, 0xCD, 0xEB, 0xC4,
+ 0x60, 0x9F, 0x45, 0x7A, 0xA9, 0x26, 0x8A, 0x2F, 0x85, 0x0C, 0xF2, 0x19, 0xC6, 0x53, 0x92, 0xF7,
+ 0xF0, 0xB8, 0x32, 0xCB, 0x5B, 0x66, 0xCE, 0x51, 0x54, 0xB4, 0xC3, 0xD3, 0xD4, 0xDC, 0xB3, 0xEE
+ };
+ }
+ };
+ }
+}
+
+#endif
diff --git a/src/tools/connection_patcher/Patches/Mac.hpp b/src/tools/connection_patcher/Patches/Mac.hpp
index 4080dc937d6..b1e4853c64e 100644
--- a/src/tools/connection_patcher/Patches/Mac.hpp
+++ b/src/tools/connection_patcher/Patches/Mac.hpp
@@ -30,8 +30,6 @@ namespace Connection_Patcher
struct x64
{
static const std::vector<unsigned char> BNet () { return { 0xB8, 0xD5, 0xF8, 0x7F, 0x82, 0x89, 0x47, 0x0C, 0x5D, 0xC3, 0x90, 0x90, 0x90 }; }
- static const std::vector<unsigned char> Portal () { return { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; }
- static const std::vector<unsigned char> Connect () { return { }; }
static const std::vector<unsigned char> Password () { return { 0x0F, 0x85 }; }
static const std::vector<unsigned char> Signature() { return { 0x45, 0x31, 0xED, 0x4D, 0x89, 0xFC, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xEB }; }
};
diff --git a/src/tools/connection_patcher/Patches/Windows.hpp b/src/tools/connection_patcher/Patches/Windows.hpp
index deb2041352a..0f4ffb93dac 100644
--- a/src/tools/connection_patcher/Patches/Windows.hpp
+++ b/src/tools/connection_patcher/Patches/Windows.hpp
@@ -30,8 +30,6 @@ namespace Connection_Patcher
struct x86
{
static const std::vector<unsigned char> BNet () { return { 0xC7, 0x40, 0x0C, 0xD5, 0xF8, 0x7F, 0x82 }; }
- static const std::vector<unsigned char> Portal () { return { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; }
- static const std::vector<unsigned char> Connect () { return { 0xEB }; }
static const std::vector<unsigned char> Password () { return { 0x75 }; }
static const std::vector<unsigned char> Signature() { return { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xEB }; }
};
@@ -39,8 +37,6 @@ namespace Connection_Patcher
struct x64
{
static const std::vector<unsigned char> BNet () { return { 0xB8, 0xD5, 0xF8, 0x7F, 0x82, 0x89, 0x41, 0x0C, 0x48, 0x8B, 0xC1, 0xC3 }; }
- static const std::vector<unsigned char> Portal () { return { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; }
- static const std::vector<unsigned char> Connect () { return { 0xEB }; }
static const std::vector<unsigned char> Password () { return { 0x75 }; }
static const std::vector<unsigned char> Signature() { return { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xE9 }; }
};
diff --git a/src/tools/connection_patcher/Patterns/Common.hpp b/src/tools/connection_patcher/Patterns/Common.hpp
new file mode 100644
index 00000000000..94c4a220a57
--- /dev/null
+++ b/src/tools/connection_patcher/Patterns/Common.hpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2012-2014 Arctium Emulation <http://arctium.org>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef CONNECTION_PATCHER_PATTERNS_COMMON_HPP
+#define CONNECTION_PATCHER_PATTERNS_COMMON_HPP
+
+#include <vector>
+
+namespace Connection_Patcher
+{
+ namespace Patterns
+ {
+ struct Common
+ {
+ static const std::vector<unsigned char> Portal() { return { '.', 'l', 'o', 'g', 'o', 'n', '.', 'b', 'a', 't', 't', 'l', 'e', '.', 'n', 'e', 't', 0x00 }; }
+ static const std::vector<unsigned char> Modulus() { return { 0x91, 0xD5, 0x9B, 0xB7, 0xD4, 0xE1, 0x83, 0xA5 }; }
+ };
+ }
+}
+
+#endif
diff --git a/src/tools/connection_patcher/Patterns/Mac.hpp b/src/tools/connection_patcher/Patterns/Mac.hpp
index b4cbacd8a7c..f55472b06f3 100644
--- a/src/tools/connection_patcher/Patterns/Mac.hpp
+++ b/src/tools/connection_patcher/Patterns/Mac.hpp
@@ -30,8 +30,6 @@ namespace Connection_Patcher
struct x64
{
static const std::vector<unsigned char> BNet () { return { 0x8B, 0x06, 0x89, 0x47, 0x0C, 0x5D, 0xC3 }; }
- static const std::vector<unsigned char> Portal () { return { '.', 'l', 'o', 'g', 'o', 'n', '.', 'b', 'a', 't', 't', 'l', 'e', '.', 'n', 'e', 't', 0x00 }; }
- static const std::vector<unsigned char> Connect () { return { }; }
static const std::vector<unsigned char> Password () { return { 0x0F, 0x84, 0x00, 0xFF, 0xFF, 0xFF, 0x49, 0x8B, 0x45, 0x00, 0xB9, 0x40 }; }
static const std::vector<unsigned char> Signature() { return { 0xE8, 0x00, 0x00, 0x00, 0x00, 0x45, 0x31, 0xED, 0x4D, 0x89, 0xFC, 0x84, 0xC0, 0x75 }; }
};
diff --git a/src/tools/connection_patcher/Patterns/Windows.hpp b/src/tools/connection_patcher/Patterns/Windows.hpp
index 9a8b14e137b..2cad97541e3 100644
--- a/src/tools/connection_patcher/Patterns/Windows.hpp
+++ b/src/tools/connection_patcher/Patterns/Windows.hpp
@@ -30,8 +30,6 @@ namespace Connection_Patcher
struct x86
{
static const std::vector<unsigned char> BNet () { return { 0x8B, 0x75, 0x08, 0x8D, 0x78, 0x0C }; }
- static const std::vector<unsigned char> Portal () { return { '.', 'l', 'o', 'g', 'o', 'n', '.', 'b', 'a', 't', 't', 'l', 'e', '.', 'n', 'e', 't', 0x00 }; }
- static const std::vector<unsigned char> Connect () { return { 0x74, 0x33, 0x6A, 0x04, 0xFF, 0x75, 0xF8 }; }
static const std::vector<unsigned char> Password () { return { 0x74, 0x89, 0x8B, 0x16, 0x8B, 0x42, 0x04 }; }
static const std::vector<unsigned char> Signature() { return { 0xE8, 0x00, 0x00, 0x00, 0x00, 0x84, 0xC0, 0x75, 0x5F, 0x33, 0xC0 }; }
};
@@ -39,8 +37,6 @@ namespace Connection_Patcher
struct x64
{
static const std::vector<unsigned char> BNet () { return { 0x8B, 0x02, 0x89, 0x41, 0x0C, 0x48, 0x8B, 0xC1, 0xC3 }; }
- static const std::vector<unsigned char> Portal () { return { '.', 'l', 'o', 'g', 'o', 'n', '.', 'b', 'a', 't', 't', 'l', 'e', '.', 'n', 'e', 't', 0x00 }; }
- static const std::vector<unsigned char> Connect () { return { 0x74, 0x2C, 0x48, 0x8D, 0x4C, 0x24, 0x78 }; }
static const std::vector<unsigned char> Password () { return { 0x74, 0x84, 0x48, 0x8B, 0x03 }; }
static const std::vector<unsigned char> Signature() { return { 0xE8, 0x00, 0x00, 0x00, 0x00, 0x84, 0xC0, 0x0F, 0x85, 0x88, 0x00, 0x00, 0x00, 0x45, 0x33, 0xC0 }; }
};
diff --git a/src/tools/connection_patcher/Program.cpp b/src/tools/connection_patcher/Program.cpp
index 539c6093d53..9513e2da486 100644
--- a/src/tools/connection_patcher/Program.cpp
+++ b/src/tools/connection_patcher/Program.cpp
@@ -18,8 +18,10 @@
#include "Helper.hpp"
#include "Patcher.hpp"
+#include "Patches/Common.hpp"
#include "Patches/Mac.hpp"
#include "Patches/Windows.hpp"
+#include "Patterns/Common.hpp"
#include "Patterns/Mac.hpp"
#include "Patterns/Windows.hpp"
@@ -75,18 +77,17 @@ namespace Connection_Patcher
template<typename PATCH, typename PATTERN>
void do_patches(Patcher* patcher, boost::filesystem::path output)
{
+ std::cout << "patching Portal\n";
+ patcher->Patch(Patches::Common::Portal(), Patterns::Common::Portal());
+ std::cout << "patching redirect RSA Modulus\n";
+ patcher->Patch(Patches::Common::Modulus(), Patterns::Common::Modulus());
std::cout << "patching BNet\n";
patcher->Patch(PATCH::BNet(), PATTERN::BNet());
- std::cout << "patching Portal\n";
- patcher->Patch(PATCH::Portal(), PATTERN::Portal());
- std::cout << "patching Connect\n";
- patcher->Patch(PATCH::Connect(), PATTERN::Connect());
std::cout << "patching Signature\n";
patcher->Patch(PATCH::Signature(), PATTERN::Signature());
patcher->Finish(output);
std::cout << "Patching done.\n";
-
}
}