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,37 @@
using System.Runtime.InteropServices;
namespace WeaveLoader.API.Native;
public enum NativeType : byte
{
I32 = 1,
I64 = 2,
F32 = 3,
F64 = 4,
Ptr = 5,
Bool = 6
}
[StructLayout(LayoutKind.Sequential)]
public struct NativeArg
{
public NativeType Type;
public ulong Value;
public static NativeArg FromInt(int value) => new() { Type = NativeType.I32, Value = unchecked((ulong)value) };
public static NativeArg FromLong(long value) => new() { Type = NativeType.I64, Value = unchecked((ulong)value) };
public static NativeArg FromBool(bool value) => new() { Type = NativeType.Bool, Value = value ? 1UL : 0UL };
public static NativeArg FromPtr(nint value) => new() { Type = NativeType.Ptr, Value = unchecked((ulong)value) };
}
[StructLayout(LayoutKind.Sequential)]
public struct NativeRet
{
public NativeType Type;
public ulong Value;
public int AsInt() => unchecked((int)Value);
public long AsLong() => unchecked((long)Value);
public bool AsBool() => Value != 0;
public nint AsPtr() => unchecked((nint)Value);
}