diff --git a/src/tools/connection_patcher/Patches/Mac.hpp b/src/tools/connection_patcher/Patches/Mac.hpp index 9ce33b46d42..3d40225c0ee 100644 --- a/src/tools/connection_patcher/Patches/Mac.hpp +++ b/src/tools/connection_patcher/Patches/Mac.hpp @@ -27,18 +27,20 @@ namespace Connection_Patcher { namespace Mac { - struct x86 - { - static const std::vector BNet() { return { }; } - static const std::vector Password() { return { 0x0F, 0x85 }; } - static const std::vector Signature() { return { }; } - }; - struct x64 { - static const std::vector BNet() { return { }; } + static const std::vector BNet() + { + return + { + 0xB8, 0xD5, 0xF8, 0x7F, 0x82, 0x89, 0x47, 0x0C, 0xC9, 0xC3, 0x90, 0x90, 0x90, 0x90, 0x90, 0x55, + 0x48, 0x89, 0xE5, 0x48, 0xC7, 0x07, 0x00, 0x00, 0x00, 0x00, 0x48, 0xC7, 0x47, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x48, 0x8B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x07, 0x8B, 0x05, 0x00, 0x00, + 0x00, 0x00, 0x89, 0x47, 0x08, 0xEB, 0xC9, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 + }; + } static const std::vector Password() { return { 0x0F, 0x85 }; } - static const std::vector Signature() { return { }; } + static const std::vector Signature() { return { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xEB }; } }; }; } diff --git a/src/tools/connection_patcher/Patterns/Mac.hpp b/src/tools/connection_patcher/Patterns/Mac.hpp index c2a2d3e59d7..b959296fd57 100644 --- a/src/tools/connection_patcher/Patterns/Mac.hpp +++ b/src/tools/connection_patcher/Patterns/Mac.hpp @@ -27,18 +27,11 @@ namespace Connection_Patcher { namespace Mac { - struct x86 - { - static const std::vector BNet() { return { }; } - static const std::vector Password() { return { }; } - static const std::vector Signature() { return { }; } - }; - struct x64 { - static const std::vector BNet() { return { }; } - static const std::vector Password() { return { }; } - static const std::vector Signature() { return { }; } + static const std::vector BNet() { return { 0x0F, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x48, 0x89, 0xE5, 0x48, 0xC7, 0x07, 0x00, 0x00, 0x00, 0x00, 0x48, 0xC7, 0x47 }; } + static const std::vector Password() { return { 0x0F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8B, 0x45, 0x00, 0xB9, 0x40 }; } + static const std::vector Signature() { return { 0xE8, 0x00, 0x00, 0x00, 0x00, 0x84, 0xC0, 0x75, 0x00, 0x4C, 0x89, 0xEF, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8D, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48 }; } }; }; } diff --git a/src/tools/connection_patcher/Program.cpp b/src/tools/connection_patcher/Program.cpp index f8fc32b7269..416b19cdc38 100644 --- a/src/tools/connection_patcher/Program.cpp +++ b/src/tools/connection_patcher/Program.cpp @@ -300,6 +300,7 @@ int main(int argc, char** argv) break; } case Constants::BinaryTypes::Mach64: + { std::cout << "Mac client...\n"; boost::algorithm::replace_all(renamed_binary_path, ".app", " Patched.app"); @@ -310,12 +311,27 @@ int main(int argc, char** argv) do_client_patches (&patcher, renamed_binary_path); + boost::filesystem::path p(binary_path); + p.remove_filename(); + p.append("Battle.net.bundle"); + + std::string renamed_dll_path(p.string()); + Patcher bnetPatcher(p.string()); + + boost::algorithm::replace_all(renamed_dll_path, ".bundle", " Patched.bundle"); + copyDir(boost::filesystem::path(p.string()).parent_path()/*MacOS*/.parent_path()/*Contents*/.parent_path() + , boost::filesystem::path(renamed_dll_path).parent_path()/*MacOS*/.parent_path()/*Contents*/.parent_path() + ); + do_dll_patches + (&bnetPatcher, renamed_dll_path); + do_module ("97eeb2e28e9e56ed6a22d09f44e2ff43c93315e006bbad43bafc0defaa6f50ae.auth" , "/Users/Shared/Blizzard/Battle.net/Cache/" ); break; + } default: throw std::runtime_error("Type: " + std::to_string(static_cast(patcher.Type)) + " not supported!"); }