예제 #1
0
 public void Read()
 {
     if (!IsOpen || IsDisposed)
     {
         throw new Exception("XenonPatch.Read: The Xenon patch is not open.");
     }
     if (HasBeenRead)
     {
         throw new Exception("XenonPatch.Read: The Xenon patch has already been read.");
     }
     eio.SetPosition(0);
     Patches = new List <PatchEntry>();
     //Just has Kernel+XAM.
     {
         var nextAddr = eio.Reader.ReadUInt32();
         while (nextAddr != uint.MaxValue)
         {
             eio.SetPosition(-4, SeekOrigin.Current);
             var entry = new PatchEntry();
             entry.Read(eio.Reader);
             Patches.Add(entry);
             nextAddr = eio.Reader.ReadUInt32();
         }
     }
     HasBeenRead = true;
 }
예제 #2
0
 public NeighborhoodDrives(XboxConsole Console, EndianIO XMS, uint NopAddress, uint DriveTableAddress, uint MountedPackageTableAddress, uint[] XBDMRange)
 {
     if (XBDMRange.Length != 2 || XBDMRange[0] == 0 || XBDMRange[1] == 0)
     {
         throw new Exception("NeighborhoodDrives: Invalid XBDM range specified.");
     }
     console    = Console;
     xms        = XMS;
     dtAddress  = DriveTableAddress;
     mptAddress = MountedPackageTableAddress;
     xbdmRange  = XBDMRange;
     if (NopAddress != 0)
     {
         xms.SetPosition(NopAddress);
         xms.Writer.Write(0x60000000);
     }
 }
예제 #3
0
        public Dictionary <string, string> GetMountedPackageDeviceNames()
        {
            if (!HaveBeenRead)
            {
                throw new Exception("NeighborhoodDrives.GetMountedPackageDeviceNames: The Neighborhood drives have not been read.");
            }
            var packages = new Dictionary <string, string>();

            xms.SetPosition(mptAddress);
            var nextAddr = xms.Reader.ReadUInt32();

            //The first uint in the structure is a pointer to the next one. If it is the same as the original pointer, then we have reached the end of the mounted package list.
            while (nextAddr != mptAddress)
            {
                xms.SetPosition(nextAddr + 0x9758);
                var deviceName = xms.Reader.ReadString(0x40, Encoding.ASCII, true);
                xms.SetPosition(-0x9357, SeekOrigin.Current);
                var packageName = xms.Reader.ReadString(35, Encoding.BigEndianUnicode, true);
                packages.Add(packageName, deviceName);
                xms.SetPosition(nextAddr);
                nextAddr = xms.Reader.ReadUInt32();
            }
            return(packages);
        }