diff options
| author | kat <katherine@vector35.com> | 2022-09-22 09:25:01 -0400 |
|---|---|---|
| committer | kat <katherine@vector35.com> | 2022-09-22 09:25:01 -0400 |
| commit | e95b220ef18c9dd9e1aecab32b735ff47237f9c7 (patch) | |
| tree | e302ace94bc5c8707edbc037c1fea55cfabc73cd /binaryninjacore.h | |
| parent | 07be3689f173e7a55af5e795c10377e0afdd594f (diff) | |
Add the Components API
Diffstat (limited to 'binaryninjacore.h')
| -rw-r--r-- | binaryninjacore.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/binaryninjacore.h b/binaryninjacore.h index 212c8b62..12c1b277 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -220,6 +220,7 @@ extern "C" struct BNRepository; struct BNRepoPlugin; struct BNRepositoryManager; + struct BNComponent; struct BNSettings; struct BNMetadata; struct BNReportCollection; @@ -1379,6 +1380,12 @@ extern "C" void (*sectionAdded)(void* ctxt, BNBinaryView* view, BNSection* section); void (*sectionUpdated)(void* ctxt, BNBinaryView* view, BNSection* section); void (*sectionRemoved)(void* ctxt, BNBinaryView* view, BNSection* section); + void (*componentNameUpdated)(void* ctxt, BNBinaryView* view, char* previousName, BNComponent* component); + void (*componentAdded)(void*ctxt, BNBinaryView* view, BNComponent* component); + void (*componentMoved)(void*ctxt, BNBinaryView* view, BNComponent* formerParent, BNComponent* newParent, BNComponent* component); + void (*componentRemoved)(void*ctxt, BNBinaryView* view, BNComponent* formerParent, BNComponent* component); + void (*componentFunctionAdded)(void*ctxt, BNBinaryView* view, BNComponent* component, BNFunction* function); + void (*componentFunctionRemoved)(void*ctxt, BNBinaryView* view, BNComponent* component, BNFunction* function); }; struct BNFileAccessor @@ -3324,6 +3331,16 @@ extern "C" BINARYNINJACOREAPI BNSegment* BNGetSegmentAt(BNBinaryView* view, uint64_t addr); BINARYNINJACOREAPI bool BNGetAddressForDataOffset(BNBinaryView* view, uint64_t offset, uint64_t* addr); + BINARYNINJACOREAPI BNComponent* BNGetComponentByGuid(BNBinaryView* view, const char *guid); + BINARYNINJACOREAPI BNComponent* BNGetRootComponent(BNBinaryView* view); + BINARYNINJACOREAPI BNComponent* BNCreateComponent(BNBinaryView* view); + BINARYNINJACOREAPI BNComponent* BNCreateComponentWithParent(BNBinaryView* view, const char* parentGUID); + BINARYNINJACOREAPI BNComponent* BNCreateComponentWithName(BNBinaryView* view, const char *name); + BINARYNINJACOREAPI BNComponent* BNCreateComponentWithParentAndName(BNBinaryView* view, const char* parentGUID, const char *name); + BINARYNINJACOREAPI BNComponent* BNGetComponentByPath(BNBinaryView* view, const char* path); + BINARYNINJACOREAPI bool BNRemoveComponent(BNBinaryView* view, BNComponent* component); + BINARYNINJACOREAPI bool BNRemoveComponentByGuid(BNBinaryView* view, const char *guid); + BINARYNINJACOREAPI void BNAddAutoSection(BNBinaryView* view, const char* name, uint64_t start, uint64_t length, BNSectionSemantics semantics, const char* type, uint64_t align, uint64_t entrySize, const char* linkedSection, const char* infoSection, uint64_t infoData); @@ -3703,6 +3720,7 @@ extern "C" BINARYNINJACOREAPI uint64_t BNGetFunctionHighestAddress(BNFunction* func); BINARYNINJACOREAPI uint64_t BNGetFunctionLowestAddress(BNFunction* func); BINARYNINJACOREAPI BNAddressRange* BNGetFunctionAddressRanges(BNFunction* func, size_t* count); + BINARYNINJACOREAPI BNComponent** BNGetFunctionParentComponents(BNFunction *func, size_t* count); BINARYNINJACOREAPI BNLowLevelILFunction* BNGetFunctionLowLevelIL(BNFunction* func); BINARYNINJACOREAPI BNLowLevelILFunction* BNGetFunctionLowLevelILIfAvailable(BNFunction* func); @@ -5933,6 +5951,40 @@ extern "C" BINARYNINJACOREAPI BNRepository* BNRepositoryManagerGetDefaultRepository(BNRepositoryManager* r); + // Components + + BINARYNINJACOREAPI BNComponent* BNNewComponentReference(BNComponent *component); + BINARYNINJACOREAPI void BNFreeComponent(BNComponent *component); + + BINARYNINJACOREAPI BNFunction** BNComponentGetContainedFunctions(BNComponent *component, size_t *count); + BINARYNINJACOREAPI BNComponent** BNComponentGetContainedComponents(BNComponent *component, size_t *count); + + BINARYNINJACOREAPI BNDataVariable* BNComponentGetReferencedDataVariables(BNComponent *component, size_t *count); + BINARYNINJACOREAPI BNDataVariable* BNComponentGetReferencedDataVariablesRecursive(BNComponent *component, size_t *count); + BINARYNINJACOREAPI BNType** BNComponentGetReferencedTypes(BNComponent *component, size_t *count); + BINARYNINJACOREAPI BNType** BNComponentGetReferencedTypesRecursive(BNComponent *component, size_t *count); + + BINARYNINJACOREAPI void BNFreeComponents(BNComponent** components, size_t count); + BINARYNINJACOREAPI void BNComponentFreeReferencedTypes(BNType** types, size_t count); + + BINARYNINJACOREAPI BNComponent* BNComponentGetParent(BNComponent* component); + + BINARYNINJACOREAPI bool BNComponentContainsFunction(BNComponent* component, BNFunction *function); + BINARYNINJACOREAPI bool BNComponentContainsComponent(BNComponent *parent, BNComponent *component); + BINARYNINJACOREAPI bool BNComponentAddFunctionReference(BNComponent* component, BNFunction* function); + BINARYNINJACOREAPI bool BNComponentAddComponent(BNComponent* parent, BNComponent* component); + BINARYNINJACOREAPI bool BNComponentRemoveComponent(BNComponent* component); + BINARYNINJACOREAPI void BNComponentAddAllMembersFromComponent(BNComponent *component, BNComponent *fromComponent); + BINARYNINJACOREAPI bool BNComponentRemoveFunctionReference(BNComponent *component, BNFunction *function); + BINARYNINJACOREAPI void BNComponentRemoveAllFunctions(BNComponent *component); + BINARYNINJACOREAPI char *BNComponentGetGuid(BNComponent *component); + BINARYNINJACOREAPI bool BNComponentsEqual(BNComponent* a, BNComponent* b); + BINARYNINJACOREAPI bool BNComponentsNotEqual(BNComponent* a, BNComponent* b); + BINARYNINJACOREAPI char *BNComponentGetDisplayName(BNComponent* component); + BINARYNINJACOREAPI char *BNComponentGetOriginalName(BNComponent* component); + BINARYNINJACOREAPI void BNComponentSetName(BNComponent* component, const char* name); + BINARYNINJACOREAPI BNBinaryView* BNComponentGetView(BNComponent* component); + // LLVM Services APIs BINARYNINJACOREAPI void BNLlvmServicesInit(void); |
