Class GameMemory
- Namespace
- SkyrimForge.Game
- Assembly
- SkyrimForge.Game.dll
Reads and writes memory at an address, and converts between addresses and views.
public static class GameMemory
- Inheritance
-
GameMemory
- Inherited Members
Remarks
An address that maps no memory faults when it is read or written, and the process ends.
Methods
AsRef<T>(nint)
A reference to the value of type T at an address, through which the value is read and written.
public static ref T AsRef<T>(nint address) where T : unmanaged
Parameters
addressnint
Returns
- T
Type Parameters
T
Exceptions
- ArgumentOutOfRangeException
addressis 0 or outside user-mode memory.
AsSpan(nint, int)
The bytes at an address, as a span through which they are read and written.
public static Span<byte> AsSpan(nint address, int length)
Parameters
Returns
Exceptions
- ArgumentOutOfRangeException
addressis 0 or outside user-mode memory, orlengthis negative.
AsView<T>(nint)
A view of type T over an address. A view over 0 has no address, and its Exists is false.
public static T AsView<T>(nint address) where T : struct, IAddressable
Parameters
addressnint
Returns
- T
Type Parameters
T
Remarks
The object at the address is not checked, so a view over an object of another type reads that object's memory as this type's.
GetAddress<T>(T)
The address a view is over.
public static nint GetAddress<T>(T view) where T : struct, IAddressable
Parameters
viewT
Returns
Type Parameters
T
Exceptions
- InvalidOperationException
The view has no address, or one outside user-mode memory.
Matches(nint, BytePattern)
Whether the bytes at an address match a pattern.
public static bool Matches(nint address, BytePattern pattern)
Parameters
addressnintpatternBytePattern
Returns
Exceptions
- ArgumentNullException
patternisnull.- ArgumentOutOfRangeException
addressis 0 or outside user-mode memory.