/// <summary> /// Initializes the MPQArchive, retriving of all the meta information about the file. /// </summary> /// <param name="Filename">Filename of the MPQ file to be opened</param> public MPQArchive(string Filename) { m_BaseStream = File.Open(Filename, FileMode.Open, FileAccess.Read); MPQHeader = GetMPQHeader(); m_BinaryReader = new BinaryReader(m_BaseStream); m_MPQHashTable = GetMPQHashTable(m_BinaryReader); m_MPQBlockTable = GetMPQBlockTable(m_BinaryReader); ExtractFiles(); }
/// <summary> /// Populates the MPQ Header data. /// </summary> /// <returns>An MPQHeader object containing the MPQ Header data.</returns> public MPQHeader GetMPQHeader() { BinaryReader BinaryReader = new BinaryReader(m_BaseStream); m_BaseStream.Seek(0, SeekOrigin.Begin); MPQHeader returnMPQH = new MPQHeader(BinaryReader); return returnMPQH; }