diff options
| author | Peter LaFosse <peter@vector35.com> | 2022-01-06 13:01:42 -0500 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2022-01-06 15:01:25 -0500 |
| commit | d9661f34eec6855d495a10eaafc2a8e2679756a7 (patch) | |
| tree | 37234942e54f13c779c11370512b0eb6e1427e56 | |
| parent | 48f9130ad0085015187f45fde64611bb3c342f38 (diff) | |
Add Function::HasUserAnnotations
| -rw-r--r-- | binaryninjaapi.h | 1 | ||||
| -rw-r--r-- | binaryninjacore.h | 1 | ||||
| -rw-r--r-- | function.cpp | 6 | ||||
| -rw-r--r-- | python/function.py | 7 |
4 files changed, 15 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index d7832d7f..828da41b 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -3440,6 +3440,7 @@ __attribute__ ((format (printf, 1, 2))) uint64_t GetStart() const; Ref<Symbol> GetSymbol() const; bool WasAutomaticallyDiscovered() const; + bool HasUserAnnotations() const; Confidence<bool> CanReturn() const; bool HasExplicitlyDefinedType() const; bool NeedsUpdate() const; diff --git a/binaryninjacore.h b/binaryninjacore.h index 963cdb24..4b379263 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -3418,6 +3418,7 @@ __attribute__ ((format (printf, 1, 2))) BINARYNINJACOREAPI uint64_t BNGetFunctionStart(BNFunction* func); BINARYNINJACOREAPI BNSymbol* BNGetFunctionSymbol(BNFunction* func); BINARYNINJACOREAPI bool BNWasFunctionAutomaticallyDiscovered(BNFunction* func); + BINARYNINJACOREAPI bool BNFunctionHasUserAnnotations(BNFunction* func); BINARYNINJACOREAPI BNBoolWithConfidence BNCanFunctionReturn(BNFunction* func); BINARYNINJACOREAPI void BNSetFunctionAutoType(BNFunction* func, BNType* type); BINARYNINJACOREAPI void BNSetFunctionUserType(BNFunction* func, BNType* type); diff --git a/function.cpp b/function.cpp index 069a021d..0f70e939 100644 --- a/function.cpp +++ b/function.cpp @@ -172,6 +172,12 @@ bool Function::WasAutomaticallyDiscovered() const } +bool Function::HasUserAnnotations() const +{ + return BNFunctionHasUserAnnotations(m_object); +} + + Confidence<bool> Function::CanReturn() const { BNBoolWithConfidence bc = BNCanFunctionReturn(m_object); diff --git a/python/function.py b/python/function.py index 332b5769..d3b9ea88 100644 --- a/python/function.py +++ b/python/function.py @@ -497,6 +497,13 @@ class Function: return core.BNWasFunctionAutomaticallyDiscovered(self.handle) @property + def has_user_annotations(self) -> bool: + """ + Whether the function has ever been 'user' modified + """ + return core.BNFunctionHasUserAnnotations(self.handle) + + @property def can_return(self) -> 'types.BoolWithConfidence': """Whether function can return""" result = core.BNCanFunctionReturn(self.handle) |
