From 0c55bf12f6148a8f3c4b1af66c950d73e371b351 Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Mon, 3 Nov 2025 14:31:20 -0500 Subject: Add helpers for whether a function is exported. --- python/function.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'python/function.py') 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 ) @@ -599,6 +599,16 @@ class Function: assert sym is not None, "core.BNGetFunctionSymbol returned None" 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: """ -- cgit v1.3.1