예제 #1
0
파일: Program.cs 프로젝트: cyberspaceru/MVP
        private static MvProcess FindProcess(string processName)
        {
            var result = MvProcess.FindByName(processName);

            if (result == null)
            {
                ProcessEx.PrintAllProcessesNames();
                Console.WriteLine($"Can't find the process with name \"{ProcessName}\".");
            }
            return(result);
        }
예제 #2
0
        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);
        }
예제 #3
0
파일: Program.cs 프로젝트: cyberspaceru/MVP
        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}");
        }
예제 #4
0
 protected Player(MvProcess process, long anchor) : base(process, anchor)
 {
 }
예제 #5
0
        public static Entity ReadLocalPlayerByEntityListAnchor(MvProcess process, long entityListAnchor)
        {
            var entity = ReadAnyByEntityListAnchor(process, entityListAnchor, LocalPlayerIndex);

            return(entity);
        }
예제 #6
0
        private const long EntityStepSize = 0x10; // Step size between entities in the list.

        public Entity(MvProcess process, long anchor) : base(process, anchor)
        {
        }
예제 #7
0
        }                           // Don't storage pointers (Anchor is the base address which using to initializing an object with offsets).

        protected ProcessReader(MvProcess process, long anchor)
        {
            Process = process;
            Anchor  = anchor;
        }