diff options
| -rw-r--r-- | binaryninjaapi.h | 1 | ||||
| -rw-r--r-- | binaryninjacore.h | 3 | ||||
| -rw-r--r-- | function.cpp | 6 | ||||
| -rw-r--r-- | python/function.py | 8 | ||||
| -rw-r--r-- | rust/src/function.rs | 5 |
5 files changed, 22 insertions, 1 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 9e7e9eff..30cc6ad0 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -11299,6 +11299,7 @@ namespace BinaryNinja { Ref<Tag> CreateAutoFunctionTag(Ref<TagType> tagType, const std::string& data, bool unique = false); Ref<Tag> CreateUserFunctionTag(Ref<TagType> tagType, const std::string& data, bool unique = false); + void Analyze(); void Reanalyze(BNFunctionUpdateType type = UserFunctionUpdate); void MarkUpdatesRequired(BNFunctionUpdateType type = UserFunctionUpdate); void MarkCallerUpdatesRequired(BNFunctionUpdateType type = UserFunctionUpdate); diff --git a/binaryninjacore.h b/binaryninjacore.h index 2b4dc07d..4c941309 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -37,7 +37,7 @@ // Current ABI version for linking to the core. This is incremented any time // there are changes to the API that affect linking, including new functions, // new types, or modifications to existing functions or types. -#define BN_CURRENT_CORE_ABI_VERSION 103 +#define BN_CURRENT_CORE_ABI_VERSION 104 // Minimum ABI version that is supported for loading of plugins. Plugins that // are linked to an ABI version less than this will not be able to load and @@ -5252,6 +5252,7 @@ extern "C" BINARYNINJACOREAPI bool BNLookupImportedTypePlatform(BNBinaryView* view, const BNQualifiedName* typeName, BNPlatform** platform, BNQualifiedName* resultName); BINARYNINJACOREAPI void BNReanalyzeAllFunctions(BNBinaryView* view); + BINARYNINJACOREAPI void BNAnalyzeFunction(BNFunction* func); BINARYNINJACOREAPI void BNReanalyzeFunction(BNFunction* func, BNFunctionUpdateType type); BINARYNINJACOREAPI void BNMarkUpdatesRequired(BNFunction* func, BNFunctionUpdateType type); BINARYNINJACOREAPI void BNMarkCallerUpdatesRequired(BNFunction* func, BNFunctionUpdateType type); diff --git a/function.cpp b/function.cpp index 89420f8c..07f685a5 100644 --- a/function.cpp +++ b/function.cpp @@ -2488,6 +2488,12 @@ Confidence<RegisterValue> Function::GetRegisterValueAtExit(uint32_t reg) const } +void Function::Analyze() +{ + BNAnalyzeFunction(m_object); +} + + void Function::Reanalyze(BNFunctionUpdateType type) { BNReanalyzeFunction(m_object, type); diff --git a/python/function.py b/python/function.py index 6d20359a..be669002 100644 --- a/python/function.py +++ b/python/function.py @@ -2454,6 +2454,14 @@ class Function: type_id = core.BNGetIntegerConstantDisplayTypeEnumerationType(self.handle, arch.handle, instr_addr, value, operand) return display_type, type_id + def analyze(self) -> None: + """ + ``analyze`` causes this function to be analyzed if it's out of date. This function does not wait for the analysis to finish. + + :rtype: None + """ + core.BNAnalyzeFunction(self.handle) + def reanalyze(self, update_type: FunctionUpdateType = FunctionUpdateType.UserFunctionUpdate) -> None: """ ``reanalyze`` causes this function to be reanalyzed. This function does not wait for the analysis to finish. diff --git a/rust/src/function.rs b/rust/src/function.rs index 1f22512c..d8b5c199 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -2166,6 +2166,11 @@ impl Function { unsafe { BNUnsplitVariable(self.handle, &raw_var) } } + /// Causes this function to be analyzed if it's out of date. This function does not wait for the analysis to finish. + pub fn analyze(&self) { + unsafe { BNAnalyzeFunction(self.handle) } + } + /// Causes this function to be reanalyzed. This function does not wait for the analysis to finish. /// /// * `update_type` - Desired update type |
