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

Function readLEB128

view/macho/machoview.cpp:165–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163
164
165static uint64_t readLEB128(DataBuffer& p, size_t end, size_t &offset)
166{
167 uint64_t result = 0;
168 int bit = 0;
169 do {
170 if (offset >= end)
171 return -1;
172
173 uint64_t slice = p[offset] & 0x7f;
174
175 if (bit > 63)
176 return -1;
177 else {
178 result |= (slice << bit);
179 bit += 7;
180 }
181 } while (p[offset++] & 0x80);
182 return result;
183}
184
185
186uint64_t readValidULEB128(DataBuffer& buffer, size_t& cursor)

Callers 4

readValidULEB128Function · 0.70
ParseFunctionStartsMethod · 0.70
ParseRebaseTableMethod · 0.70
ParseDynamicTableMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected