Skip to content

Commit

Permalink
Add some more TERA.exe interop bindings needed by the symbiote.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrp committed Aug 26, 2023
1 parent f9b2a7e commit 377b304
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 1 deletion.
96 changes: 96 additions & 0 deletions src/client/symbiote/Interop/FArchive.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
namespace Vezel.Novadrop.Interop;

[StructLayout(LayoutKind.Explicit, Size = 0x8c)]
public unsafe struct FArchive
{
[StructLayout(LayoutKind.Sequential)]
public struct VirtualFunctionTable
{
public delegate* unmanaged<FArchive*, uint, FArchive*> __vdtor;

public delegate* unmanaged<FArchive*, void*, int> Serialize;

public delegate* unmanaged<FArchive*, void*, int> SerializeBits;

public delegate* unmanaged<FArchive*, uint*, uint> SerializeInt;

public void* __slot4;

public delegate* unmanaged<FArchive*, ulong, ulong> CountBytes;

public void* __slot6;

public void* __slot7;

public void* __slot8;

public void* __slot9;

public delegate* unmanaged<FArchive*, int> Tell;

public delegate* unmanaged<FArchive*, int> TotalSize;

public delegate* unmanaged<FArchive*, BOOL> AtEnd;

public delegate* unmanaged<FArchive*, int, void> Seek;

public void* __slot14;

public void* __slot15;

public void* __slot16;

public void* __slot17;

public void* __slot18;

public void* __slot19;

public delegate* unmanaged<FArchive*, void> Flush;

public delegate* unmanaged<FArchive*, BOOL> Close;

public delegate* unmanaged<FArchive*, BOOL> GetError;

public void* __slot23;

public void* __slot24;

public void* __slot25;

public void* __slot26;

public void* __slot27;

public void* __slot28;

public void* __slot29;
}

public static delegate* unmanaged<FArchive*, FArchive*> __ctor { get; } =
(delegate* unmanaged<FArchive*, FArchive*>)Tera.Resolve(0x7ff69a843f10);

public static delegate* unmanaged<FArchive*, uint, FArchive*> __vdtor { get; } =
(delegate* unmanaged<FArchive*, uint, FArchive*>)Tera.Resolve(0x7ff69a845fe0);

public static delegate* unmanaged<FArchive*, BOOL> AtEnd { get; } =
(delegate* unmanaged<FArchive*, BOOL>)Tera.Resolve(0x7ff69a846ac0);

public static delegate* unmanaged<FArchive*, void*, int, FArchive*> ByteOrderSerialize { get; } =
(delegate* unmanaged<FArchive*, void*, int, FArchive*>)Tera.Resolve(0x7ff69a846b10);

public static delegate* unmanaged<FArchive*, BOOL> Close { get; } =
(delegate* unmanaged<FArchive*, BOOL>)Tera.Resolve(0x7ff69a846ba0);

public static delegate* unmanaged<FArchive*, BOOL> GetError { get; } =
(delegate* unmanaged<FArchive*, BOOL>)Tera.Resolve(0x7ff69a8488f0);

public static delegate* unmanaged<FArchive*, void*, int, void> SerializeBits { get; } =
(delegate* unmanaged<FArchive*, void*, int, void>)Tera.Resolve(0x7ff69a84bf20);

public static delegate* unmanaged<FArchive*, uint*, uint, void> SerializeInt { get; } =
(delegate* unmanaged<FArchive*, uint*, uint, void>)Tera.Resolve(0x7ff69a84bf90);

[FieldOffset(0x0)]
public VirtualFunctionTable* VFT;
}
41 changes: 41 additions & 0 deletions src/client/symbiote/Interop/FBufferReader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
namespace Vezel.Novadrop.Interop;

