Skip to content

Commit

Permalink
Calculated checksums for 0.1.12 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
halvors committed Mar 6, 2021
1 parent c8f63b6 commit bb96934
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 45 deletions.
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,47 @@
# FC2MPPatcher
An utility for patching your Far Cry 2 installation to support multiplayer agian.

This resolves the following issues for the game and dedicated server:
* Binding to the wrong network interface, resolving issues with online multiplayer.
* Annoncing wrong IP address in multiplayer, showing 9999 ping for matches in lobby.
* Broadcasting to wrong address, causing issues with LAN multiplayer (including over VPN).
* Dedicated Server not starting in online mode.
* Joining matches hosted ingame.
* Steam and Uplay version being unable to login to online accounts.
* Custom map download from host not ever working properly on online servers.
## Features
This resolves the following issues for the game and dedicated server.

### Both
* Binding to the wrong network interface, resolving issues with online multiplayer.
* Broadcasting to wrong address, causing issues with LAN multiplayer (including over VPN).

### Game
* Steam and Uplay version now being able to login to online accounts.
* Joining matches hosted ingame.

### Dedicated Server
* Dedicated Server now able to start in online mode.
* Annoncing wrong IP address in multiplayer, showing 9999 ping for matches in lobby.
* Custom map download from host now working properly for online servers.
* Possible to disable PunkBuster even for ranked matches.

If you experience diffculties patching the game, first make sure you got the 1.03 patch installed, if your version of the game isn't supported (only Retail, Steam, Uplay and GOG is tested), please report on the issue tracker, it's a quick fix.

### Requirements
## Requirements
* The game files itself. (We do not ship any game files as they are copyrighted by Ubisoft).
* The newest version of the game from either Steam, Uplay, GOG or the Retail edition (Disc), your game needs to be version 1.03.

### Installation
## Installation
<b>NOTE:</b> As mentioned in license, we're not responsible for breaking your game or getting you banned.

* Download the latest version of the patcher, if you got an old version installed, uninstall it first.
* Run the patcher and make sure to select the network interface that your internet connection is on (Usually Ethernet or Wifi).
* Press the patch button and you are good to go!

To play ranked matches you need PunkBuster which does no longer work out-of-the-box, you can follow these instructions to manually update your PunkBuster files: http://ned.theoldergamers.com/static.php?page=farcry2-punkbuster

### Upgrading
If you are upgrading from an old version of the patch uninstall the old one and install the new version of the patch.
To play ranked matches you need PunkBuster installed, even though it is not in use by the server itself.

### Antivirus
This patch will probably trigger a false positive in your antivirus software because it alters the game files of Far Cry 2, this is normal.
The patch contains no malware or virueses, you're also welcome to read throught our code!

### Dedicated Server
### Running a Dedicated Server
If hosting a server to be used by players thru VPN, you have to select your VPN adapter before patching!

Also please be aware that IP addresses shown in server logs may be misleading, no matter what address is shown the server always listens on 0.0.0.0 (any), which means it's reachable on any network adapter.

### Technical information
The reason for this being necessary is due to changes in the Windows API on newer versions, that is not compatible with Ubisoft's somewhat strange implementation.

## Discord
Please join us at Discord for support, and to find other people to play with!
https://discord.gg/82G9Fh5
Expand Down
9 changes: 2 additions & 7 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
Ideas:
- Use regex to validate input?

Unable to patch only one of the files and then revert that patch again, should we support some kind of way to only patch oini of them?
Should we compare checksums with that of old releases to support upgrades?

Fix fish: “./fc2mppatcher -n” terminated by signal SIGSEGV (Address boundary error) because wrong file is selected when only 1?

Networking:
- Unable to patch only one of the files and then revert that patch again, should we support some kind of way to only patching one of them?
- Send broadcast out all interfaces instead of selecting just one for LAN play? Iterate thru all interfaces? EDIT: Not possible because of ip address info in packets?

