diff options
| author | Jon Palmisciano <jp@jonpalmisc.com> | 2021-06-03 10:54:44 -0400 |
|---|---|---|
| committer | Jon Palmisciano <jp@jonpalmisc.com> | 2021-06-12 12:57:09 -0400 |
| commit | ea830c8f7b42cc7aebf5f714699011b3e5fae850 (patch) | |
| tree | 0f3a39ef987cd3bb2a50e9661cec6995d706d69b | |
| parent | c36c2f555fae8b5a707193e8d5a0d0a0697e9451 (diff) | |
Function: Added `GetILVariables()` method
| -rw-r--r-- | binaryninjaapi.h | 1 | ||||
| -rw-r--r-- | function.cpp | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index efc7e1a6..76df58ce 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -3225,6 +3225,7 @@ __attribute__ ((format (printf, 1, 2))) bool GetStackVariableAtFrameOffset(Architecture* arch, uint64_t addr, int64_t offset, VariableNameAndType& var); std::map<Variable, VariableNameAndType> GetVariables(); + std::set<Variable> GetILVariables(BNFunctionGraphType ilType); void CreateAutoVariable(const Variable& var, const Confidence<Ref<Type>>& type, const std::string& name, bool ignoreDisjointUses = false); void CreateUserVariable(const Variable& var, const Confidence<Ref<Type>>& type, const std::string& name, diff --git a/function.cpp b/function.cpp index 2c1b34ea..58968938 100644 --- a/function.cpp +++ b/function.cpp @@ -1107,6 +1107,23 @@ map<Variable, VariableNameAndType> Function::GetVariables() } +set<Variable> Function::GetILVariables(BNFunctionGraphType ilType) +{ + size_t count; + auto* vars = BNGetFunctionILVariables(m_object, ilType, &count); + + set<Variable> result; + for (size_t i = 0; i < count; i++) + { + Variable v(vars[i]); + result.insert(v); + } + + BNFreeVariableList(vars); + return result; +} + + void Function::CreateAutoVariable(const Variable& var, const Confidence<Ref<Type>>& type, const string& name, bool ignoreDisjointUses) { |
