summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2019-04-23 18:25:44 -0400
committerJordan Wiens <jordan@psifertex.com>2019-04-23 18:25:44 -0400
commit74a30873db76348e57cef1e0b0fe48cb00924a68 (patch)
tree67ca2dd764d80f52bbb0f3d271b3a6fb88b064c6 /python
parent39e3614c7136029acb6b18cd71e12ef2feaeaac7 (diff)
add eq for LLIL and MLIL instructions
Diffstat (limited to 'python')
-rw-r--r--python/lowlevelil.py3
-rw-r--r--python/mediumlevelil.py3
2 files changed, 6 insertions, 0 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py
index 2609f761..90ecbd74 100644
--- a/python/lowlevelil.py
+++ b/python/lowlevelil.py
@@ -511,6 +511,9 @@ class LowLevelILInstruction(object):
def __repr__(self):
return "<il: %s>" % str(self)
+ def __eq__(self, value):
+ return self.function == value.function and self.expr_index == value.expr_index
+
@property
def tokens(self):
"""LLIL tokens (read-only)"""
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index d997fa76..e8d58f96 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -317,6 +317,9 @@ class MediumLevelILInstruction(object):
def __repr__(self):
return "<il: %s>" % str(self)
+ def __eq__(self, value):
+ return self.function == value.function and self.expr_index == value.expr_index
+
@property
def tokens(self):
"""MLIL tokens (read-only)"""