本文整理汇总了C#中IBinaryReader.Read7BitEncodedInt32方法的典型用法代码示例。如果您正苦于以下问题:C# IBinaryReader.Read7BitEncodedInt32方法的具体用法?C# IBinaryReader.Read7BitEncodedInt32怎么用?C# IBinaryReader.Read7BitEncodedInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IBinaryReader
的用法示例。
在下文中一共展示了IBinaryReader.Read7BitEncodedInt32方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public static DecrypterV106 Create(IBinaryReader reader) {
try {
int keyXorOffs7 = (ReadByteAt(reader, 0) ^ ReadByteAt(reader, 2)) + 2;
reader.Position = keyXorOffs7 + (ReadByteAt(reader, 1) ^ ReadByteAt(reader, keyXorOffs7));
int sha1DataLen = reader.Read7BitEncodedInt32() + 0x80;
int keyXorOffs6 = (int)reader.Position;
int encryptedOffs = (int)reader.Position + sha1DataLen;
var sha1Data = reader.ReadBytes(sha1DataLen);
uint crc32 = CRC32.CheckSum(sha1Data);
reader.Position = reader.Length - 0x18;
uint origCrc32 = reader.ReadUInt32();
if (crc32 != origCrc32)
return null;
var key0 = DeobUtils.Sha1Sum(sha1Data); // 1.0.6.0
var key6 = GetKey(reader, key0, keyXorOffs6); // 1.0.6.6
var key7 = GetKey(reader, key0, keyXorOffs7); // 1.0.6.7
return new DecrypterV106(key0, key6, key7, encryptedOffs);
}
catch (IOException) {
return null;
}
}
示例2: DecryptCompressedInt32Data
public static byte[] DecryptCompressedInt32Data(Arg64ConstantsReader constReader, int exprStart, int exprEnd, IBinaryReader reader, byte[] decrypted) {
for (int i = 0; i < decrypted.Length; i++) {
constReader.Arg = reader.Read7BitEncodedInt32();
int index = exprStart;
long result;
if (!constReader.GetInt64(ref index, out result) || index != exprEnd)
throw new ApplicationException("Could not decrypt integer");
decrypted[i] = (byte)result;
}
return decrypted;
}