[StructLayout(LayoutKind.Explicit, Size = 0xa0)]
public unsafe struct FBufferReader
{
[StructLayout(LayoutKind.Sequential)]
public struct VirtualFunctionTable
{
public FArchive.VirtualFunctionTable FArchive;
}

public static delegate* unmanaged<FBufferReader*, void*, int, BOOL, BOOL, FBufferReader*> __ctor { get; } =
(delegate* unmanaged<FBufferReader*, void*, int, BOOL, BOOL, FBufferReader*>)Tera.Resolve(0x7ff69a852b50);

public static delegate* unmanaged<FBufferReader*, void> __dtor { get; } =
(delegate* unmanaged<FBufferReader*, void>)Tera.Resolve(0x7ff69a854b20);

public static delegate* unmanaged<FBufferReader*, FBufferReader*> __vdtor { get; } =
(delegate* unmanaged<FBufferReader*, FBufferReader*>)Tera.Resolve(0x7ff69a8582e0);

public static delegate* unmanaged<FBufferReader*, BOOL> AtEnd { get; } =
(delegate* unmanaged<FBufferReader*, BOOL>)Tera.Resolve(0x7ff69a85be40);

public static delegate* unmanaged<FBufferReader*, BOOL> Close { get; } =
(delegate* unmanaged<FBufferReader*, BOOL>)Tera.Resolve(0x7ff69a85bfc0);

public static delegate* unmanaged<FBufferReader*, int, void> Seek { get; } =
(delegate* unmanaged<FBufferReader*, int, void>)Tera.Resolve(0x7ff69a879ef0);

public static delegate* unmanaged<FBufferReader*, void*, int, void> Serialize { get; } =
(delegate* unmanaged<FBufferReader*, void*, int, void>)Tera.Resolve(0x7ff69a87a370);

public static delegate* unmanaged<FBufferReader*, int> Tell { get; } =
(delegate* unmanaged<FBufferReader*, int>)Tera.Resolve(0x7ff69a87faf0);

[FieldOffset(0x0)]
public FArchive FArchive;

[FieldOffset(0x0)]
public VirtualFunctionTable* VFT;
}
5 changes: 4 additions & 1 deletion src/client/symbiote/Interop/IS1MemoryObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ public unsafe struct IS1MemoryObject
[StructLayout(LayoutKind.Sequential)]
public struct VirtualFunctionTable
{
public delegate* unmanaged<IS1MemoryObject*, uint, IS1MemoryObject*> __dtor;
public delegate* unmanaged<IS1MemoryObject*, uint, IS1MemoryObject*> __vdtor;

public delegate* unmanaged<IS1MemoryObject*, int> GetSize;
}

public static delegate* unmanaged<IS1MemoryObject*, uint, IS1MemoryObject*> __vdtor { get; } =
(delegate* unmanaged<IS1MemoryObject*, uint, IS1MemoryObject*>)Tera.Resolve(0x7ff69b4579e0);

[FieldOffset(0x0)]
public VirtualFunctionTable* VFT;
}
9 changes: 9 additions & 0 deletions src/client/symbiote/Interop/S1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@ namespace Vezel.Novadrop.Interop;
public static unsafe class S1
{
public static ref S1Context* Context => ref *(S1Context**)Tera.Resolve(0x7ff69d7b2040);

public static delegate* unmanaged<uint, uint, void*> appMalloc { get; } =
(delegate* unmanaged<uint, uint, void*>)Tera.Resolve(0x7ff69a8977d0);

public static delegate* unmanaged<void*, uint, uint, void*> appRealloc { get; } =
(delegate* unmanaged<void*, uint, uint, void*>)Tera.Resolve(0x7ff69a897870);

public static delegate* unmanaged<void*, void> appFree { get; } =
(delegate* unmanaged<void*, void>)Tera.Resolve(0x7ff69a897750);
}
9 changes: 9 additions & 0 deletions src/client/symbiote/Interop/S1ClientSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ public struct VirtualFunctionTable
public delegate* unmanaged<S1ClientSocket*, void> Disconnect;
}

public static delegate* unmanaged<S1ClientSocket*, IS1ConnectionEventHandler*, S1ClientSocket*> __ctor { get; } =
(delegate* unmanaged<S1ClientSocket*, IS1ConnectionEventHandler*, S1ClientSocket*>)Tera.Resolve(0x7ff69ba9fe80);

public static delegate* unmanaged<S1ClientSocket*, void> __dtor { get; } =
(delegate* unmanaged<S1ClientSocket*, void>)Tera.Resolve(0x7ff69baa38d0);

public static delegate* unmanaged<S1ClientSocket*, uint, S1ClientSocket*> __vdtor { get; } =
(delegate* unmanaged<S1ClientSocket*, uint, S1ClientSocket*>)Tera.Resolve(0x7ff69baa5540);

public static delegate* unmanaged<S1ClientSocket*, uint, ushort, BOOL> Connect { get; } =
(delegate* unmanaged<S1ClientSocket*, uint, ushort, BOOL>)Tera.Resolve(0x7ff69baa9de0);

Expand Down
3 changes: 3 additions & 0 deletions src/client/symbiote/Interop/S1ClientSocketBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ public struct InlineArray_data
private byte _element;
}

public static delegate* unmanaged<S1ClientSocketBuffer*, S1ClientSocketBuffer*> __ctor { get; } =
(delegate* unmanaged<S1ClientSocketBuffer*, S1ClientSocketBuffer*>)Tera.Resolve(0x7ff69baa27a0);

public static delegate* unmanaged<S1ClientSocketBuffer*, int, int> Consume { get; } =
(delegate* unmanaged<S1ClientSocketBuffer*, int, int>)Tera.Resolve(0x7ff69babc170);

Expand Down

0 comments on commit 377b304

Please sign in to comment.