feat: port aelrynth 2026.9.27.2 snapshot onto GitHub history
Overlay upstream/main (9b5e276) onto BlankenshipG main without rewriting
history. Keep origin-only Decal/plugin/docs trees. Re-apply aelrynth.com
and sibling-fork URL fixes that aelrynth git still has as tombohar links.
Co-authored-by: BlankenshipG <BlankenshipG@users.noreply.github.com>
This commit is contained in:
parent
ac0d743e16
commit
4ddbb52eb2
244 changed files with 59710 additions and 3067 deletions
|
|
@ -9,12 +9,10 @@ namespace RynthCore.Engine.Compatibility;
|
|||
internal static class CreateObjectHooks
|
||||
{
|
||||
private const int CreateObjectVa = 0x005594B0;
|
||||
private static readonly byte[] CreateObjectSignature =
|
||||
// Verified unique + lands at 0x005594B0 offline (tools/pe_pattern.py).
|
||||
private static readonly byte?[] CreateObjectPattern =
|
||||
[
|
||||
0x55, 0x8B, 0x6C, 0x24, 0x08, 0x56, 0x8B, 0xF1,
|
||||
0x8B, 0x8E, 0x8C, 0x00, 0x00, 0x00, 0x8B, 0x96,
|
||||
0x88, 0x00, 0x00, 0x00, 0x8B, 0xC5, 0xD3, 0xE8,
|
||||
0x8B, 0x8E, 0x90, 0x00, 0x00, 0x00, 0x33, 0xC5
|
||||
0x55, 0x8B, 0x6C, 0x24, 0x08, 0x56, 0x8B, 0xF1, 0x8B, 0x8E
|
||||
];
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||
|
|
@ -28,6 +26,7 @@ internal static class CreateObjectHooks
|
|||
|
||||
public static bool IsInstalled { get; private set; }
|
||||
public static string StatusMessage => _statusMessage;
|
||||
public static int DispatchCount => _dispatchCount;
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
|
|
@ -40,17 +39,17 @@ internal static class CreateObjectHooks
|
|||
return;
|
||||
}
|
||||
|
||||
int funcOff = CreateObjectVa - textSection.TextBaseVa;
|
||||
if (!PatternScanner.VerifyBytes(textSection.Bytes, funcOff, CreateObjectSignature))
|
||||
HookResolver.ResolveResult resolved = HookResolver.Resolve(textSection, "CreateObject.CreateObject", CreateObjectPattern, CreateObjectVa);
|
||||
if (!resolved.Success)
|
||||
{
|
||||
_statusMessage = $"ACCObjectMaint::CreateObject signature mismatch @ 0x{CreateObjectVa:X8}.";
|
||||
_statusMessage = $"ACCObjectMaint::CreateObject unresolved (VA 0x{CreateObjectVa:X8}).";
|
||||
RynthLog.Compat($"Compat: create-object hook failed - {_statusMessage}");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_targetAddress = new IntPtr(textSection.TextBaseVa + funcOff);
|
||||
_targetAddress = resolved.Address;
|
||||
_createObjectDetour = CreateObjectDetour;
|
||||
IntPtr detourPtr = Marshal.GetFunctionPointerForDelegate(_createObjectDetour);
|
||||
_originalCreateObject = Marshal.GetDelegateForFunctionPointer<CreateObjectDelegate>(MinHook.HookCreate(_targetAddress, detourPtr));
|
||||
|
|
@ -70,6 +69,7 @@ internal static class CreateObjectHooks
|
|||
|
||||
private static IntPtr CreateObjectDetour(IntPtr thisPtr, uint objectId, IntPtr visualDesc, IntPtr physicsDesc, IntPtr weenieDesc)
|
||||
{
|
||||
RecursionGuard.Tick("CreateObjectHooks.CreateObject");
|
||||
if (objectId != 0 && visualDesc != IntPtr.Zero)
|
||||
PaletteCache.ReadFromObjDesc(objectId, visualDesc);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue