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
|
|
@ -20,6 +20,10 @@ internal static class RawPacketHooks
|
|||
{
|
||||
private const int RecvFromPtrAddr = unchecked((int)0x007935AC);
|
||||
|
||||
// Phase B: resolve the RecvFrom fn-ptr slot's address by code-xref ("call [slot]" =
|
||||
// FF 15 <addr>), operand at offset 2; the VA stays as fallback.
|
||||
private static readonly byte?[] PatXrefRecvFromSlot = [ 0xFF, 0x15, null, null, null, null, 0x8B, 0xF0, 0x85, 0xF6, 0x7E, 0x67 ];
|
||||
|
||||
private static IntPtr _originalRecvFromPtr;
|
||||
|
||||
public static bool IsInstalled { get; private set; }
|
||||
|
|
@ -28,12 +32,16 @@ internal static class RawPacketHooks
|
|||
{
|
||||
if (IsInstalled) return;
|
||||
|
||||
int slotAddr = RecvFromPtrAddr;
|
||||
if (AcClientModule.TryReadTextSection(out AcClientTextSection text))
|
||||
slotAddr = HookResolver.ResolveData(text, "RawPacket.RecvFromSlot", PatXrefRecvFromSlot, 2, RecvFromPtrAddr).Address.ToInt32();
|
||||
|
||||
unsafe
|
||||
{
|
||||
IntPtr fnPtrAddr = new IntPtr(RecvFromPtrAddr);
|
||||
IntPtr fnPtrAddr = new IntPtr(slotAddr);
|
||||
if (!SmartBoxLocator.IsMemoryReadable(fnPtrAddr, 4))
|
||||
{
|
||||
RynthLog.Compat("RawPacket: RecvFrom pointer address 0x007935AC not readable — skipping.");
|
||||
RynthLog.Compat($"RawPacket: RecvFrom pointer address 0x{slotAddr:X8} not readable — skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -62,6 +70,7 @@ internal static class RawPacketHooks
|
|||
private static unsafe int RecvFromDetour(
|
||||
IntPtr s, IntPtr buf, int len, int flags, IntPtr from, IntPtr fromlen)
|
||||
{
|
||||
RecursionGuard.Tick("RawPacketHooks.RecvFrom");
|
||||
delegate* unmanaged[Stdcall]<IntPtr, IntPtr, int, int, IntPtr, IntPtr, int> original =
|
||||
(delegate* unmanaged[Stdcall]<IntPtr, IntPtr, int, int, IntPtr, IntPtr, int>)_originalRecvFromPtr;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue