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

Method __init__

python/examples/triage/entropy.py:34–56  ·  view source on GitHub ↗
(self, parent, view, data)

Source from the content-addressed store, hash-verified

32
33class EntropyWidget(QWidget):
34 def __init__(self, parent, view, data):
35 super(EntropyWidget, self).__init__(parent)
36 self.view = view
37 self.data = data
38 self.raw_data = data.file.raw
39
40 self.block_size = (self.raw_data.length / 4096) + 1
41 if self.block_size < 1024:
42 self.block_size = 1024
43 self.width = int(self.raw_data.length / self.block_size)
44 self.image = QImage(self.width, 1, QImage.Format_ARGB32)
45 self.image.fill(QColor(0, 0, 0, 0))
46
47 self.thread = EntropyThread(self.raw_data, self.image, self.block_size)
48 self.started = False
49
50 self.timer = QTimer()
51 self.timer.timeout.connect(self.timerEvent)
52 self.timer.setInterval(100)
53 self.timer.setSingleShot(False)
54 self.timer.start()
55
56 self.setMinimumHeight(UIContext.getScaledWindowSize(32, 32).height())
57
58 def paintEvent(self, event):
59 p = QPainter(self)

Callers

nothing calls this directly

Calls 5

EntropyThreadClass · 0.70
__init__Method · 0.45
connectMethod · 0.45
startMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected