diff options
| author | Josh Watson <josh@trailofbits.com> | 2019-03-12 15:08:31 -0700 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2019-03-23 13:07:52 -0400 |
| commit | 469f7eba4afe3086e98486b6e5f2bebbf61de525 (patch) | |
| tree | ea0dec12f037f4fb0a9d9ed3a99ebd740c5c8c19 /python/lowlevelil.py | |
| parent | 334c0e966eeb67cc88975cc51c3b7e17f7d1b1ee (diff) | |
Add __hash__ to IL Function objects
They didn't have a __hash__ method so I added one so I can use them in sets. It's really just the hash of the Function object plus a string to indicate it's MLIL or LLIL
Diffstat (limited to 'python/lowlevelil.py')
| -rw-r--r-- | python/lowlevelil.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 430e5934..9f23f45b 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -752,6 +752,9 @@ class LowLevelILFunction(object): func_handle = self.source_function.handle self.handle = core.BNCreateLowLevelILFunction(arch.handle, func_handle) + def __hash__(self): + return hash('LLIL') + hash(self.source_function) + def __del__(self): if self.handle is not None: core.BNFreeLowLevelILFunction(self.handle) |
