IsValidAddress() public method

Determines whether or not the specified address exists in xbox memory.
public IsValidAddress ( uint address ) : bool
address uint
return bool
        public void Read(uint address, int length, byte[] buffer, int offset, ref int read)
        {
            // only check base address - would add too much overhead to check range
            // plus, it's much more likely that the entire range will be valid if the base address is
            if (safeMode & !Xbox.IsValidAddress(address))
            {
                throw new Exception("Safe Mode detected invalid base address");
            }

            int iterations = (int)length / bufferSize;
            int remainder  = (int)length % bufferSize;

            read = 0;

            StatusResponse response;

            for (int i = 0; i < iterations; i++)
            {
                response = Xbox.SendCommand("getmem2 addr=0x{0} length={1}", Convert.ToString(address + read, 16).PadLeft(8, '0'), bufferSize);
                Xbox.Wait(bufferSize);
                Xbox.Connection.Client.Receive(buffer, (int)(offset + read), bufferSize, SocketFlags.None);
                read += bufferSize;
            }

            if (remainder > 0)
            {
                response = Xbox.SendCommand("getmem2 addr=0x{0} length={1}", Convert.ToString(address + read, 16).PadLeft(8, '0'), remainder);
                Xbox.Wait(remainder);
                Xbox.Connection.Client.Receive(buffer, (int)(offset + read), remainder, SocketFlags.None);
                read += remainder;
            }
        }
Example #2
0
 static bool ValidateBaseAddress(Xbox xbox, uint base_address)
 {
     // 0x20000 to avoid someone overwriting the header
     return(base_address >= 0x20000 && base_address < uint.MaxValue &&
            xbox.IsValidAddress(base_address));
 }
Example #3
0
		static bool ValidateBaseAddress(Xbox xbox, uint base_address)
		{
			// 0x20000 to avoid someone overwriting the header
			return base_address >= 0x20000 && base_address < uint.MaxValue && 
				xbox.IsValidAddress(base_address);
		}