Files
Il2CppInspectorRedux/Il2CppInspector.Common/ULEB128.cs

24 lines
517 B
C#

/*
Copyright 2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty
All rights reserved.
*/
using System.IO;
namespace Il2CppInspector
{
internal class ULEB128
{
public static ulong Decode(IFileFormatStream next) {
ulong uleb = 0;
byte b = 0x80;
for (var shift = 0; b >> 7 == 1; shift += 7) {
b = next.ReadByte();
uleb |= (ulong) (b & 0x7f) << shift;
}
return uleb;
}
}
}