Beispiel #1
0
        private float GetMemoryValueFloat(IntPtr hProc, IntPtr ptr, int[] offsets)
        {
            var address = WinAPIWrapper.FindDMAAddy(hProc, ptr, offsets);

            byte[] bytes = new byte[4];
            WinAPIWrapper.ReadProcessMemory(hProc, address, bytes, 4, out _);
            return(BitConverter.ToSingle(bytes, 0));
        }
Beispiel #2
0
        public void SetRopes(int ropes)
        {
            if (ropes > 99)
            {
                ropes = 99;
            }

            var ropesAddress = WinAPIWrapper.FindDMAAddy(ProcessInformation.hProc, ProcessInformation.moduleBaseAddress + 0x138558, new int[] { 0x30, 0x280, 0x14 });

            WinAPIWrapper.WriteProcessMemory(ProcessInformation.hProc, ropesAddress, ropes, 4, out _);
        }
Beispiel #3
0
        public void SetBombs(int bombs)
        {
            if (bombs > 99)
            {
                bombs = 99;
            }

            var bombsAddress = WinAPIWrapper.FindDMAAddy(ProcessInformation.hProc, ProcessInformation.moduleBaseAddress + 0x138558, new int[] { 0x30, 0x280, 0x10 });

            WinAPIWrapper.WriteProcessMemory(ProcessInformation.hProc, bombsAddress, bombs, 4, out _);
        }
Beispiel #4
0
        public void SetMoney(int money)
        {
            if (money > 1874919423)
            {
                money = 1874919423;
            }

            var moneyAddress = WinAPIWrapper.FindDMAAddy(ProcessInformation.hProc, ProcessInformation.moduleBaseAddress + 0x1384B4, new int[] { 0x0044592c });

            WinAPIWrapper.WriteProcessMemory(ProcessInformation.hProc, moneyAddress, money, 4, out _);
        }
Beispiel #5
0
        public void TeleportEntityToPlayer(int index)
        {
            var playerX = GetCurrentX();
            var playerY = GetCurrentY();

            var entityXAddress = WinAPIWrapper.FindDMAAddy(ProcessInformation.hProc, ProcessInformation.moduleBaseAddress + 0x1384B4, new int[] { 0x30, index, 0x30 });
            var entityYAddress = WinAPIWrapper.FindDMAAddy(ProcessInformation.hProc, ProcessInformation.moduleBaseAddress + 0x1384B4, new int[] { 0x30, index, 0x34 });

            WinAPIWrapper.WriteProcessMemory(ProcessInformation.hProc, entityXAddress, playerX, 4, out _);
            WinAPIWrapper.WriteProcessMemory(ProcessInformation.hProc, entityYAddress, playerY, 4, out _);
        }
Beispiel #6
0
        public void TeleportPlayer(Vector2 location)
        {
            if (location == default)
            {
                throw new ArgumentException("Location cannot be null!");
            }

            var playerXAddress = WinAPIWrapper.FindDMAAddy(ProcessInformation.hProc, ProcessInformation.moduleBaseAddress + 0x138558, new int[] { 0x30, 0x30 });
            var playerYAddress = WinAPIWrapper.FindDMAAddy(ProcessInformation.hProc, ProcessInformation.moduleBaseAddress + 0x138558, new int[] { 0x30, 0x34 });

            WinAPIWrapper.WriteProcessMemory(ProcessInformation.hProc, playerXAddress, location.X, 4, out _);
            WinAPIWrapper.WriteProcessMemory(ProcessInformation.hProc, playerYAddress, location.Y, 4, out _);
        }
Beispiel #7
0
        public void SetHearts(int hearts)
        {
            if (hearts < 1)
            {
                return;
            }

            if (hearts > 99)
            {
                hearts = 99;
            }

            var hpAddress = WinAPIWrapper.FindDMAAddy(ProcessInformation.hProc, ProcessInformation.moduleBaseAddress + 0x138558, new int[] { 0x30, 0x140 });

            WinAPIWrapper.WriteProcessMemory(ProcessInformation.hProc, hpAddress, hearts, 4, out _);
        }
Beispiel #8
0
        private void InitializeTrainer()
        {
            spelunkyProcessInformation = new ProcessInformation();

            var processes = Process.GetProcessesByName("Spelunky");

            if (processes != null && processes.Any())
            {
                spelunkyProcessInformation.process = Process.GetProcessesByName("Spelunky")[0];
            }
            else
            {
                MessageBox.Show("Unable to find Spelunky. Make sure the game is running!");
                Application.Exit();
                Environment.Exit(Environment.ExitCode);
                return;
            }


            spelunkyProcessInformation.hProc             = WinAPIWrapper.OpenProcess(WinAPIWrapper.ProcessAccessFlags.All, false, spelunkyProcessInformation.process.Id);
            spelunkyProcessInformation.moduleBaseAddress = WinAPIWrapper.GetModuleBaseAddress(spelunkyProcessInformation.process.Id, "Spelunky.exe");

            HackScripts = new HackScripts(spelunkyProcessInformation);
        }
Beispiel #9
0
        public void SetRightTime(int time)
        {
            var rightTimeAddress = WinAPIWrapper.FindDMAAddy(ProcessInformation.hProc, ProcessInformation.moduleBaseAddress + 0x1384B4, new int[] { (0x445954 - 0x10) });

            WinAPIWrapper.WriteProcessMemory(ProcessInformation.hProc, rightTimeAddress, time, 4, out _);
        }
Beispiel #10
0
        public void SetCurrentHoldingItem(int itemId)
        {
            var playerHoldingItemAddress = WinAPIWrapper.FindDMAAddy(ProcessInformation.hProc, ProcessInformation.moduleBaseAddress + 0x138558, new int[] { 0x30, 0x280, 0x88 });

            WinAPIWrapper.WriteProcessMemory(ProcessInformation.hProc, playerHoldingItemAddress, itemId, 4, out _);
        }
Beispiel #11
0
        public void SetStage(int stage)
        {
            var stageAddress = WinAPIWrapper.FindDMAAddy(ProcessInformation.hProc, ProcessInformation.moduleBaseAddress + 0x1384B4, new int[] { 0x4405d4 });

            WinAPIWrapper.WriteProcessMemory(ProcessInformation.hProc, stageAddress, stage, 4, out _);
        }
Beispiel #12
0
        public void SetFavor(int favor)
        {
            var favorAddress = WinAPIWrapper.FindDMAAddy(ProcessInformation.hProc, ProcessInformation.moduleBaseAddress + 0x138558, new int[] { 0x30, 0x280, 0x529C });

            WinAPIWrapper.WriteProcessMemory(ProcessInformation.hProc, favorAddress, favor, 4, out _);
        }