{"id":19478876,"url":"https://github.com/xan105/cnc-online","last_synced_at":"2025-04-25T15:30:55.232Z","repository":{"id":256212831,"uuid":"854439542","full_name":"xan105/CnC-Online","owner":"xan105","description":"Open Source Revora/CnC-Online Client","archived":false,"fork":false,"pushed_at":"2024-10-18T01:19:51.000Z","size":3672,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-19T14:44:04.828Z","etag":null,"topics":["dll-injection","gamespy","online-play","ra3","redalert3","winsock2"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xan105.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"xan105","custom":"https://www.paypal.me/xan105","patreon":"xan105"}},"created_at":"2024-09-09T07:11:34.000Z","updated_at":"2024-10-18T01:14:31.000Z","dependencies_parsed_at":"2024-10-19T00:53:53.550Z","dependency_job_id":null,"html_url":"https://github.com/xan105/CnC-Online","commit_stats":null,"previous_names":["xan105/cnc-online"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xan105%2FCnC-Online","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xan105%2FCnC-Online/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xan105%2FCnC-Online/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xan105%2FCnC-Online/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xan105","download_url":"https://codeload.github.com/xan105/CnC-Online/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250844227,"owners_count":21496525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dll-injection","gamespy","online-play","ra3","redalert3","winsock2"],"created_at":"2024-11-10T19:51:53.109Z","updated_at":"2025-04-25T15:30:55.202Z","avatar_url":"https://github.com/xan105.png","language":"C++","funding_links":["https://github.com/sponsors/xan105","https://www.paypal.me/xan105","https://patreon.com/xan105"],"categories":[],"sub_categories":[],"readme":"# Open Source - Revora/CnC-Online Client\n\n\u003e C\u0026C:Online is a community-made and -managed online server for Generals, Zero Hour, Tiberium Wars, Kane's Wrath, and Red Alert 3, allowing you to log in and continue playing online just like you could when GameSpy's servers were still online.\n\n## Description\n\nThis project provides a patch through DLL injection or DLL sideloading to restore online play features in games such as *Red Alert 3* using the [Revora/CnC-Online](https://cnc-online.net/en/) server. It serves as an alternative to the official CnC-Online launcher which use EasyHook for the patching process. \n\n🐧 Running Linux ? This patch is compatible with Linux/Proton.\n\n\u003e [!NOTE]\n\u003e This patch was mainly tested with Red Alert 3, which is the primary focus of this project, but it works just fine with the other games supported by [Revora/CnC-Online](https://cnc-online.net/en/).\n\n## Download\n\n⬇️ [Latest release](https://github.com/xan105/CnC-Online/releases/latest).\n\nScroll to the bottom to reach `Assets` and download `opencnconline.7z`, the patch DLL is in the archive.\n\n## Usage\n\n### A) DLL Sideloading (easy)\n\nThis patch DLL can act as a proxy to `winmm.dll` located in `C:\\Windows\\System32\\`.\n\nRename `opencnconline.dll` to `winmm.dll` and copy it next to the game's executable (**not** the game's launcher).\n\nExample:\n\n- Red Alert 3: \n    + Exec = `RA3.exe` ❌ -\u003e `\\Data\\ra3_1.13.game` ✔️\n    + DLL = `\\Data\\winmm.dll`\n- C\u0026C3 Kane's Wrath: \n    + Exec = `CNC3EP1.exe` ❌ -\u003e `\\RetailExe\\1.3\\cnc3ep1.dat` ✔️\n    + DLL = `\\RetailExe\\1.3\\winmm.dll`\n- C\u0026C3 Tiberium Wars: \n    + Exec = `CNC3.exe` ❌ -\u003e `\\RetailExe\\1.10\\cnc3game.dat` ✔️\n    + DLL = `\\RetailExe\\1.10\\winmm.dll`    \n- Zero Hour: \n    + Exec = `Generals.exe` ❌ -\u003e `\\game.dat` ✔\n    + DLL = `\\winmm.dll`\n\n🐧 Linux/Proton: Open up the game properties in Steam and add `WINEDLLOVERRIDES=\"winmm=n,b\" %command%` to the launch options. Then launch the game as you would normally do.\n\n### B) DLL Injection (advanced)\n\nThis patch was originally designed to work with my [RA3.exe re-implementation / alternative](https://github.com/xan105/RA3-Launcher), but it can also be used with any DLL injection tool of your choice.\n\nA quick google search will find you plenty on GitHub.\u003cbr /\u003e\n🐧 Linux: the classic combo `createRemoteThread()` + `LoadLibrary()` from `Kernel32` works under Wine/Proton.\n\nYou need to inject the DLL into the game process and **not** the launcher.\n\nExample:\n\n- Red Alert 3: \n    + Exec = `RA3.exe` ❌ -\u003e `\\Data\\ra3_1.13.game` ✔️\n    + Args = `-config \"%GAMEDIR%\\RA3_english_1.13.SkuDef\"`\n- C\u0026C3 Kane's Wrath: \n    + Exec = `CNC3EP1.exe` ❌ -\u003e `\\RetailExe\\1.3\\cnc3ep1.dat` ✔️\n    + Args = `-config \"%GAMEDIR%\\CNC3EP1_english_1.3.SkuDef\"`\n- C\u0026C3 Tiberium Wars: \n    + Exec = `CNC3.exe` ❌ -\u003e `\\RetailExe\\1.10\\cnc3game.dat` ✔️\n    + Args = `-config \"%GAMEDIR%\\CNC3_english_1.10.SkuDef\"`\n- Zero Hour: \n    + Exec = `Generals.exe` ❌ -\u003e `\\game.dat` ✔️\n\n## How does it work ?\n\nUpon injection into the game process, the patch DLL performs the following actions:\n\n- Find and replace the original EA public key with the CnC-Online key (if any).\n- Hook [send()](https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-send) and [gethostbyname()](https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-gethostbyname) calls to redirect them to the CnC Online GameSpy server emulation service.\n- Hook [connect()](https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect) to switch to an alternative peerchat port in case port `6667` is blocked.\u003cbr /\u003e Some countries do block this port because it is also used by IRC.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/xan105/CnC-Online/raw/main/screenshot/welcome_back_commander.png\"\u003e\n  \u003cem\u003eConnected to C\u0026C:Online\u003c/em\u003e\n\u003c/p\u003e\n\n## Why not use the official CnC-Online launcher ?\n\n_\"Launchers inception\"_ (Launcher that starts another Launcher) is despised by many but it remains a matter of personal preference. \nFor me the core issue was that their launcher **did not work** with the Steam version nor with Linux/Proton when I tried it.\n\nAnd I'm absolutely not a fan of registering their launcher as a debugger in the registry for specific executables (what they call \"hook\" mode in their launcher).\n\nI aimed to restore the online features of *Red Alert 3* without relying on their launcher and make the solution compatible with Linux/Proton.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/xan105/CnC-Online/raw/main/screenshot/linux_proton.png\"\u003e\n  \u003cem\u003eConnected to C\u0026C:Online under 🐧 Linux/Proton 9.0-2 (Fedora)\u003c/em\u003e\n\u003c/p\u003e\n\n## Env Var\n\n🧪 Experimental features are behind env var flags.\n\n#### `RA3_PATCH=ON|OFF` (OFF)\n\n\u003e \"Wall Crash\" Fix.\n\nWhen enabled patches a \"NULL pointer dereference\" game crash caused by a player ordering some structures (for example, wall) to move. Apparently this is a common occurrence when playing online where a griever will crash the game for the others when loosing.\n\n## Reminder for Online Play\n\n### Registry\n  \n  Please be advice that these games check the values in the registry: incorrect or missing value(s) may prompt an \"offline\" error when entering \"Online play\" in the menu even tho your network and the server are fine (not to be confused with actual network error).\n\n### NAT\n\n  These games use IPv4 only and are P2P meaning you most likely need port forwarding to play online.\n  If you are playing with your mates consider using a VPN (hamachi, radmin, ...) even for online play as a work-around.\n  \n  \u003cdetails\u003e\n  \u003csummary\u003eRed Alert 3 ports:\u003c/summary\u003e\n\n  |PORT|DESCRIPTION|\n  |----|-----------|\n  |TCP/3783|RA3 Voice Chat Port|\n  |TCP/4321|RA3 Mangler Servers|\n  |TCP/28900|RA3 Master Server List Request|\n  |TCP/29900|GP Connection Manager|\n  |TCP/29901|GP Search Manager|\n  |TCP/16000|Backend Server|\n  |UDP/6500|RA3 Query Port|\n  |UDP/6515|RA3 Dplay UDP|\n  |UDP/13139|RA3 Custom UDP Pings|\n  |UDP/27900|RA3 Master Server UDP Heartbeat|\n  |UDP/16000|Backend Server|\n\n  \u003c/details\u003e\n\n### Network interface\n\n  Being P2P these games generally have an option in their settings menu to choose which IP/Network adapter to use.\n  Usually the default is fine and correct but sometimes it isn't.\n\nBuild\n=====\n\n🆚 **Visual Studio 2022**\n\n📦 Vendor dependencies:\n  - [Microsoft Detours library](https://github.com/microsoft/Detours)\n\nSolution: `./vc/opencnconline.sln`\u003cbr /\u003e\nOutput: `./build/output/${platform}/${config}`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxan105%2Fcnc-online","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxan105%2Fcnc-online","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxan105%2Fcnc-online/lists"}