Esempio n. 1
0
        public byte[] DemuxBMDBytes(PkmnMapHeader_Hg map, int type)
        {
            if (_stream.GetRemainingLength() < 0x18L)
            {
                throw new Exception("File too short to contain NSBMD!");
            }
            _stream.Position = map.BMDOffset;
            if (_stream.GetRemainingLength() < 0x10L)
            {
                throw new Exception("File too short to contain NSBMD!");
            }
            int num = 0;

            for (int i = 0; i < 4; i++)
            {
                num = _reader.ReadInt32();
                if (num == 0x30444d42)
                {
                    break;
                }
            }
            if (num != 0x30444d42)
            {
                throw new InvalidDataException("No BMD0 Header at expected offset!");
            }
            Stream stream1 = _stream;

            stream1.Position -= 4L;
            return(_reader.ReadBytes((int)map.BMDSize));
        }
Esempio n. 2
0
        public static PkmnMapHeader_Hg FromReader(BinaryReader reader)
        {
            PkmnMapHeader_Hg hg = new PkmnMapHeader_Hg {
                MovSize  = reader.ReadUInt32(),
                ObjSize  = reader.ReadUInt32(),
                BMDSize  = reader.ReadUInt32(),
                BDHCSize = reader.ReadUInt32()
            };

            reader.BaseStream.Seek(2L, SeekOrigin.Current);
            hg.S0Size = reader.ReadUInt16();
            return(hg);
        }
Esempio n. 3
0
 public byte[] DemuxS0Bytes(PkmnMapHeader_Hg map)
 {
     _stream.Position = map.S0Offset;
     return(_reader.ReadBytes(((int)map.S0Size) + 4));
 }
Esempio n. 4
0
 public byte[] DemuxObjBytes(PkmnMapHeader_Hg map)
 {
     _stream.Position = map.ObjOffset;
     return(_reader.ReadBytes((int)map.ObjSize));
 }
Esempio n. 5
0
 public byte[] DemuxBdhcBytes(PkmnMapHeader_Hg map)
 {
     _stream.Position = map.BdhcOffset;
     return(_reader.ReadBytes((int)map.BDHCSize));
 }