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

Method updateCache

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

Source from the content-addressed store, hash-verified

344 return False
345
346 def updateCache(self):
347 # Cache enough for the current page and the next page
348 while (len(self.lines) - self.topLine) <= (self.visibleRows * 2):
349 if not self.cacheNextLines():
350 break
351 # Cache enough for the previous page
352 while self.topLine <= self.visibleRows:
353 if not self.cachePreviousLines():
354 break
355 # Trim cache
356 if self.topLine > (self.visibleRows * 4):
357 self.lines = self.lines[self.topLine - (self.visibleRows * 4):]
358 self.topLine = self.visibleRows * 4
359 self.topAddr = self.lines[0].address
360 if (len(self.lines) - self.topLine) > (self.visibleRows * 5):
361 self.bottomAddr = self.lines[self.topLine + (self.visibleRows * 5)].address
362 self.lines = self.lines[0:self.topLine + (self.visibleRows * 5)]
363
364 def scrollLines(self, count):
365 newOffset = self.topLine + count

Callers 5

refreshLinesMethod · 0.95
scrollLinesMethod · 0.95
showContextAroundTopMethod · 0.95
repositionCaretMethod · 0.95
scrollBarMovedMethod · 0.95

Calls 2

cacheNextLinesMethod · 0.95
cachePreviousLinesMethod · 0.95

Tested by

no test coverage detected