Tools/Patcher: Removed "Connection" patch and added rsa modulus patch

This commit is contained in:
Shauren
2019-09-29 01:19:26 +02:00
committed by Ovahlord
parent 9db2b4d53f
commit d1017e1c62
6 changed files with 17 additions and 48 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
# Copyright (C) 2008-2019 TrinityCore <https://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
@@ -8,37 +8,21 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/server/shared
${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography
${CMAKE_SOURCE_DIR}/src/server/shared/Debugging
${CMAKE_SOURCE_DIR}/src/server/shared/Utilities
${OPENSSL_INCLUDE_DIR}
)
CollectSourceFiles(${CMAKE_CURRENT_SOURCE_DIR} PRIVATE_SOURCES)
set(HEADER_FILES
Helper.hpp
Patcher.hpp
Constants/BinaryTypes.hpp
Patches/Mac.hpp
Patches/Windows.hpp
Patterns/Mac.hpp
Patterns/Windows.hpp
)
if (WIN32)
list(APPEND PRIVATE_SOURCES ${sources_windows})
endif()
set(SRC_FILES
Helper.cpp
Patcher.cpp
Program.cpp
)
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(connection_patcher ${HEADER_FILES} ${SRC_FILES})
add_executable(connection_patcher ${PRIVATE_SOURCES})
target_link_libraries(connection_patcher
shared
${OPENSSL_LIBRARIES}
${Boost_LIBRARIES}
PRIVATE
trinity-core-interface
PUBLIC
common
)
if (UNIX)

View File

@@ -30,8 +30,6 @@ namespace Connection_Patcher
struct x86
{
static const std::vector<unsigned char> BNet() { return { }; }
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 { }; }
};
@@ -39,8 +37,6 @@ namespace Connection_Patcher
struct x64
{
static const std::vector<unsigned char> BNet() { return { }; }
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 { }; }
};

View File

@@ -30,8 +30,6 @@ namespace Connection_Patcher
struct x86
{
static const std::vector<unsigned char> BNet() { return { 0x89, 0x48, 0x08, 0xC7, 0x40, 0x0C, 0xD5, 0xF8, 0x7F, 0x82, 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 { 0x75 }; }
static const std::vector<unsigned char> Signature() { return { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xE9 }; }
};
@@ -39,8 +37,6 @@ namespace Connection_Patcher
struct x64
{
static const std::vector<unsigned char> BNet() { return { }; }
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 { 0x75 }; }
static const std::vector<unsigned char> Signature() { return { }; }
};

View File

@@ -30,8 +30,6 @@ namespace Connection_Patcher
struct x86
{
static const std::vector<unsigned char> BNet() { return { }; }
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 { }; }
static const std::vector<unsigned char> Signature() { return { }; }
};
@@ -39,8 +37,6 @@ namespace Connection_Patcher
struct x64
{
static const std::vector<unsigned char> BNet() { return { }; }
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 { }; }
static const std::vector<unsigned char> Signature() { return { }; }
};

View File

@@ -30,8 +30,6 @@ namespace Connection_Patcher
struct x86
{
static const std::vector<unsigned char> BNet() { return { }; }
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 { }; }
static const std::vector<unsigned char> Signature() { return { }; }
};
@@ -39,8 +37,6 @@ namespace Connection_Patcher
struct x64
{
static const std::vector<unsigned char> BNet() { return { }; }
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 { }; }
static const std::vector<unsigned char> Signature() { return { }; }
};

View File

@@ -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";
}
}