cleanup
This commit is contained in:
parent
8a0e4bb481
commit
0df70abad7
24 changed files with 0 additions and 1225 deletions
|
|
@ -1,35 +0,0 @@
|
|||
namespace Roboto.Memory;
|
||||
|
||||
/// <summary>
|
||||
/// Shared state for all memory reader classes. Holds the process handle, offsets, registry,
|
||||
/// and resolved module/GameState base addresses.
|
||||
/// </summary>
|
||||
public sealed class MemoryContext
|
||||
{
|
||||
public ProcessMemory Memory { get; }
|
||||
public GameOffsets Offsets { get; }
|
||||
public ObjectRegistry Registry { get; }
|
||||
public nint ModuleBase { get; set; }
|
||||
public int ModuleSize { get; set; }
|
||||
public nint GameStateBase { get; set; }
|
||||
|
||||
public MemoryContext(ProcessMemory memory, GameOffsets offsets, ObjectRegistry registry)
|
||||
{
|
||||
Memory = memory;
|
||||
Offsets = offsets;
|
||||
Registry = registry;
|
||||
}
|
||||
|
||||
public bool IsModuleAddress(nint value)
|
||||
{
|
||||
return ModuleBase != 0 && ModuleSize > 0 &&
|
||||
value >= ModuleBase && value < ModuleBase + ModuleSize;
|
||||
}
|
||||
|
||||
public bool IsValidHeapPtr(nint ptr)
|
||||
{
|
||||
if (ptr == 0) return false;
|
||||
var high = (ulong)ptr >> 32;
|
||||
return high > 0 && high < 0x7FFF && (ptr & 0x3) == 0;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue