public static Entity ReadAnyByEntityListAnchor(MvProcess process, long entityListAnchor, int index) { long entityAnchor = process.ReadPointer32(entityListAnchor + index * EntityStepSize); // Read the player pointer. if (entityAnchor != 0) { Entity entity = new Entity(process, entityAnchor); entity?.Read(); return(entity); } return(null); }
private static void InitilazeBaseAddresses(MvProcess process) { // Find out the View Matrix base address: _mViewMatrixAnchor = 0x3 + (long)process.ScanModuleByPattern(ClientModule, Signatures.ViewMatrixPattern); _mViewMatrixAnchor = 0xB0 + process.ReadPointer32(_mViewMatrixAnchor); // Find out the GlowO Object base address: _mGlowObjectAnchor = process.ReadPointer32((long)process[ClientModule].BaseAddress + Signatures.GlowObjectOffset); _mGlowObjectAnchor = process.ReadPointer32(_mGlowObjectAnchor); // Find out the Entity List base address: _mEntityListAnchor = 0xB + (long)process.ScanModuleByPattern(ClientModule, Signatures.EntityListPattern); _mEntityListAnchor = process.ReadPointer32(_mEntityListAnchor); Entity localPlayer = Entity.ReadLocalPlayerByEntityListAnchor(process, _mEntityListAnchor); Console.WriteLine(localPlayer); Entity enemy = Entity.ReadAnyByEntityListAnchor(process, _mEntityListAnchor, 1); Console.WriteLine(enemy); Console.WriteLine(enemy.Anchor.ToString("X")); Console.WriteLine($"ViewMatrix: {_mViewMatrixAnchor:X}, GlowObject: {((long)process[ClientModule].BaseAddress + Signatures.GlowObjectOffset):X}, EntityList: {_mEntityListAnchor:X}"); }