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

Function readLEB128

view/kernelcache/core/KernelCache.cpp:169–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

readValidULEB128Function · 0.70
InitializeHeaderMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected