Skip to content

Commit e0b62b7

Browse files
LapisGitdjdevin
authored andcommitted
Initial RecNetPatcher
1 parent 6c9f449 commit e0b62b7

15 files changed

Lines changed: 1438 additions & 517 deletions

.gitignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
bin/
2-
obj/
3-
/packages/
4-
riderModule.iml
5-
/_ReSharper.Caches/
1+
GamePath.props
2+
obj
3+
bin

CannedNet.Client.sln

Lines changed: 0 additions & 16 deletions
This file was deleted.

CannedNet.Client/CannedNet.Client.csproj

Lines changed: 0 additions & 454 deletions
This file was deleted.

CannedNet.Client/Patches/SendRequestPatch.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

CannedNet.Client/Plugin.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

GamePath.props.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project>
2+
<!-- Copy this file to "GamePath.props" (same folder) and set GamePath to your local
3+
Rec Room install. GamePath.props is gitignored, so your local path stays out of the repo.
4+
5+
The install must have been launched once under BepInEx 6 (IL2CPP) so that
6+
BepInEx/interop/ is populated with the proxy assemblies this project references. -->
7+
<PropertyGroup>
8+
<GamePath>C:\Path\To\RecRoom</GamePath>
9+
</PropertyGroup>
10+
</Project>

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 djdevin
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
using HarmonyLib;
22
using Org.BouncyCastle.Crypto.Tls;
33

4-
namespace CannedNet.Client.Patches;
4+
namespace RecNetPatcher.Patches;
55

6-
public class FuckOffTLS
6+
/**
7+
Disables TLS certificate pinning. Even though we connect over SSL it seems some certificates
8+
might be pinned.
9+
*/
10+
public class DisableTLSPinning
711
{
812
[HarmonyPatch(typeof(LegacyTlsAuthentication), "NotifyServerCertificate")]
913
public class TlsPatch
@@ -13,4 +17,4 @@ private static bool Prefix()
1317
return false;
1418
}
1519
}
16-
}
20+
}

Patches/EACPatches.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using HarmonyLib;
2+
using RecRoom.AntiCheat;
3+
using System.Text;
4+
using Il2CppSystem;
5+
6+
namespace RecNetPatcher.Patches;
7+
8+
[HarmonyPatch]
9+
public static class EACPatches
10+
{
11+
[HarmonyPrefix]
12+
[HarmonyPatch(typeof(EACManager), "FJLMLEPOKGE")]
13+
private static bool IsReadyPatch(ref bool __result)
14+
{
15+
__result = true;
16+
return false;
17+
}
18+
19+
[HarmonyPrefix]
20+
[HarmonyPatch(typeof(EACManager), "GenerateChallengeResponse")]
21+
private static bool GenerateChallengeResponsePatch(string PGCINMIEBJP, ref string __result)
22+
{
23+
if (!string.IsNullOrEmpty(PGCINMIEBJP))
24+
__result = Convert.ToBase64String(Encoding.UTF8.GetBytes(PGCINMIEBJP));
25+
else
26+
__result = Convert.ToBase64String(Encoding.UTF8.GetBytes("nothing"));
27+
return false;
28+
}
29+
}

Patches/PhotonPatches.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using ExitGames.Client.Photon;
2+
using HarmonyLib;
3+
using Photon.Realtime;
4+
5+
namespace RecNetPatcher.Patches;
6+
7+
/**
8+
Patches Photon to use the App IDs and server hostname/port specified in the plugin config.
9+
*/
10+
[HarmonyPatch(typeof(GPFPFDBGCEK), "AMOHMPKKGHL")]
11+
public class PhotonPatches
12+
{
13+
[HarmonyPostfix]
14+
private static void Postfix(ref AppSettings __result)
15+
{
16+
if (__result != null)
17+
{
18+
__result.AppIdRealtime = Plugin.AppIdRT.Value;
19+
__result.AppIdVoice = Plugin.AppIdVoice.Value;
20+
__result.AppIdChat = Plugin.AppIdChat.Value;
21+
__result.FixedRegion = "us";
22+
__result.UseNameServer = true;
23+
__result.Protocol = ConnectionProtocol.Udp;
24+
25+
if (Plugin.EnableAdvancedSettings.Value)
26+
{
27+
__result.Server = Plugin.PhotonHostname.Value;
28+
__result.Port = Plugin.PhotonPort.Value == 0
29+
? 4533
30+
: Plugin.PhotonPort.Value;
31+
}
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)