Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Tutorials => Topic started by: stoneharry on May 11, 2012, 10:03:56 pm

Title: [TUTORIAL] Sending Patches To The Client Through The WoW App
Post by: stoneharry on May 11, 2012, 10:03:56 pm
(http://dl.dropbox.com/u/1102355/Read/cover.jpg)

With Schlumpf's (http://modcraft.io/memberlist.php?mode=viewprofile&u=59") guidance I was able to successfully implement a way to send custom patches to the client through WoW rather than a custom launcher.

The implications for this are quite clear. It allows one to:

I wrote up a guide to do this which Schlumpf (http://modcraft.io/memberlist.php?mode=viewprofile&u=59) has heavily edited to create a, hopefully, useful publication.

The link to this can be found here: https://www.dropbox.com/s/fovh9mtrj9tgqd4/Implementing%20in-client%20patching%20for%20World%20of%20Warcraft.pdf?dl=0

~Harry & Schlumpf

Edit: 21/06/2014:

You will have to edit the binary to allow unsigned patches: <!-- l -->viewtopic.php?f=59&t=1829 (http://modcraft.io/viewtopic.php?f=59&t=1829" onclick="window.open(this.href);return false;)<!-- l -->

This is my code changes for a more recent TrinityCore version in order to get patching to work: <!-- m -->https://dl.dropboxusercontent.com/u/110 ... nity.patch (https://dl.dropboxusercontent.com/u/1102355/Patching-Trinity.patch" onclick="window.open(this.href);return false;)<!-- m -->
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW App
Post by: schlumpf on May 12, 2012, 12:44:20 am
You may want to add links to code excerpts or even the whole zip for ease of copying.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW App
Post by: Eluo on May 12, 2012, 12:45:56 am
Awsome guys!

You sure you just want to keep it at drop boxs?
You could also upload it to the forum if you want to.
Very nice.
Thanks to both of you!
PS:I corrected your links btw.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW App
Post by: stoneharry on May 12, 2012, 12:49:40 am
Thanks, yeah when I posted this before I was ready by mistake. Now every time I try to edit the post it disapproves the post. FML.

http://dl.dropbox.com/u/1102355/PatchThroughClient.zip (http://dl.dropbox.com/u/1102355/PatchThroughClient.zip" onclick="window.open(this.href);return false;)

That is the full archive.

Also attached to this post.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: glararan on May 12, 2012, 12:45:30 pm
Did you test it only on ArcEmu or Trinity?
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: stoneharry on May 12, 2012, 01:54:52 pm
Quote from: "glararan"
Did you test it only on ArcEmu or Trinity?

I tested it on ArcEmu, and Schlumpf tested it on TrinityCore.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: Mjollna on May 12, 2012, 10:56:20 pm
I add the change for Windows 335a binary.
Huge thanks to Schlumpf for all the help and explanations.

Code: [Select]
55 push ebp
8B EC mov ebp, esp

B9 05 00 00 00 mov ecx, 5
8B 45 0C mov eax, [ebp+authresult]
89 08 mov [eax], ecx

B8 01 00 00 00 mov eax, 1

5D pop ebp
C2 18 00 retn 18h
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: XxXGenesisXxX on May 13, 2012, 12:31:55 pm
This is epic work guys. It's been needed for quite some time. Personally really don't like launchers at all. Thanks for sharing.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: schlumpf on May 13, 2012, 02:44:35 pm
Quote from: "XxXGenesisXxX"
This is epic work guys. It's been needed for quite some time. Personally really don't like launchers at all. Thanks for sharing.
The sad part is that this technique is known and working since years but emulator people never correctly implemented it.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: Jameyboor on December 07, 2012, 09:00:10 am
getting a patch error on the trinity core diff patch .

line 769 : corrupt patch
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: stoneharry on December 07, 2012, 09:21:26 am
Quote from: "Jameyboor"
getting a patch error on the trinity core diff patch .

line 769 : corrupt patch

You'll need to apply it manually.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: davidfaca on January 02, 2013, 03:40:24 pm
I've compiled trinitycore with the patch, modified the wow.exe to allow the MPQ, made the patch and authserver loads it. But when I try to login I just get an unable to validate game version message and it does not go further.

I'm using 3.3.5a esES.

thanks.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: akriso on January 13, 2013, 07:21:59 pm
it really works well? :shock:
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: Namamazu on October 30, 2013, 05:21:33 am
For some reason that  i cant fathom, 'usleep(1000);' in the diff script for Trinity is unrecognized.

Error 3 error C3861: 'usleep': identifier not found D:Trinity335srcserverauthserverServerAuthSocket.cpp 458 1 authserver

any ideas?
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: schlumpf on October 30, 2013, 10:13:39 am
use Sleep(1);
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: Swampdog on December 31, 2013, 02:49:40 am
Anyone have a Trinity patch for this that works since they redid logging?  In August of 2012 the TrinityCore community was told there would be something added to the wiki to help people understand the logging system changes but it must not have been important enough to actually get done.  :(

I am attempting to manually patch into my copy of the Stable TDB335.51 (2013/02/14) that I am using..  I have everything patched in.  But when I go to compile it, I get a bunch of fatal errors centered around the logging, mainly "error C2039: 'outString' : is not a member of 'Log'" and one "error C2039: 'outStaticDebug' : is not a member of 'Log'"

I looked in Log.h and Log.cpp to try to grasp what functions I might need to replace them with.  In the Log class I see that they added LOG_FILTER_TYPE in the parameters but again, no real documentation anywhere on what those might be.

While a patch using the new logging system would be awesome, I'm not opposed to figuring this out on my own if I need to.  After several hours searching the Trinity forums and trying to get a grasp on what I might need to do, I could really use a nudge in the right direction.  Or if this "phantom" documentation exists somewhere, a link would rock!

Thanks in advance if anyone is able to help! :)
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: schlumpf on December 31, 2013, 10:08:48 am
Just remove those logging related lines. Logging isn't important.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: Swampdog on December 31, 2013, 10:25:13 am
Quote from: "schlumpf"
Just remove those logging related lines. Logging isn't important.

Thanks Schlumpf!  I had hoped to keep them for debugging purposes.  But knowing they aren't critical and that I can remove them helps.  I'll comment them out for now in case I can find out more about the logging system later..  Or maybe even just convert them to generic outInfo messages without worrying about all the different variables and such that were passed through in the messages before.  But then I guess I'd have to figure out the whole LOG_FILTER_TYPES and how to modify it in the worldserver.conf for logging..  lol

Thanks again for your response!  You rock! :)
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: Jpp on March 09, 2014, 10:00:16 pm
I followed the tutorial, but I ran into an issue related to logging on to the server.

Here is the error.
i(.)imgur(.)com/9XOiSCy(.)png

I seem to have tracked it down to these lines if this is any help.
pastebin(.)com/6p7EnF5t

In the core folder I have the folder called 'patches' with a MPQ file inside it called '12340-enUS', my client being 12340 as well.

I got my hands on a client patched to 12346, and tried to change allowed patches to 12347 instead of 12341, and change the name of the MPQ too, but it didn't work, so I doubt it's related to the client, but again, I could be wrong.

Thanks,
Jpp
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: stoneharry on March 09, 2014, 10:25:26 pm
Quote from: "Jpp"
I followed the tutorial, but I ran into an issue related to logging on to the server.

Here is the error.
i(.)imgur(.)com/9XOiSCy(.)png

I seem to have tracked it down to these lines if this is any help.
pastebin(.)com/6p7EnF5t

In the core folder I have the folder called 'patches' with a MPQ file inside it called '12340-enUS', my client being 12340 as well.

I got my hands on a client patched to 12346, and tried to change allowed patches to 12347 instead of 12341, and change the name of the MPQ too, but it didn't work, so I doubt it's related to the client, but again, I could be wrong.

Thanks,
Jpp

Pretty sure it needs to be 12340enUS.mpq. Can't remember off the top of my head. Trace the find patch function in the if statement you linked.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: Jpp on March 09, 2014, 10:33:56 pm
Quote from: "stoneharry"
Pretty sure it needs to be 12340enUS.mpq. Can't remember off the top of my head. Trace the find patch function in the if statement you linked.

Already checked that.
pastebin(.)com/89VBWrLJ

Thanks though.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: tehrob on April 08, 2014, 01:53:10 pm
I've got the same Problem.

Patch is definatly named correct and the authserver loads the Patch.
Clients says, unable to validate Game Version.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: stoneharry on April 08, 2014, 04:21:37 pm
Quote from: "tehrob"
I've got the same Problem.

Patch is definatly named correct and the authserver loads the Patch.
Clients says, unable to validate Game Version.

The TrinityCore code is based of the 2011 code base. http://pastebin.com/0BwqxVGf (http://pastebin.com/0BwqxVGf" onclick="window.open(this.href);return false;)

TrinityCore have most likely updated it somehow now that requires different changes to be made. Put a debugger in and follow through the code to see what is happening. A condition could not be being matched and/or the entire patching process not being initialized. *shrug*
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: akriso on April 11, 2014, 02:05:43 am
after downloading patch i have patch.mpq for example - how automaticly rename it to wow-update-base-15596.mpq and put to data  for example?
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: stoneharry on June 21, 2014, 08:05:59 pm
This is my updated code on my local branch of TrinityCore that has patching working:

https://dl.dropboxusercontent.com/u/110 ... nity.patch (https://dl.dropboxusercontent.com/u/1102355/Patching-Trinity.patch" onclick="window.open(this.href);return false;)
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: Leroy on July 27, 2014, 11:29:44 am
The newest patch for trinitycore is not working for me. I think that code of trinitycore has recently changed.
Some files of trinitycore can´t be patched. (Main.cpp , AuthSocket.cpp, AuthCodes.cpp)    :cry:  (I have the newest trinitycore).
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: stoneharry on July 27, 2014, 01:20:53 pm
Quote from: "Leroy"
The newest patch for trinitycore is not working for me. I think that code of trinitycore has recently changed.
Some files of trinitycore can´t be patched. (Main.cpp , AuthSocket.cpp, AuthCodes.cpp)    :cry:  (I have the newest trinitycore).

Have you tried manually merging it? I doubt they've changed it that much.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: Leroy on July 27, 2014, 03:52:32 pm
Thank you , it works now ... but I have a  two questions.  The first one is Where should I setup a path to custom patch. (Core ? in define ?) and The second one is What syntax shoud have the name of patch file.

I am using Linux (debian) , compilation of core was succesfull.  I have folder "patches" in my "bin"(where i have authserver and worldserver) folder and there I have custom patch (Patch-x.mpq ..I have tried 12340-enUS.mpq too), but when I log in nothing happens. I have modified wow.exe too. In the auth console is only  "Entering _HandleLogonProof".
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: stoneharry on July 27, 2014, 06:06:51 pm
Update AuthCodes to deny 12340 as a build.

Path is:
Code: [Select]
+#ifndef _WIN32
+#define PATCH_PATH "../var/patches/"
+#else
+#define PATCH_PATH "./patches/"
+#endif

So if windows, just make a folder called patches. If not windows, ../var/patches. I am not sure what linux is for ../ but I assume it is the same as windows - back a directory, vars folder, patches folder.

Patch name should look something like this:

12340-enGB.mpq
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: Leroy on July 27, 2014, 06:38:13 pm
Okay, so authserver has found new patches , I have commented line
{12340, 3, 3, 5, 'a'},
from
RealmBuildInfo const PostBcAcceptedClientBuilds[] ...

so it looks now

    static RealmBuildInfo const PostBcAcceptedClientBuilds[] =
    {
    //{12340, 3, 3, 5, 'a'},
        {0,     0, 0, 0, ' '}                                   // terminator
    };


When I log in,  downloading starts , but then it shows message box "Patch Required, press the restart button below to exit World of Warcraft and download the patch."  When I click on restart button it shows message box "Failed to apply patch..." , after restart game still not working.

Output in console:

Client with version 12340 and locale enUS (53556e65) looking for patch.
Client with version 12340 and locale enUS (53556e65) looking for patch.
Patch: ../var/patches/12340-enUS.mpq
PatcherRunnable::run(): 0 -> 65580
patcher done.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: stoneharry on July 27, 2014, 07:20:14 pm
The server side changes are working fine then. You need to disable the client check for Blizzard signed patches and make sure the patch is formatted correctly.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: Leroy on July 27, 2014, 07:44:38 pm
hm... I recently changed sleep timer to lower value. When timer was set to 1 second , downloading was really slow, so I changed it .. then it was faster , but only part of patch was downloaded. Can it cause a problem ?

EDIT:// I set timer to default (1sec) still not working , so I am gonna try modify WoW.exe

I have modified wow.exe , still not working ... my WoW is not installed , it´s only portable , so maybe it can´t find path to my Data folder.
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: stoneharry on July 27, 2014, 08:14:09 pm
viewtopic.php?f=59&t=1829 (http://modcraft.io/viewtopic.php?f=59&t=1829" onclick="window.open(this.href);return false;)
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: devil1234 on October 02, 2014, 07:05:58 pm
that can be fixed for trinitycore because now is using boost not ace anymore and not have no clue how to do it. :)
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: Hlkz on February 21, 2015, 06:24:11 pm
Greetings $N
I updated the code for a recent TrinityCore version.

Here is the commit :
https://github.com/Hlkz/Acore/commit/82 ... 0e04542608 (https://github.com/Hlkz/Acore/commit/82b46e3617b6b14752113e7d853dec0e04542608" onclick="window.open(this.href);return false;)

PS: Thank's so much for your work guys...
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: Chaya_1987 on November 16, 2015, 06:43:11 pm
Updated :

http://pastebin.com/Vdp9wpBT (http://pastebin.com/Vdp9wpBT" onclick="window.open(this.href);return false;)
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW
Post by: Recycle on February 23, 2016, 04:45:28 pm
Any updates to this? Chaya's patch made my server crash on bootup - or did I do something majorly wrong?

Also no clue how to properly use the database with it. I might be dumb, but I did try for hours until I eventually gave up!
Title: Re: [TUTORIAL] Sending Patches To The Client Through The WoW App
Post by: ninja159 on November 29, 2017, 07:33:48 pm
Hi, can someone rewrite it for OC? i tryed but not successfully .....  :'(
Title: App
Post by: mrxxx on April 21, 2018, 10:06:44 pm
Could someone take the time to update this to latest TC revision? Please, I would really appreciate it.