MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / readLEB128

Function readLEB128

view/sharedcache/core/Utility.cpp:40–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40uint64_t readLEB128(const uint8_t*& current, const uint8_t* end)
41{
42 uint64_t result = 0;
43 int bit = 0;
44 do
45 {
46 if (current >= end)
47 return -1;
48
49 uint64_t slice = *current & 0x7f;
50
51 if (bit > 63)
52 return -1;
53 result |= (slice << bit);
54 bit += 7;
55 } while (*current++ & 0x80);
56 return result;
57}
58
59
60uint64_t readValidULEB128(const uint8_t*& current, const uint8_t* end)

Callers 2

readValidULEB128Function · 0.70
ReadFunctionTableMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected