patches from evilleaker

This commit is contained in:
beerpsi 2024-04-13 03:31:40 +07:00
parent 8438ed9bf6
commit 6613e592ab
3 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,6 @@
namespace CHUNITHM_Patch_Finder.Models;
public class BemaniPatcherUnionPatch
{
}

View File

@ -0,0 +1,6 @@
namespace CHUNITHM_Patch_Finder.Models;
public class BemaniPatcherUnionPatchEntry
{
}

View File

@ -113,6 +113,68 @@ if (exeFileName == "chusanApp.exe")
{ {
Console.WriteLine("Track count function not found"); 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 var settings = new JsonSerializerSettings