LAN Connection Patch

I've written up a small program to patch the LAN address check in the Tribes 2 executable.

The LAN address check is designed to prevent connections to LAN servers from the "Internet" by checking if the client's IP address is on the same subnet as one of the network adapters active in the system.

This patch makes this check always pass, even if the IP address is from another part of the Internet by altering a few bytes in the Tribes 2 executable.

The patcher has both a patching and unpatching mode, and I have tested to make sure they do what they are supposed to.

The program is a command line program, so, run it from the command line.

C source code is included too, so you can compile it yourself if you desire.

Oh and... I would strongly recommend NOT running it on anything other than a T2 executable.
«1

Comments

  • Awesome! I'm grabbing this right now...
  • Lets say if I wanted to host my ACCM mod... So me and Eolk can make improvements. In other programs similar to this, it would load some of the mod, but not all of it, and do I need to make a new shortcut path for it?
  • Actually, I think it makes direct changes your tribes 2 executable, so, I don't think any shortcuts are needed. It also comes with an un-patcher, but, if you're really worried about screwing something up, then you should backup your tribes2.exe.
  • The master server should be up in soon anyway... I don't really feel like risking it and im too lazy to back-up my files... So, Eolk, I guess you gotta wait to get to my server...
  • I doubt all your files will be deleted this time, so, go ahead and risk it. :D
    (But not literally, if you don't want to, fine.)
  • Meh...

    Damn you Sierra!!! FIX THE DAMN MASTER SERVERS ALREADY!!!
  • Stop getting all worked up and run the patch. :)
  • Has Sierra said when the servers will be back up? I'm on break right now so I might actually have time to play.
  • Looking on other sources, I'd say they will be back up soon (hopefully). However, some people are going into that "apocalypse" stage.
  • I'll post instructions if anyone needs them. I doubt you will though, right?
  • Due to request, I'm posting the instructions on how to patch/unpatch your tribes2.exe. I'm using Windows XP,

    so, if you have a different operating system, these instructions may not work for you.

    ***** PATCHING *****
    1. Download Thyth's LAN Connection Patch from http://www.the-construct.net/forums/showthread.php?t=251.
    2. Save the zip file to somewhere (preferrably desktop).
    3. Next, unzip the executable file (and .C file if you want to look at the source) to your desktop.
    4. Don't click that program just yet! First, backup your tribes2.exe to somewhere safe (along with other things you don't want to lose).
    5. Push the windows start button in the lower left-hand corner and press run. Type in "cmd" without the quotes and press enter. This should pop up a black window.
    6. Here comes the hard part. Carefully change your directory to your desktop. For example, type in "cd C:\Documents and Settings\Username\Desktop\" without the quotes. Replace "username" with the account username (if your account has been re-named, you'll need to get the name of the folder, because the username might not match up quite right).
    7. Now, type in "t2LANpatch.exe patch "pathtotribes2.exe" Replace "pathtotribes2.exe" with the path to your tribes 2 executable file (without quotes). For example: t2LANpatch.exe patch C:\Dynamix\Tribes2\Gamedata\tribes2.exe
    If done correctly, the command prompt should say your version number and information on Thyth's program.

    It should say
    Patching...
    ***********
    Patching Complete.

    And there you have it, folks! Your tribes 2 has been patched successfully!

    ***** UNPATCHING *****
    1. Download Thyth's LAN Connection Patch from http://www.the-construct.net/forums/showthread.php?t=251.
    2. Save the zip file to somewhere (preferrably desktop).
    3. Next, unzip the executable file (and .C file if you want to look at the source) to your desktop.
    4. Don't click that program just yet! First, backup your tribes2.exe to somewhere safe (along with other things you don't want to lose).
    5. Push the windows start button in the lower left-hand corner and press run. Type in "cmd" without the quotes and press enter. This should pop up a black window.
    6. Here comes the hard part. Carefully change your directory to your desktop. For example, type in "cd C:\Documents and Settings\Username\Desktop\" without the quotes. Replace "username" with the account username (if your account has been re-named, you'll need to get the name of the folder, because the username might not match up quite right).
    7. Now, type in "t2LANpatch.exe unpatch "pathtotribes2.exe" Replace "pathtotribes2.exe" with the path to your tribes 2 executable file (without quotes). For example: t2LANpatch.exe patch C:\Dynamix\Tribes2\Gamedata\tribes2.exe

    If done correctly, the command prompt should say your version number and information on Thyth's program.

    It should say
    Unpatching...
    ***********
    Patching Complete.

    And there you have it, folks! Your tribes 2 has been unpatched successfully!
  • Yes, I should have been more specific, it just alters the Tribes2.exe file.

    Once you run the patch, you can run a "LAN" mode server that anyone running "offline" would be able to connect to.

    So, once you have patched, run Tribes2.exe with the -nologin flag (singleplayer/LAN mode) as a server.

    Anyone that wants to play on your server just needs to run Tribes2.exe with the -nologin flag (singleplayer/LAN mode, again), go to the Join Server list, press Insert, enter your server's IP address, click on the newly found server, and then press the connect button to play.

    Without applying the patch, the client would get an error when they would try to connect, saying something along the lines of "You are not on the same class B subnet as the server.", but with the patch they can play without any problems.

    Playing this way doesn't need the authentication server, or the master list server... assuming you are fine without GUIDs, admin lists, and entering server IP addresses manually.

    Though... I see this program as part of a bigger effort to create a new distributed authentication and server listing framework.
  • it's funny that i understand that source code :p

    any how...

    couldn't we make that into a batch file? like...

    t2LANpatch.exe patch C:\Dynamix\Tribes2\GameData\tribes2.exe
  • Not everyone uses the default installation location.
  • then it would be a simple matter of editing the second argument.

    but it would work right?
  • hrmm, i think ill wait a couple days before I try this. I am fairly computer illiterate. =/
  • If you aren't hosting a server, you don't need it.

    But yes, Emp, such a thing would work.
  • It's been a while since I've done anything with batch files, but isn't %~dp0 the current directory string?
    So you could probably have them stick the bat in gamedata and make it use:
    t2LANpatch.exe patch %~dp0tribes2.exe
    


    Also, think you could stick something together from that to remove the check for a linux dedicated server? It'd be useful for my own server, and if the official servers do go down for good there'll be a few other servers wanting the same. :p
  • I don't have much experience reverse engineering Linux ELF executables, nor do I have a copy of the executable handy (I have a CD somewhere of the T2 Linux version, but not easy to find).

    If you send me a copy of the executable, I can give it a shot.
  • I put the executables in here, doubt you need all of them but I extracted them anyways. http://www.the-construct.net/t2linux/b/

    There's also this up if someone needs a quick Linux client for T2:
    http://www.the-construct.net/t2linux/t2-linux.zip
  • Do you use the dynamic or the statically linked one? The structure of the Linux executables is much different that that of the Windows one, but I think I've found the correct subroutines.

    I've patched file tribes2d.dynamic, attached, for you to test. I don't have a Linux server that I can run the game on available.

    As part of the patch, I've overwritten a conditional jump to never happen. Specifically, I overwrote a 3 byte instruction starting at 0x1e3cef with 3 NO-OP instructions.

    If this causes the wrong path to execute, this version will prevent any LAN connections. If you are still able to connect as a LAN client on the same subnet, I've done at least part of the crack correctly. I'm not 100% certain that I've covered all of the paths to a connection failure (so it might still deny a connection to the server), as the subroutine that handles this is very large.

    Give it a try, and let me know what happens.
  • Yeah, I use the dynamic one. Hmm, no luck with it so far, still getting the class B disconnects.

    Though it does seem to get a UE if I run it in online mode with that :)


    BUG! (Segmentation Fault) Going down hard...
    Tribes 2 for Linux #25034
    Built with glibc-2.1 on x86
    Stack dump:
    {
    0x555908
    0x81cfc24
    0x81cc2f3
    0x822ee08
    0x81cef67
    0x542de3
    0x804cb61
    }
  • Ouchies for Linux users... :p
  • I guess that was also a distinct possibility, considering the types of edits that happen.

    When I get access to a sufficiently fast Linux server, I'll run this through a live debug, and do it properly.
  • why not give us a patched .exe?
  • ...No comment.
  • Here's a patched Tribes2.exe - though not done with Thyth's thing, it's from when the masters were down in 2004.

    I've also included another zip with a batch file and the patcher from the original post. Should make it a lot easier for some of you to use, just pop the files in gamedata, run the .bat, and select your option.
  • Well-done!
  • Why did I not distribute modified executables?

    There are a few main reasons.

    1) It is illegal to distribute a straight patched program. It is an unauthorized derivative work of copyrighted software. The patcher program, is not so.
    2) Size. A patcher program is a heck of a lot smaller.
    3) If you know x86 assembly, you can see exactly what I did, so you can verify that I haven't added a sophisticated backdoor to the T2 executable designed to damage your system.
  • Understood, thanks for the info thyth, and thank you for the upload krash.
Sign In or Register to comment.