Compiling:
Expand Down
4 changes: 0 additions & 4 deletions src/app/patcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ void Patcher::undoPatch(const QDir &dir) {
for (const FileEntry &file : files) {
// Restore patched files.
FileUtils::replicate(dir, file, false);

// Delete backed up game files.
//QFile::remove(dir.filePath(QString(file.getName()).prepend(game_hidden_prefix)));
//QFile::remove(dir.filePath(FileUtils::appendToName(dir, file.getName(), game_backup_suffix))); // Temp, leave for some iterations, was changed in 0.1.12.
}

// Delete patch library file.
Expand Down
2 changes: 1 addition & 1 deletion src/app/widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<item>
<widget class="QComboBox" name="comboBox_network_interface">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select an network interace that Far Cry 2 should bind to, usually your primary interface or VPN service like Hamachi if you want to use that.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string/>
</property>
</widget>
</item>
Expand Down
2 changes: 1 addition & 1 deletion src/common/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <QStringList>

// Set true for debugging mode without checksum verification.
#define DEBUG_MODE true
#define DEBUG_MODE false

// App
constexpr char app_name[] = "FC2MPPatcher";
Expand Down
22 changes: 8 additions & 14 deletions src/common/patch_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const QList<FileEntry> files = {
{ // Retail (GOG is identical)
{
{ "7b82f20088e5c046a99fcaed65dc8bbb8202fd622a69737be83e00686b172d53",
"a3ae457d942ae499d79c583f32e356cc101ffe1a221aae9220d1ac64695f3c79" }
"58b30f35da8afc9ac5de2f526d97846234d2cd332195b5a3567265702d5bb077" }
},
{
{ "a3ae457d942ae499d79c583f32e356cc101ffe1a221aae9220d1ac64695f3c79" }, // Hash for Retail version 0.1.11.
Expand Down Expand Up @@ -79,17 +79,17 @@ const QList<FileEntry> files = {
"\x59" // pop ecx
"\xE9\x03\x25\xE4\xFE", 25) }, // jmp <dunia.retur>
{ 0x10771517, QByteArray("\xE9\xE4\xDA\x1B\x01", 5) }, // change function call to instead jump to the .text_p section.
{ 0x10cb2588, asm_nop(6) }, // bypassing the rate limiting of map downloads by NOP out rate limit jump.
{ 0x10cb2588, asm_nop(6) } // bypassing the rate limiting of map downloads by NOP out rate limit jump.
}
},
{ // Steam and Uplay
{
// Steam
{ "6353936a54aa841350bb30ff005727859cdef1aa10c209209b220b399e862765",
"d4942259d5d61c2f743bed7a0b156ab8489e868aa8cfd2b20fc5e417dd52cefa" },
"d5c17109e9cc7d4f8b73804ac5a905952a858bd2ec09d359f49a46719eb30b4e" },
// Uplay
{ "b7219dcd53317b958c8a31c9241f6855cab660a122ce69a0d88cf4c356944e92",
"83e2ea791c6227cc96f2515c4638b24809439944d183ad6b0117d58eb2c8869b" }
"bd18c139db5751efcdb99ccdef8a19a6c2730177f0fc967abedce5526d0676cd" }
},
{
{ "d4942259d5d61c2f743bed7a0b156ab8489e868aa8cfd2b20fc5e417dd52cefa" }, // Hash for Steam version 0.1.11.
Expand Down Expand Up @@ -135,13 +135,7 @@ const QList<FileEntry> files = {
"\x59" // pop ecx
"\xE9\xE3\x0E\xD9\xFE", 25) }, // jmp <dunia.retur>
{ 0x1077def7, QByteArray("\xE9\x04\xF1\x26\x01", 5) }, // change function call to instead jump to the .text_p section.
{ 0x10ceb6c8, asm_nop(6) }, // bypassing the rate limiting of map downloads by NOP out rate limit jump.

/* Experimental / WIP */
// Fix: Possibility to disable PunkBuster also for ranked matches.
{ 0x107a3a15, QByteArray("\xE9\xA9\x00\x00\x00\x90", 6) } // change JZ to JMP + NOP, from (0F 84 A8 00 00 00) to (E9 A9 00 00 00 90), bypassing PB checks for ranked matches.
//Not needed? //{ 0, patch_asm_jmp }, // change JZ to JMP in order to bypass autoenable of PB on ranked matches.
//{ 0, asm_nop(2) } // change JNZ to NOP in order to prevent PB from starting autostarting after match is started.
{ 0x10ceb6c8, asm_nop(6) } // bypassing the rate limiting of map downloads by NOP out rate limit jump.
}
}
}
Expand All @@ -152,7 +146,7 @@ const QList<FileEntry> files = {
{ // Retail (GOG is identical)
{
{ "c175d2a1918d3e6d4120a2f6e6254bd04907a5ec10d3c1dfac28100d6fbf9ace",
"9d9bbce845d81ab01821593f45783de5aba886a4133881cad265245e14247732" }
"31738feedf18d2459ce8cb62589bcdc59254be7060dbbdd0d1cbe485efbacdd2" }
},
{
{ "9d9bbce845d81ab01821593f45783de5aba886a4133881cad265245e14247732" }, // Hash for Retail version 0.1.11.
Expand Down Expand Up @@ -201,10 +195,10 @@ const QList<FileEntry> files = {
{
// Steam (R2 is identical)
{ "5cd5d7b6e6e0b1d25843fdee3e9a743ed10030e89ee109b121109f4a146a062e",
"cb5036fccf38a2a8cb73afc36df7844e160657c7f93c35554909b0e52e09ccee" },
"04df9d30bce8f7e22788a2fc7c6bad6719caf0f22de42f936ed7e3ed6cc1dda6" },
// Uplay
{ "948a8626276a6689c0125f2355b6a820c104f20dee36977973b39964a82f2703",
"346c6b3a292a352b6ca88ff563f25564d501af632fcb09a07f6a19a1415236c6" }
"e90dc85ea2229b038278f6ac45805658fc12fd00ceeca05093d271c885584d4c" }
},
{
{ "cb5036fccf38a2a8cb73afc36df7844e160657c7f93c35554909b0e52e09ccee" }, // Hash for Steam version 0.1.11.
Expand Down

0 comments on commit bb96934

Please sign in to comment.