From 6613e592ab2785d62a89a479ad0464adefd73932 Mon Sep 17 00:00:00 2001 From: beerpsi Date: Sat, 13 Apr 2024 03:31:40 +0700 Subject: [PATCH] patches from evilleaker --- Models/BemaniPatcherUnionPatch.cs | 6 +++ Models/BemaniPatcherUnionPatchEntry.cs | 6 +++ Program.cs | 62 ++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 Models/BemaniPatcherUnionPatch.cs create mode 100644 Models/BemaniPatcherUnionPatchEntry.cs diff --git a/Models/BemaniPatcherUnionPatch.cs b/Models/BemaniPatcherUnionPatch.cs new file mode 100644 index 0000000..3c388d7 --- /dev/null +++ b/Models/BemaniPatcherUnionPatch.cs @@ -0,0 +1,6 @@ +namespace CHUNITHM_Patch_Finder.Models; + +public class BemaniPatcherUnionPatch +{ + +} \ No newline at end of file diff --git a/Models/BemaniPatcherUnionPatchEntry.cs b/Models/BemaniPatcherUnionPatchEntry.cs new file mode 100644 index 0000000..8ca0136 --- /dev/null +++ b/Models/BemaniPatcherUnionPatchEntry.cs @@ -0,0 +1,6 @@ +namespace CHUNITHM_Patch_Finder.Models; + +public class BemaniPatcherUnionPatchEntry +{ + +} \ No newline at end of file diff --git a/Program.cs b/Program.cs index 6a8d582..74a2327 100644 --- a/Program.cs +++ b/Program.cs @@ -113,6 +113,68 @@ if (exeFileName == "chusanApp.exe") { Console.WriteLine("Track count function not found"); } +} else if (exeFileName == "amdaemon.exe") +{ + var results = scanner.FindPatterns([ + "E8 ?? ?? ?? ?? 3B C5 7C 32", + "E8 ?? ?? ?? ?? A8 10 74 C1", + ]); + + if (results.All(r => r.Found)) + { + var logLevel1RelativeAddress = BitConverter.ToInt32(binary, results[0].Offset + 1); + var logLevel1Address = results[0].Offset + 5 + logLevel1RelativeAddress; + + var logLevel2RelativeAddress = BitConverter.ToInt32(binary, results[1].Offset + 1); + var logLevel2Address = results[1].Offset + 5 + logLevel2RelativeAddress; + + Console.WriteLine($"Found log level functions at {logLevel1Address:X} and {logLevel2Address:X}"); + + exportedPatches.Add(new BemaniPatcherStandardPatch + { + Name = "Verbose logging", + Tooltip = "Force sets 2 flags that enables verbose logging, may be useful for developers", + Patches = [ + new BemaniPatcherStandardPatchEntry + { + Offset = logLevel1Address + 6, + Off = [0xC3, 0xCC, 0xCC, 0xCC], + On = [0x83, 0xC0, 0x3F, 0xC3], + }, + new BemaniPatcherStandardPatchEntry + { + Offset = logLevel2Address + 6, + Off = [0xC3, 0xCC, 0xCC, 0xCC], + On = [0x83, 0xC8, 0xFF, 0xC3], + } + ] + }); + } + + results = scanner.FindPatterns([ + "E8 ?? ?? ?? ?? 83 F8 01 0F 84 ?? ?? ?? ?? 85 C0 79 2E", // http3ConnectServerSocketNb + "E8 ?? ?? ?? ?? 83 F8 01 74 29 85 C0", // http3ReadResponseSocketNb + "E8 ?? ?? ?? ?? 83 F8 01 74 4F", // http3SendRequestSocketNb + ]); + + if (results.All(r => r.Found)) + { + Console.WriteLine($"Found Auth2.0 HTTP routines at {string.Join(", ", results.Select(r => r.Offset.ToString("X")))}"); + + var patchEntries = ( + from result in results + let relativeAddress = BitConverter.ToInt32(binary, result.Offset + 1) + select result.Offset + 5 + relativeAddress into address + select new BemaniPatcherStandardPatchEntry { Offset = address + 7, Off = [0x0F, 0x84], On = [0x90, 0xE9] } + ).ToList(); + + exportedPatches.Add(new BemaniPatcherStandardPatch + { + Name = "Disable SSL for Auth2.0", + Tooltip = "Force using non-SSL routines for Auth2.0 online certification, may be useful for developers", + Patches = patchEntries, + }); + } } var settings = new JsonSerializerSettings