mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-15 16:34:40 +01:00
fix game version not supported when it is
this occurs when game was already patched
This commit is contained in:
@@ -9,6 +9,7 @@ namespace ServerSelector
|
|||||||
public class ServerSwitcher
|
public class ServerSwitcher
|
||||||
{
|
{
|
||||||
private static readonly string[] GameAssemblySodiumIntegrityFuncHint = ["40 53 56 57 41 54 41 55 41 56 41 57 48 81 EC C0 00 00 00 80 3d ?? ?? ?? ?? 00 0f 85 ?? 00 00 00 48"];
|
private static readonly string[] GameAssemblySodiumIntegrityFuncHint = ["40 53 56 57 41 54 41 55 41 56 41 57 48 81 EC C0 00 00 00 80 3d ?? ?? ?? ?? 00 0f 85 ?? 00 00 00 48"];
|
||||||
|
private static readonly string[] GameAssemblySodiumIntegrityFuncPatched = ["b0 01 c3 90 90 54 41 55 41 56 41 57 48 81 EC C0 00 00 00 80 3d ?? ?? ?? ?? 00 0f 85 ?? 00 00 00 48"];
|
||||||
private static readonly string[] GameAssemblySodiumIntegrityFuncPatch = ["b0 01 c3 90 90"];
|
private static readonly string[] GameAssemblySodiumIntegrityFuncPatch = ["b0 01 c3 90 90"];
|
||||||
private const string HostsStartMarker = "# begin ServerSelector entries";
|
private const string HostsStartMarker = "# begin ServerSelector entries";
|
||||||
private const string HostsEndMarker = "# end ServerSelector entries";
|
private const string HostsEndMarker = "# end ServerSelector entries";
|
||||||
@@ -167,6 +168,12 @@ namespace ServerSelector
|
|||||||
File.Delete(backupPath);
|
File.Delete(backupPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (PatchUtility.CanFindOffset(dll, GameAssemblySodiumIntegrityFuncPatched))
|
||||||
|
{
|
||||||
|
// already patched
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// patch assembly
|
// patch assembly
|
||||||
return PatchUtility.SearchAndReplace(dll, GameAssemblySodiumIntegrityFuncHint, GameAssemblySodiumIntegrityFuncPatch);
|
return PatchUtility.SearchAndReplace(dll, GameAssemblySodiumIntegrityFuncHint, GameAssemblySodiumIntegrityFuncPatch);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user