Example #1
0
        public bool Init(string windowName)
        {
            this.Hwnd = WinApiHandler.FindWindow(null, windowName);
            uint dwProcId = 0;

            WinApiHandler.GetWindowThreadProcessId(this.Hwnd, out dwProcId);
            this.HProcHandle = WinApiHandler.OpenProcess((int)ProcessAccessFlags.All, false, Convert.ToInt32(dwProcId));

            return(this.IsWindowAvailable);
        }
Example #2
0
        private UInt32 FindDmaAddress(int PointerLevel, IntPtr hProcHandle, UInt32[] Offsets, UInt32 BaseAddress)
        {
            UInt32 pointer = BaseAddress;

            UInt32 pTemp = 0;

            byte[] buffer      = new byte[24];
            UInt32 pointerAddr = 0;
            IntPtr tmp;

            for (int i = 0; i < PointerLevel; i++)
            {
                if (i == 0)
                {
                    WinApiHandler.ReadProcessMemory(hProcHandle, (IntPtr)pointer, buffer, 4, out tmp);
                }
                pTemp       = BitConverter.ToUInt32(buffer, 0);
                pointerAddr = pTemp + Offsets[i];
                WinApiHandler.ReadProcessMemory(hProcHandle, (IntPtr)pointerAddr, buffer, 4, out tmp);
            }
            return(pointerAddr);
        }
Example #3
0
        private void WriteToMemory(IntPtr hProcHandle, UInt32 LobbyAddressToWrite, byte[] val)
        {
            UIntPtr tmp;

            WinApiHandler.WriteProcessMemory(hProcHandle, (IntPtr)LobbyAddressToWrite, val, (uint)val.Length, out tmp);
        }