summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAlexander Taylor <alex@vector35.com>2025-11-03 14:31:20 -0500
committerAlexander Taylor <alex@vector35.com>2025-11-03 14:34:48 -0500
commit0c55bf12f6148a8f3c4b1af66c950d73e371b351 (patch)
tree18b067b2d5f81a15e726fa7c4c43911f8d774476 /python
parent4bbf5434655da660322205b9db590c524bef4aa8 (diff)
Add helpers for whether a function is exported.
Diffstat (limited to 'python')
-rw-r--r--python/function.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/python/function.py b/python/function.py
index b56327e1..0996d87f 100644
--- a/python/function.py
+++ b/python/function.py
@@ -27,7 +27,7 @@ from dataclasses import dataclass
# Binary Ninja components
from . import _binaryninjacore as core
from .enums import (
- AnalysisSkipReason, FunctionGraphType, SymbolType, InstructionTextTokenType, HighlightStandardColor,
+ AnalysisSkipReason, FunctionGraphType, SymbolType, SymbolBinding, InstructionTextTokenType, HighlightStandardColor,
HighlightColorStyle, DisassemblyOption, IntegerDisplayType, FunctionAnalysisSkipOverride, FunctionUpdateType,
BuiltinType, ExprFolding, EarlyReturn, SwitchRecovery
)
@@ -600,6 +600,16 @@ class Function:
return types.CoreSymbol(sym)
@property
+ def is_exported(self) -> bool:
+ """
+ Whether the function is exported (read-only).
+
+ A function is considered exported when its symbol binding is global or weak.
+ """
+ binding = self.symbol.binding
+ return binding in (SymbolBinding.GlobalBinding, SymbolBinding.WeakBinding)
+
+ @property
def auto(self) -> bool:
"""
Whether function was automatically discovered (read-only) as a result of some creation of a 'user' function.