/// <summary> /// Read from a stream and get an ExeFS header, if possible /// </summary> /// <param name="reader">BinaryReader representing the input stream</param> /// <returns>ExeFS header object, null on error</returns> public static ExeFSHeader Read(BinaryReader reader) { ExeFSHeader header = new ExeFSHeader(); try { header.FileHeaders = new ExeFSFileHeader[10]; for (int i = 0; i < 10; i++) { header.FileHeaders[i] = ExeFSFileHeader.Read(reader); } header.Reserved = reader.ReadBytes(0x20); for (int i = 0; i < 10; i++) { header.FileHeaders[9 - i].FileHash = reader.ReadBytes(0x20); } return(header); } catch { return(null); } }
/// <summary> /// Read from a stream and get an ExeFS file header, if possible /// </summary> /// <param name="reader">BinaryReader representing the input stream</param> /// <returns>ExeFS file header object, null on error</returns> public static ExeFSFileHeader Read(BinaryReader reader) { ExeFSFileHeader header = new ExeFSFileHeader(); try { header.FileName = reader.ReadBytes(8); header.FileOffset = reader.ReadUInt32(); header.FileSize = reader.ReadUInt32(); return(header); } catch { return(null); } }