From 2cd19b867772f15d87eaee9560b94a9fd9ba13e4 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Wed, 2 Jul 2025 18:53:31 -0400 Subject: Add API to get all type field references at the same time to avoid duplicating work --- binaryninjaapi.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index edac64b8..66f40fac 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -4546,6 +4546,14 @@ namespace BinaryNinja { BNRegisterValue ToAPIObject(); }; + struct AllTypeFieldReferences + { + std::vector codeRefs; + std::vector dataRefsTo; + std::vector dataRefsFrom; + std::vector typeRefs; + }; + struct QualifiedNameAndType; struct PossibleValueSet; class Metadata; @@ -5638,13 +5646,21 @@ namespace BinaryNinja { */ std::vector GetTypeReferencesForTypeField(const QualifiedName& type, uint64_t offset); + /*! Returns a all references to a specific type field. This includes code, data, and type references. + + \param type QualifiedName of the type + \param offset Offset of the field, relative to the start of the type + \return AllTypeFieldReferences structure with all references + */ + AllTypeFieldReferences GetAllReferencesForTypeField(const QualifiedName& type, uint64_t offset); + /*! Returns a list of types referenced by code at ReferenceSource \c src - If no function is specified, references from all functions and containing the address will be returned. - If no architecture is specified, the architecture of the function will be used. + If no function is specified, references from all functions and containing the address will be returned. + If no architecture is specified, the architecture of the function will be used. - \param src Source of the reference to check - \return vector of TypeReferenceSources + \param src Source of the reference to check + \return vector of TypeReferenceSources */ std::vector GetCodeReferencesForTypeFrom(ReferenceSource src); -- cgit v1.3.1