diff options
| -rw-r--r-- | binaryninjaapi.h | 8 | ||||
| -rw-r--r-- | binaryview.cpp | 17 |
2 files changed, 25 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 05a5e1df..59b41e63 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -3959,6 +3959,14 @@ namespace BinaryNinja { */ std::vector<Ref<Symbol>> GetSymbolsByName(const std::string& name, const NameSpace& nameSpace = NameSpace()); + /*! Retrieves the list of all Symbol objects with a given raw name + + \param name RawName to search for + \param nameSpace The optional namespace of the symbols to retrieve + \return A list of symbols + */ + std::vector<Ref<Symbol>> GetSymbolsByRawName(const std::string& name, const NameSpace& nameSpace = NameSpace()); + /*! Retrieves the list of all Symbol objects \param nameSpace The optional namespace of the symbols to retrieve diff --git a/binaryview.cpp b/binaryview.cpp index 7232e647..ef8889ca 100644 --- a/binaryview.cpp +++ b/binaryview.cpp @@ -2448,6 +2448,23 @@ vector<Ref<Symbol>> BinaryView::GetSymbolsByName(const string& name, const NameS } +vector<Ref<Symbol>> BinaryView::GetSymbolsByRawName(const string& name, const NameSpace& nameSpace) +{ + size_t count; + BNNameSpace ns = nameSpace.GetAPIObject(); + BNSymbol** syms = BNGetSymbolsByRawName(m_object, name.c_str(), &count, &ns); + NameSpace::FreeAPIObject(&ns); + + vector<Ref<Symbol>> result; + result.reserve(count); + for (size_t i = 0; i < count; i++) + result.push_back(new Symbol(BNNewSymbolReference(syms[i]))); + + BNFreeSymbolList(syms, count); + return result; +} + + vector<Ref<Symbol>> BinaryView::GetSymbols(const NameSpace& nameSpace) { size_t count; |
