public override void Read(BitsStream stream) { bool IsResourceFile = stream.ReadBool(); long Offset = (long)stream.ReadBits(23); int Size = (int)stream.ReadBits(24); NameOffset = (int)stream.ReadBits(16); ContentEntryIndex = stream.ReadInt(); ContentEntryCount = stream.ReadInt(); }
public override void Read(BitsStream stream) { try { IsResourceFile = stream.ReadBool(); Offset = (long)stream.ReadBits(23); SizeInArchive = (int)stream.ReadBits(24); NameOffset = (int)stream.ReadBits(16); Offset <<= 9; if (IsResourceFile) { if (Size == 0xFFFFFF) { throw new Exception("Resource with size -1, not supported"); } uint systemFlag = (uint)stream.ReadInt(); uint graphicsFlag = (uint)stream.ReadInt(); IsCompressed = false; IsEncrypted = false; Size = SizeInArchive; } else { Size = stream.ReadInt(); IsEncrypted = stream.ReadInt() == 1; IsCompressed = Size != 0 ? true : false; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
internal static bool ReadAsDirectory(BitsStream stream) { bool dir = stream.ReadInt() == 2147483392; stream.Seek(stream.Position - 4); return dir; }