MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / get_functions_at

Method get_functions_at

python/binaryview.py:5165–5189  ·  view source on GitHub ↗

``get_functions_at`` get a list of :py:class:`~binaryninja.function.Function` objects (one for each valid platform) that start at the given virtual address. Binary Ninja does not limit the number of platforms in a given file thus there may be multiple functions defined from different archite

(self, addr: int)

Source from the content-addressed store, hash-verified

5163 return _function.Function(self, func)
5164
5165 def get_functions_at(self, addr: int) -> List['_function.Function']:
5166 """
5167
5168 ``get_functions_at`` get a list of :py:class:`~binaryninja.function.Function` objects (one for each valid platform) that start at the
5169 given virtual address. Binary Ninja does not limit the number of platforms in a given file thus there may be
5170 multiple functions defined from different architectures at the same location. This API allows you to query all
5171 of valid platforms.
5172
5173 You may also be interested in :py:func:`get_functions_containing` which is useful for requesting all function
5174 that contain a given address
5175
5176 :param int addr: virtual address of the desired Function object list.
5177 :return: a list of :py:class:`~binaryninja.function.Function` objects defined at the provided virtual address
5178 :rtype: list(Function)
5179 """
5180 count = ctypes.c_ulonglong(0)
5181 funcs = core.BNGetAnalysisFunctionsForAddress(self.handle, addr, count)
5182 assert funcs is not None, "core.BNGetAnalysisFunctionsForAddress returned None"
5183 result = []
5184 try:
5185 for i in range(0, count.value):
5186 result.append(_function.Function(self, core.BNNewFunctionReference(funcs[i])))
5187 return result
5188 finally:
5189 core.BNFreeFunctionList(funcs, count.value)
5190
5191 def get_recent_function_at(self, addr: int) -> Optional['_function.Function']:
5192 func = core.BNGetRecentAnalysisFunctionForAddress(self.handle, addr)

Callers 4

get_functions_by_nameMethod · 0.95
get_function_atMethod · 0.95
exportDoubleClickedMethod · 0.80

Calls 2

FunctionMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected