Ejemplo n.º 1
0
        public void Read(XeReader reader) {
            reader.Seek(Origin, SeekOrigin.Begin);

            // First read the header
            var header = new byte[0x10];
            reader.Read(header, 0, 0x10);

            // Parse info bits
            magic = BufferUtils.ToUInt16(header, 0x00);
            version = BufferUtils.ToUInt16(header, 0x02);
            unkWord1 = BufferUtils.ToUInt16(header, 0x04);
            unkWord2 = BufferUtils.ToUInt16(header, 0x06);
            entryPoint = BufferUtils.ToUInt32(header, 0x08);
            length = BufferUtils.ToUInt32(header, 0x0c);

            hmacSalt = new byte[0x10];
            reader.Read(hmacSalt, 0, 0x10);

            reader.Seek(Origin + length, SeekOrigin.Begin);
        }
Ejemplo n.º 2
0
        public void Read(XeReader reader) {
            reader.Seek(0, SeekOrigin.Begin);

            magic = reader.ReadUInt16();
            version = reader.ReadUInt16();

            reader.Seek(0x08, SeekOrigin.Begin);
            bootloaderOffset = reader.ReadUInt32();
            length = reader.ReadUInt32();
            copyright = reader.ReadString(0x37);

            reader.Seek(0x60, SeekOrigin.Begin);
            kvOffset = reader.ReadUInt32();

            reader.Seek(0x78, SeekOrigin.Begin);
            smcSize = reader.ReadUInt32();
            smcOffset = reader.ReadUInt32();

            reader.Seek(smcOffset, SeekOrigin.Begin);
            SMC = new SMC();
            SMC.Read(reader, (int)smcSize);

            reader.Seek(bootloaderOffset, SeekOrigin.Begin);

            SB = new CXBootloader(Stream);

            SC = new CXBootloader(Stream);

            SD = new CXBootloader(Stream);

            SE = new CEBootloader(Stream);
        }