24 lines
522 B
C#
24 lines
522 B
C#
/*
|
|
Copyright 2020-2021 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;
|
|
}
|
|
}
|
|
}
|