API Reference › Memory
IMemoryService
InterfaceNamespace: SwiftlyS2.Shared.Memory · Assembly: SwiftlyS2.CS2.dll
public interface IMemoryServiceMethods
Allocate a block of memory.
nint Alloc(ulong size)Parameters
- sizeulongThe size of the memory block to allocate.
Free a block of memory.
void Free(nint pointer)Parameters
- pointernintThe address of the memory block to free.
Get the address of a ida-style signature.
nint? GetAddressBySignature(string library, string signature)Parameters
Get the address of an valve or swiftly native interface by its name.
nint? GetInterfaceByName(string name)Parameters
- namestringThe name of the interface.
Get the vtable name of an object pointer.
string? GetObjectPtrVtableName(nint address)Parameters
- addressnintThe address of the object pointer.
Get an unmanaged function by its address.
IUnmanagedFunction<TDelegate> GetUnmanagedFunctionByAddress<TDelegate>(nint address) where TDelegate : DelegateParameters
- addressnintThe address of the unmanaged function.
Returns
IUnmanagedFunction<TDelegate>
The unmanaged function.
Get an unmanaged function by its vtable address and index.
IUnmanagedFunction<TDelegate> GetUnmanagedFunctionByVTable<TDelegate>(nint pVTable, int index) where TDelegate : DelegateReturns
IUnmanagedFunction<TDelegate>
The unmanaged function.
Get an unmanaged memory block by its address.
IUnmanagedMemory GetUnmanagedMemoryByAddress(nint address)Parameters
- addressnintThe address from which to create the Unmanaged Memory wrapper.
Returns
Get the address of a vtable by its name.
nint? GetVTableAddress(string library, string vtableName)Parameters
Check if an object pointer has a base class.
bool ObjectPtrHasBaseClass(nint address, string baseClassName)Parameters
Check if an object pointer has a vtable.
bool ObjectPtrHasVtable(nint address)Parameters
- addressnintThe address of the object pointer.
Resize a block of memory.
nint Resize(nint pointer, ulong newSize)Parameters
Resolve the address of a xref signature.
nint ResolveXrefAddress(nint xrefAddress)Parameters
- xrefAddressnintThe address of the xref.
Convert a raw address to a schema class.
T ToSchemaClass<T>(nint address) where T : class, ISchemaClass<T>Parameters
- addressnintThe address of the schema class.
Returns
T
The schema class.
Convert a raw address to a server-side client.
IServerSideClient ToServerSideClient(nint address)Parameters
- addressnintThe address of the server-side client.