feat(modloader): pdb mapping, dynamic invoke, mixins

This commit is contained in:
Jacobwasbeast
2026-03-10 17:45:25 -05:00
parent 70dbff3fac
commit be327befa4
34 changed files with 2535 additions and 7 deletions

View File

@@ -0,0 +1,25 @@
using System;
using System.Runtime.InteropServices;
namespace WeaveLoader.API.Native;
public static class NativeMemory
{
public static byte ReadByte(nint basePtr, int offset)
=> Marshal.ReadByte(basePtr, offset);
public static int ReadInt32(nint basePtr, int offset)
=> Marshal.ReadInt32(basePtr, offset);
public static long ReadInt64(nint basePtr, int offset)
=> Marshal.ReadInt64(basePtr, offset);
public static double ReadDouble(nint basePtr, int offset)
=> BitConverter.Int64BitsToDouble(ReadInt64(basePtr, offset));
public static bool ReadBool(nint basePtr, int offset)
=> ReadByte(basePtr, offset) != 0;
public static nint ReadPtr(nint basePtr, int offset)
=> Marshal.ReadIntPtr(basePtr, offset);
}