public byte[] DemuxBMDBytes(PkmnMapHeader map, int type) { _stream.Position = 0L; if (_stream.GetRemainingLength() < 0x18L) { throw new Exception("File too short to contain NSBMD!"); } if (type == DPPMAP || type == PLMAP) { _stream.Position = map.BMDOffset; } else { _stream.Position = 4L; map.BMDSize = (uint)_reader.ReadInt32(); _stream.Position = 0L; } 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)); }
public byte[] DemuxObjBytes(PkmnMapHeader map) { _stream.Position = map.ObjOffset; return(_reader.ReadBytes((int)map.ObjSize)); }
public byte[] DemuxBdhcBytes(PkmnMapHeader map) { _stream.Position = map.BdhcOffset; return(_reader.ReadBytes((int)map.BDHCSize)); }