@@ -2685,6 +2685,41 @@ vector<TypeReferenceSource> BinaryView::GetTypeReferencesForTypeField(const Qual
26852685}
26862686
26872687
2688+ AllTypeReferences BinaryView::GetAllReferencesForType (const QualifiedName& type)
2689+ {
2690+ BNQualifiedName nameObj = type.GetAPIObject ();
2691+ BNAllTypeReferences refs = BNGetAllReferencesForType (m_object, &nameObj);
2692+ QualifiedName::FreeAPIObject (&nameObj);
2693+
2694+ AllTypeReferences result;
2695+
2696+ result.codeRefs .reserve (refs.codeRefCount );
2697+ for (size_t i = 0 ; i < refs.codeRefCount ; i++)
2698+ {
2699+ ReferenceSource src;
2700+ src.func = new Function (BNNewFunctionReference (refs.codeRefs [i].func ));
2701+ src.arch = new CoreArchitecture (refs.codeRefs [i].arch );
2702+ src.addr = refs.codeRefs [i].addr ;
2703+ result.codeRefs .push_back (src);
2704+ }
2705+
2706+ result.dataRefs = vector<uint64_t >(refs.dataRefs , &refs.dataRefs [refs.dataRefCount ]);
2707+
2708+ result.typeRefs .reserve (refs.typeRefCount );
2709+ for (size_t i = 0 ; i < refs.typeRefCount ; i++)
2710+ {
2711+ TypeReferenceSource src;
2712+ src.name = QualifiedName::FromAPIObject (&refs.typeRefs [i].name );
2713+ src.offset = refs.typeRefs [i].offset ;
2714+ src.type = refs.typeRefs [i].type ;
2715+ result.typeRefs .push_back (src);
2716+ }
2717+
2718+ BNFreeAllTypeReferences (&refs);
2719+ return result;
2720+ }
2721+
2722+
26882723AllTypeFieldReferences BinaryView::GetAllReferencesForTypeField (const QualifiedName& type, uint64_t offset)
26892724{
26902725 BNQualifiedName nameObj = type.GetAPIObject ();
0 commit comments