Compare commits

..

2 Commits
trunk ... trunk

Author SHA1 Message Date
e4c8207cd9 feat: scan for amdaemon version 2024-07-31 15:11:47 +07:00
7790dab4cd amdaemon: Add signature for OpenSSL SHA crash bug fix 2024-07-30 16:00:13 +00:00
2 changed files with 54 additions and 22 deletions

View File

@ -1,19 +1,32 @@
- name: Allow 127.0.0.1/localhost as the network server - name: Allow 127.0.0.1/localhost as the network server
patches: patches:
- signature: "31 32 37 2F 38 00" - signature: "31 32 37 2F 38 00"
offset: 0x00 offset: 0x00
off: [0x31, 0x32, 0x37, 0x2F] off: [0x31, 0x32, 0x37, 0x2F]
on: [0x30, 0x2F, 0x38, 0x00] on: [0x30, 0x2F, 0x38, 0x00]
- signature: "48 83 EC 28 FF 15 ?? ?? ?? ?? 8B C8 3D ?? ?? ?? ?? 77 0A" - signature: "48 83 EC 28 FF 15 ?? ?? ?? ?? 8B C8 3D ?? ?? ?? ?? 77 0A"
offset: 0x04 offset: 0x04
# You probably want this for older versions of amdaemon # You probably want this for older versions of amdaemon
# off: [0xFF, 0x15, 0x3E, 0x79, 0x1A, 0x00, 0x8B] # off: [0xFF, 0x15, 0x3E, 0x79, 0x1A, 0x00, 0x8B]
off: [0xFF, 0x15, 0xC6, 0x2F, 0x1B, 0x00, 0x8B] off: [0xFF, 0x15, 0xC6, 0x2F, 0x1B, 0x00, 0x8B]
on: [0x33, 0xC0, 0x48, 0x83, 0xC4, 0x28, 0xC3] on: [0x33, 0xC0, 0x48, 0x83, 0xC4, 0x28, 0xC3]
- name: Credit freeze - name: Credit freeze
tooltip: Prevents credits from being used. At least one credit must be available to start the game or purchase premium tickets. tooltip: Prevents credits from being used. At least one credit must be available to start the game or purchase premium tickets.
signature: "74 23 40 28 7C 4A ?? 39 05 ?? ?? ?? ?? 74 05" signature: "74 23 40 28 7C 4A ?? 39 05 ?? ?? ?? ?? 74 05"
patches: patches:
- offset: 0x03 - offset: 0x03
off: [0x28] off: [0x28]
on: [0x08] on: [0x08]
# https://github.com/eamonwoortman/openssl-universal-patcher/blob/master/src/OpenSSLUniversalPatcher/Resources/openssl.universal.patch
# https://eamonwoortman.github.io/openssl-binary-patching/
# https://github.com/openssl/openssl/commit/7123aa81e9fb19afb11fdf3850662c5f7ff1f19c#diff-fd85954e17364d4495e1e077a5768e4e
- name: OpenSSL SHA crash bug fix
tooltip: Fixes crashing on 10th generation and newer Intel CPUs
signature: "48 8D 46 40 66 0F FE CC 48 0F 45 F0"
patches:
- offset: 0x00
off: [0x48]
on: [0x4C]
- offset: 0x08
off: [0x48]
on: [0x49]

View File

@ -1,5 +1,6 @@
// See https://aka.ms/new-console-template for more information // See https://aka.ms/new-console-template for more information
using System.Text;
using CHUNITHM_Patch_Finder.Converters; using CHUNITHM_Patch_Finder.Converters;
using CHUNITHM_Patch_Finder.Models; using CHUNITHM_Patch_Finder.Models;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -113,8 +114,26 @@ if (exeFileName == "chusanApp.exe")
{ {
Console.WriteLine("Track count function not found"); Console.WriteLine("Track count function not found");
} }
} else if (exeFileName == "amdaemon.exe") }
else if (exeFileName == "amdaemon.exe")
{ {
// "amdaemonExe Ver."
var versionResult = scanner.FindPattern("61 6D 64 61 65 6D 6F 6E 45 78 65 20 56 65 72 2E");
if (versionResult.Found)
{
var versionEnd = Array.IndexOf<byte>(binary, 0, versionResult.Offset);
var version = Encoding.ASCII
.GetString(binary, versionResult.Offset, versionEnd - versionResult.Offset)
.TrimEnd();
Console.WriteLine(version);
}
else
{
Console.WriteLine("[WARN] Could not find amdaemon version.");
}
var results = scanner.FindPatterns([ var results = scanner.FindPatterns([
"E8 ?? ?? ?? ?? 3B C5 7C 32", "E8 ?? ?? ?? ?? 3B C5 7C 32",
"E8 ?? ?? ?? ?? A8 10 74 C1", "E8 ?? ?? ?? ?? A8 10 74 C1",
@ -139,7 +158,7 @@ if (exeFileName == "chusanApp.exe")
{ {
Offset = logLevel1Address + 6, Offset = logLevel1Address + 6,
Off = [0xC3, 0xCC, 0xCC, 0xCC], Off = [0xC3, 0xCC, 0xCC, 0xCC],
On = [0x83, 0xC0, 0x3F, 0xC3], On = [0x83, 0xC8, 0x3F, 0xC3],
}, },
new BemaniPatcherStandardPatchEntry new BemaniPatcherStandardPatchEntry
{ {
@ -191,4 +210,4 @@ File.WriteAllText(
"patches.json", "patches.json",
JsonConvert.SerializeObject(exportedPatches, settings)); JsonConvert.SerializeObject(exportedPatches, settings));
Console.WriteLine("Wrote patches to patches.json"); Console.WriteLine("Wrote patches to patches.json");