summaryrefslogtreecommitdiff
path: root/python/function.py
AgeCommit message (Collapse)Author
2026-04-17Add RecognizeConstantData to StringRecognizer APIBrian Potchik
Adds a new recognize_constant_data method to the StringRecognizer API, enabling plugins to decode constant data expressions (HLIL_CONST_DATA) recovered by the outline resolver. The recognizer receives the full instruction, giving access to the data buffer and builtin type via the constant_data accessor. Also fixes a pre-existing ctypes mismatch in get_constant_data_and_builtin where BNBuiltinType (uint8_t) was incorrectly passed as c_int.
2026-04-15[Python API] Replace bare "except:" with "except Exception:" to fix signal ↵Josh Ferrell
propagation
2026-02-16Fix TypeError when slicing FunctionList/BasicBlockList with [:], [n:], [:n]3rdit
2026-02-16Fix slice handling in TagList to match FunctionList/BasicBlockList fix3rdit
2026-01-28Fix a fundamental problem with TypeBuilder.handle by deleting itPeter LaFosse
TypeBuilder.handle creates an immutable_type gets the handle and then deletes the object to which the handle belonged to. This was fundamentally a UAF. immutable_copy is an error prone api as its very easy to misuse. We should consider a re-architecture of this API. `TypeBuilder.immutable_copy().<anything>` or `Type.mutable_copy().<anything>` should be considered sketchy and immutable_copy().handle is just a straight up UAF. Prior to this commit the following would cause a crash: current_data_variable.type = PointerBuilder.create(FunctionType.create())
2026-01-16fix pydoc formatting for recent metadata API changesJordan Wiens
2026-01-16Add get_metadata() method and make query_metadata() raise KeyError consistentlyPeter LaFosse
Introduces a Pythonic get_metadata() method to BinaryView, Function, Project, TypeArchive, and TypeLibrary classes. This method behaves like dict.get(), returning a default value (None by default) when a key doesn't exist, instead of raising a KeyError. Additionally, updates query_metadata() in TypeArchive and TypeLibrary to raise KeyError when a key is not found, making them consistent with BinaryView, Function, and Project. Previously these two classes returned None on missing keys. This breaking change is documented in the method docstrings. This provides a more consistent and Pythonic API for querying metadata across all metadata-supporting classes. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14Allow controlling which address is used for instructions created when ↵Mark Rowe
inlining during analysis Previously the address of the instruction in the function being inlined was used as the new instruction's address when copying it during inlining. Now there is an additional option: use the address of the call instruction that is being replaced as the new instruction's address. This new mode is useful when inlining thunks or stub functions, but care must be taken if using it beyond that. The benefit is that it ensures that when a function contains multiple calls to the same stub function, each inlined copy ends up with distinct addresses. This ensures that call type adjustments and other overrides that are stored on the function and keyed by address can be applied independently to each callsite that was inlined. The trade-off is that if the function being inlined contains non-trivial logic, all of the inlined instructions sharing an address will limit what type of adjustments can be applied to them. The Objective-C and shared cache workflows are updated to take advantage of this new mode when they enable inlining of stub functions. This will make it possible for multiple calls to the same runtime function within a single function to have separate call type adjustments applied in the future.
2026-01-01update copyrights for 2026Jordan Wiens
2025-11-19Fix some python API error messagesJosh Ferrell
2025-11-19Fix DisassemblyTextLine reprJosh Ferrell
2025-11-03Add helpers for whether a function is exported.Alexander Taylor
2025-10-23Fix imported functions being ignored when building call sites, and fix ↵Mason Reed
python callers listing referenced calls Fixes https://github.com/Vector35/binaryninja-api/issues/7308
2025-07-17Initial documentation for guided analysis feature. (skip-ci)Brian Potchik
2025-07-15Finish guided analysis feature and add unit tests.Brian Potchik
2025-07-15Move LLIL instruction retrieval into the LLIL function where it belongsMason Reed
The python API was kept the same seeing as we are close to the release, will likely start deprecating some of those API's soon.
2025-07-09reimplement llil validation for caller_sites and implement plural IL forms ↵Jordan Wiens
on references
2025-07-08Various improvements for guided disassembly mode.Brian Potchik
2025-07-03api: indirect branch inlining supportRyan Snyder
2025-07-01Python bindings for custom basic block analysisBrandon Miller
2025-06-25Initial support for guided disassembly.Brian Potchik
2025-06-23Perform BB analysis from Architecture C++ APIBrandon Miller
This commit moves AnalyzeBasicBlocks from the binary ninja core to the API and allows architecture plugins to optionally override AnalyzeBasicBlocks for a custom implementation Supply ABB inputs in BNBasicBlockAnalysisContext Register default analyze basic blocks callback This allows the nanomips and rust core architecture plugins to work again while using the C++ API DefaultAnalyzeBasicBlocks Use default ABB from Python plugins Fix bug in API ArchAndAddr operator overload Python APIs for basic block analysis
2025-06-16Don't yield None in BinaryView hlil|mlil_functionsBrandon Miller
2025-06-11API to create immediate function graphsGlenn Smith
2025-06-11Expose Function::CheckForDebugReportGlenn Smith
2025-06-10Add UI action and API to control switch recovery in HLILRusty Wagner
2025-06-09More None checks when querying IL internal to APIBrandon Miller
2025-06-09Update type hints/docs for Python IL API changesBrandon Miller
2025-06-03Add UI action and API to control early returns in HLILRusty Wagner
2025-06-03Add UI action and API to flip conditions during HLIL restructuringRusty Wagner
2025-05-23Add UI action and API to control expression foldingRusty Wagner
2025-05-20Fix the build.Alexander Taylor
Previous commit causes failures in API documentation generation. This builds and passes unit tests locally, hoping that will also be the case for CI.
2025-05-20add missing importJordan Wiens
2025-05-20relax caller_sites filterJordan Wiens
2025-05-20add better verification for caller_sites to ensure calls, fixes #3722Jordan Wiens
2025-05-19Implement function level metadataBrandon Miller
2025-05-16[Python] Support HLIL collapsing and update PseudoPythonGlenn Smith
Fixes Vector35/binaryninja-api#6679
2025-05-07Correct typos in Function.add_tag docs. Fixes #6796Malware Utkonos
2025-04-23Add Function::Analyze API to perform on-demand function analysis.Brian Potchik
2025-04-07Return None instead of raising in func IL gettersBrandon Miller
Return None instead of raising an ILException in Python Function.llil, mlil, etc to allow these properties to play nice with map and filter
2025-04-07fix broken link in get_llils_at docsJordan Wiens
2025-04-06fix get_llils?_at documentationJordan Wiens
2025-03-28missed the older dates!Jordan Wiens
2025-03-14Return None on ILException in get_low_level_il_atBrandon Miller
2025-02-14uidf refactorRyan Snyder
2025-02-06Add After variants for looking up variables at instructionsGlenn Smith
Fixes #6397
2025-01-30Render LayersGlenn Smith
2025-01-24Add line formatter API and a generic line formatter pluginRusty Wagner
2025-01-20Revert "Add line formatter API and a generic line formatter plugin"Rusty Wagner
This reverts commit 1699c71999d29d32aba5c9f8fea193a661a4b02b.
2025-01-17Add line formatter API and a generic line formatter pluginRusty Wagner