summaryrefslogtreecommitdiff
path: root/highlevelil.cpp
diff options
context:
space:
mode:
authorDan Killinger <git@dank.anonaddy.com>2023-08-04 21:21:41 -0700
committerXusheng <xusheng@vector35.com>2023-08-10 11:57:16 +0800
commitb6ce48c4f5be4cd43482e1ff762e088fd11b7227 (patch)
treeeb417d7d1f9eefccc409c8335edc973d83886d6d /highlevelil.cpp
parent9772037768221179318765893565951370277480 (diff)
Add API to get all SSA versions of a variable for MLIL and HLIL
Diffstat (limited to 'highlevelil.cpp')
-rw-r--r--highlevelil.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/highlevelil.cpp b/highlevelil.cpp
index 449dcfb9..7ac30f98 100644
--- a/highlevelil.cpp
+++ b/highlevelil.cpp
@@ -341,6 +341,20 @@ bool HighLevelILFunction::IsVarLiveAt(const Variable& var, const size_t instr) c
}
+set<size_t> HighLevelILFunction::GetVariableSSAVersions(const Variable& var) const
+{
+ size_t count;
+ size_t* versions = BNGetHighLevelILVariableSSAVersions(m_object, &var, &count);
+
+ set<size_t> result;
+ for (size_t i = 0; i < count; i++)
+ result.insert(versions[i]);
+
+ BNFreeILInstructionList(versions);
+ return result;
+}
+
+
set<size_t> HighLevelILFunction::GetVariableDefinitions(const Variable& var) const
{
size_t count;