Пример #1
0
        /// <summary>
        /// Retrieves data from a connected debug xbox
        /// </summary>
        /// <param name="Addr">The address to retrieve data from</param>
        /// <param name="size">The size of the data to return</param>
        /// <returns></returns>
        public static Object Peek(uint Addr, uint size)
        {
            if (!_IsConnected)
            {
                return(null);
            }

            // Calculate the offset

            switch (connectedDebugType)
            {
            case debugType.RthDLL:
                uint Ptr = BaseAddress + (Addr - VirtMatgOffset);

                // Init connection
                uint con = console.OpenConnection(null);

                // Poke
                uint   BytesRead = 0;
                byte[] Bytes     = new byte[size];
                console.DebugTarget.GetMemory(Ptr, size, Bytes, out BytesRead);

                // Close connection
                console.CloseConnection(con);
                return(Bytes);

            case debugType.YeloDebug:
                if (xboxDebug.ProcessID == 0)
                {
                    throw new Exception("No xbox processes loaded.");
                }
                return(xboxDebug.GetMemory(Addr, size));
            }
            return(null);
        }