diff --git a/idaplugin/rematch/collectors/flat_graph.py b/idaplugin/rematch/collectors/vectors/flat_graph.py similarity index 86% rename from idaplugin/rematch/collectors/flat_graph.py rename to idaplugin/rematch/collectors/vectors/flat_graph.py index 72579230d..b3a994250 100644 --- a/idaplugin/rematch/collectors/flat_graph.py +++ b/idaplugin/rematch/collectors/vectors/flat_graph.py @@ -9,9 +9,9 @@ class FlatGraphVector(Vector): def __init__(self, *args, **kwargs): super(FlatGraphVector, self).__init__(*args, **kwargs) - self.flow_chart = idaapi.FlowChart(idaapi.get_func(self.offset)) + self.flow_chart = None self.visited = set() - self.items = list[self.flow_chart.size] + self.items = list() def _bb_size(self, bb): if bb.endEA > bb.startEA: @@ -22,7 +22,7 @@ def _bb_size(self, bb): def _bb_value(self, bb): # TODO: this should be something that's uncorellated with the order of - # basic blocks + # basic blocks and describes basic blocks well return self._bb_size(bb) def _append_bbs(self, *bbs): @@ -54,7 +54,9 @@ def _recurse_bb(self, bb): for sibling in siblings: self._recurse_siblings(sibling) - def _data(self): + def data(self, offset): + self.flow_chart = idaapi.FlowChart(idaapi.get_func(offset)) + self.items.append(self.flow_chart.size) head = self._find_head() self._recurse_bb(head) return self.items