2022-12-28 10:46:33 -08:00
|
|
|
using System.IO;
|
|
|
|
|
|
2023-03-07 16:59:14 -05:00
|
|
|
namespace BinaryObjectScanner.Models.Compression.LZ
|
2022-12-28 10:46:33 -08:00
|
|
|
{
|
|
|
|
|
public sealed class State
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2022-12-28 22:18:23 -08:00
|
|
|
/// Internal backing stream
|
2022-12-28 10:46:33 -08:00
|
|
|
/// </summary>
|
2022-12-28 22:18:23 -08:00
|
|
|
public Stream Source { get; set; }
|
2022-12-28 10:46:33 -08:00
|
|
|
|
|
|
|
|
/// <summary>
|
2022-12-28 22:18:23 -08:00
|
|
|
/// The last char of the filename for replacement
|
2022-12-28 10:46:33 -08:00
|
|
|
/// </summary>
|
|
|
|
|
public char LastChar { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-12-28 22:18:23 -08:00
|
|
|
/// Decompressed length of the file
|
2022-12-28 10:46:33 -08:00
|
|
|
/// </summary>
|
|
|
|
|
public uint RealLength { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-12-28 22:18:23 -08:00
|
|
|
/// Position the decompressor currently is
|
2022-12-28 10:46:33 -08:00
|
|
|
/// </summary>
|
|
|
|
|
public uint RealCurrent { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-12-28 22:18:23 -08:00
|
|
|
/// Position the user wants to read from
|
2022-12-28 10:46:33 -08:00
|
|
|
/// </summary>
|
|
|
|
|
public uint RealWanted { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The rotating LZ table
|
|
|
|
|
/// </summary>
|
|
|
|
|
public byte[] Table { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// CURrent TABle ENTry
|
|
|
|
|
/// </summary>
|
2022-12-28 22:18:23 -08:00
|
|
|
public uint CurrentTableEntry { get; set; }
|
2022-12-28 10:46:33 -08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Length and position of current string
|
|
|
|
|
/// </summary>
|
2022-12-28 22:18:23 -08:00
|
|
|
public byte StringLength { get; set; }
|
2022-12-28 10:46:33 -08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// From stringtable
|
|
|
|
|
/// </summary>
|
2022-12-28 22:18:23 -08:00
|
|
|
public uint StringPosition { get; set; }
|
2022-12-28 10:46:33 -08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Bitmask within blocks
|
|
|
|
|
/// </summary>
|
|
|
|
|
public ushort ByteType { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// GETLEN bytes
|
|
|
|
|
/// </summary>
|
2022-12-28 22:18:23 -08:00
|
|
|
public byte[] Window { get; set; }
|
2022-12-28 10:46:33 -08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Current read
|
|
|
|
|
/// </summary>
|
2022-12-28 22:18:23 -08:00
|
|
|
public uint WindowCurrent { get; set; }
|
2022-12-28 10:46:33 -08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Length last got
|
|
|
|
|
/// </summary>
|
2022-12-28 22:18:23 -08:00
|
|
|
public uint WindowLength { get; set; }
|
2022-12-28 10:46:33 -08:00
|
|
|
}
|
|
|
|
|
}
|