Beispiel #1
0
 public WzBinaryWriter(Stream output, byte[] wzIv, bool leaveOpen = false)
     : base(output)
 {
     WzKey       = WzTool.GenerateWzKey(wzIv);
     StringCache = new Hashtable();
     LeaveOpen   = leaveOpen;
 }
Beispiel #2
0
        public void WriteOffset(uint value)
        {
            var encOffset = (uint)BaseStream.Position;

            encOffset  = (encOffset - Header.FStart) ^ 0xFFFFFFFF;
            encOffset *= Hash;
            encOffset -= CryptoConstants.WzOffsetConstant;
            encOffset  = WzTool.RotateLeft(encOffset, (byte)(encOffset & 0x1F));
            var writeOffset = encOffset ^ (value - Header.FStart * 2);

            Write(writeOffset);
        }