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

Method cacheNextLines

python/examples/triage/byte.py:319–344  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

317 return True
318
319 def cacheNextLines(self):
320 lastAddr = self.data.start
321 for i in self.ranges:
322 if (self.bottomAddr >= i.start) and (self.bottomAddr < i.end):
323 endLine = self.bottomAddr + self.cols
324 if endLine > i.end:
325 endLine = i.end
326 line = self.createLine(self.bottomAddr, endLine - self.bottomAddr, False)
327 self.lines.append(line)
328 self.bottomAddr = endLine
329 return True
330 elif i.start > self.bottomAddr:
331 line = self.createLine(self.bottomAddr, i.start - self.bottomAddr, True)
332 self.lines.append(line)
333 self.bottomAddr = i.start
334 return True
335 lastAddr = i.end
336 if self.bottomAddr == lastAddr:
337 # Ensure there is a place for the cursor at the end of the file
338 if (len(self.lines) > 0) and (self.lines[-1].length != self.cols):
339 return False
340 line = self.createLine(lastAddr, 0, False)
341 self.lines.append(line)
342 self.bottomAddr += 1
343 return True
344 return False
345
346 def updateCache(self):
347 # Cache enough for the current page and the next page

Callers 1

updateCacheMethod · 0.95

Calls 2

createLineMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected