diff options
| author | Peter LaFosse <peter@vector35.com> | 2024-10-21 10:55:45 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2024-10-23 20:37:38 -0400 |
| commit | 9aa54ef6723ad06b019c02c22b574516dca6289b (patch) | |
| tree | e0b420a8a609f4644607cad7f6170cf36ee26771 /highlevelilinstruction.h | |
| parent | c446e3acbcb0dc750a840551fa7cb54c184e7acb (diff) | |
Linear view function regions collapse
Update collapse code to support PseudoC
Diffstat (limited to 'highlevelilinstruction.h')
| -rw-r--r-- | highlevelilinstruction.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/highlevelilinstruction.h b/highlevelilinstruction.h index be6f8b43..25c639ec 100644 --- a/highlevelilinstruction.h +++ b/highlevelilinstruction.h @@ -388,6 +388,17 @@ namespace BinaryNinja bool HasParent() const; HighLevelILInstruction GetParent() const; + uint64_t GetInstructionHash(size_t discriminator = 0) const + { + constexpr auto rotl = [](uint64_t value, int shift) + { return (value << shift) | (value >> (64 - shift)); }; + std::hash<uint64_t> hasher; + uint64_t hash = hasher(operation); + hash ^= rotl(hasher(address), 23); + hash ^= rotl(hasher(discriminator), 47); + + return hash; + } template <BNHighLevelILOperation N> HighLevelILInstructionAccessor<N>& As() @@ -764,6 +775,7 @@ namespace BinaryNinja size_t GetSourceMemoryVersion() const; HighLevelILIndexList GetSourceMemoryVersions() const; size_t GetDestMemoryVersion() const; + static bool CanCollapse(int operand); }; /*! |
