From 2cb81a1d1d4384dcb129ca0c05f15d56cfff3408 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Fri, 16 Aug 2019 20:28:04 -0400 Subject: add hash method for RegisterValue, MediumLevelILOperationAndSize, and MediumLevelILInstruction --- python/mediumlevelil.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'python/mediumlevelil.py') diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index dca7b0c8..a90fb0aa 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -99,6 +99,9 @@ class MediumLevelILOperationAndSize(object): else: return False + def __hash__(self): + return hash((self._size, self._operation)) + @property def operation(self): """ """ @@ -356,6 +359,9 @@ class MediumLevelILInstruction(object): def __repr__(self): return "" % str(self) + def __hash__(self): + return hash((self._instr_index, self._function)) + def __eq__(self, value): if not isinstance(value, type(self)): return False @@ -1141,7 +1147,6 @@ class MediumLevelILFunction(object): self._source_function = value - class MediumLevelILBasicBlock(basicblock.BasicBlock): def __init__(self, view, handle, owner): super(MediumLevelILBasicBlock, self).__init__(handle, view) -- cgit v1.3.1