Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="proc"></param>
        public GameMemory(int pid)
        {
            memoryAccess = new ProcessMemory.ProcessMemory(pid);
            BaseAddress  = NativeWrappers.GetProcessBaseAddress(pid, ProcessMemory.PInvoke.ListModules.LIST_MODULES_64BIT).ToInt64(); // Bypass .NET's managed solution for getting this and attempt to get this info ourselves via PInvoke since some users are getting 299 PARTIAL COPY when they seemingly shouldn't. This is built as x64 only and RE3 is x64 only to my knowledge.
            SelectPointerAddresses();

            // Setup the pointers.
            PointerIGT          = new MultilevelPointer(memoryAccess, BaseAddress + pointerAddressIGT, 0x60L);       // *
            PointerRank         = new MultilevelPointer(memoryAccess, BaseAddress + pointerAddressRank);             // *
            PointerPlayerHP     = new MultilevelPointer(memoryAccess, BaseAddress + pointerAddressHP, 0x50L, 0x20L); // *
            PointerPlayerPoison = new MultilevelPointer(memoryAccess, BaseAddress + pointerAddressPoison, 0x50L, 0x20L, 0xF8L);

            PointerEnemyEntryCount = new MultilevelPointer(memoryAccess, BaseAddress + pointerAddressEnemy, 0x30L); // *
            GenerateEnemyEntries();

            PointerInventoryEntries = new MultilevelPointer[20];
            for (long i = 0; i < PointerInventoryEntries.Length; ++i)
            {
                PointerInventoryEntries[i] = new MultilevelPointer(memoryAccess, BaseAddress + pointerAddressInventory, 0x50L, 0x98L, 0x10L, 0x20L + (i * 0x08L), 0x18L); // *
            }
            // Initialize variables to default values.
            PlayerCurrentHealth = 0;
            PlayerMaxHealth     = 0;
            PlayerPoisoned      = false;
            PlayerInventory     = new InventoryEntry[20];
            EnemyHealth         = new EnemyHP[32];
            IGTRunningTimer     = 0L;
            IGTCutsceneTimer    = 0L;
            IGTMenuTimer        = 0L;
            IGTPausedTimer      = 0L;
            Rank      = 0;
            RankScore = 0f;
        }
Exemplo n.º 2
0
 public MultilevelPointer(ProcessMemory memoryAccess, long baseAddress, params long[] offsets)
 {
     this.memoryAccess = memoryAccess;
     this.BaseAddress  = baseAddress;
     this.Address      = 0L;
     this.offsets32    = null;
     this.offsets64    = offsets;
     UpdatePointers();
 }
Exemplo n.º 3
0
        internal void Initialize(int pid)
        {
            memoryAccess = new ProcessMemory.ProcessMemory(pid);

            if (ProcessRunning)
            {
                BaseAddress = NativeWrappers.GetProcessBaseAddress(pid, PInvoke.ListModules.LIST_MODULES_64BIT).ToInt64(); // Bypass .NET's managed solution for getting this and attempt to get this info ourselves via PInvoke since some users are getting 299 PARTIAL COPY when they seemingly shouldn't.

                PointerPlayerHP = new MultilevelPointer(memoryAccess, BaseAddress + pointerAddressHP, 0xC0L, 0x48L, 0x98L, 0x78L);
            }
        }
        internal void Initialize(Process process)
        {
            if (process == null)
            {
                return; // Do not continue if this is null.
            }
            SelectPointerAddresses();

            int pid = GetProcessId(process).Value;

            memoryAccess = new ProcessMemory.ProcessMemory(pid);

            if (ProcessRunning)
            {
                BaseAddress = NativeWrappers.GetProcessBaseAddress(pid, PInvoke.ListModules.LIST_MODULES_64BIT).ToInt64(); // Bypass .NET's managed solution for getting this and attempt to get this info ourselves via PInvoke since some users are getting 299 PARTIAL COPY when they seemingly shouldn't.

                PointerSecretAreas = new MultilevelPointer(memoryAccess, BaseAddress + PointerAddressSecretAreas, 0x148L, 0x8L, 0x50L, 0x3E0L, 0x10L);
            }
        }
Exemplo n.º 5
0
        private static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.DarkRed;

            Console.WriteLine(new string('-', 35) + "Process Memory" + new string('-', 35));
            Console.WriteLine("");
            Console.ForegroundColor = ConsoleColor.Green;

            Console.WriteLine("Author : Shayan Firoozi , Bandar Abbas - Iran");
            Console.WriteLine("Email :  [email protected]");

            Console.ForegroundColor = ConsoleColor.DarkRed;

            Console.WriteLine("");
            Console.WriteLine(new string('-', 84));
            Console.WriteLine("");

            if (IsAdministrator() == false)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Please run this app as administrator...");
                Console.WriteLine("Press any key to exit...");

                Console.ReadLine();
                return;
            }


            try
            {
                ProcessMemory processMemory = new ProcessMemory("_LNPR_.exe", "BNazaninBold.ttf", true);

                Console.ForegroundColor = ConsoleColor.Red;

                if (processMemory.ProcessInfo != null)
                {
                    Console.WriteLine("Process Name : " + processMemory.ProcessInfo.ProcessName +
                                      " running on " + processMemory.ProcessInfo.MachineName);

                    Console.WriteLine("Process Base Address : " + processMemory.ProcessInfo.MainModule.BaseAddress.ToString());

                    Console.WriteLine("");


                    if (processMemory.ModuleInfo != null)
                    {
                        Console.WriteLine("Module Name : " + processMemory.ModuleInfo.ModuleName +
                                          " running on " + processMemory.ProcessInfo.ProcessName);


                        Console.WriteLine("Module Address : " + processMemory.ModuleInfo.BaseAddress.ToString());
                    }


                    Console.ForegroundColor = ConsoleColor.Blue;

                    Console.WriteLine("");
                    Console.WriteLine("Reading process memory : ");
                    Console.WriteLine("");

                    Console.ForegroundColor = ConsoleColor.White;

                    Console.WriteLine(processMemory.ReadProcMemoryString(new IntPtr(processMemory.ProcessInfo.MainModule.BaseAddress.ToInt32()),
                                                                         (int)1024,
                                                                         ProcessMemory.ReadWriteMemoryEncoding.ASCII));
                }
            }
            catch (Exception ex)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("An error occured : " + Environment.NewLine + ex.Message);
            }


            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("");
            Console.WriteLine("Press any key to exit...");
            Console.ReadLine();
        }