``get_function_at`` gets a Function object for the function that starts at virtual address ``addr``: :param int addr: starting virtual address of the desired function :param Platform plat: platform of the desired function :return: returns a Function object or None for the function at the v
(self, addr: int, plat: Optional['_platform.Platform'] = None)
| 5135 | return fns |
| 5136 | |
| 5137 | def get_function_at(self, addr: int, plat: Optional['_platform.Platform'] = None) -> Optional['_function.Function']: |
| 5138 | """ |
| 5139 | ``get_function_at`` gets a Function object for the function that starts at virtual address ``addr``: |
| 5140 | |
| 5141 | :param int addr: starting virtual address of the desired function |
| 5142 | :param Platform plat: platform of the desired function |
| 5143 | :return: returns a Function object or None for the function at the virtual address provided |
| 5144 | :rtype: Function |
| 5145 | :Example: |
| 5146 | |
| 5147 | >>> bv.get_function_at(bv.entry_point) |
| 5148 | <func: x86_64@0x100001174> |
| 5149 | >>> |
| 5150 | """ |
| 5151 | if plat is None: |
| 5152 | funcs = self.get_functions_at(addr) |
| 5153 | if not funcs: |
| 5154 | return None |
| 5155 | result = [func for func in funcs if (func.platform == self.platform)] |
| 5156 | if not result: |
| 5157 | result = funcs |
| 5158 | return result[0] |
| 5159 | else: |
| 5160 | func = core.BNGetAnalysisFunction(self.handle, plat.handle, addr) |
| 5161 | if func is None: |
| 5162 | return None |
| 5163 | return _function.Function(self, func) |
| 5164 | |
| 5165 | def get_functions_at(self, addr: int) -> List['_function.Function']: |
| 5166 | """ |
no test coverage detected