public static string ReadEncodedString(BinaryReader BR, Encoding E) { List <byte> LineBytes = new List <byte>(); // It's NUL-terminated, BUT we need at least two bytes to determine the shift size - for example, a single space becomes "10 00". do { LineBytes.Add(BR.ReadByte()); } while (LineBytes.Count < 2 || (byte)LineBytes[LineBytes.Count - 1] != 0); FFXIEncryption.DecodeTextBlock(LineBytes); return(E.GetString(LineBytes.ToArray()).TrimEnd('\0')); }
public static bool DecodeTextBlock(IList <byte> Data) { return(FFXIEncryption.DecodeTextBlock(Data, 0, Data.Count)); }