diff options
| author | Galen Williamson <galen@vector35.com> | 2022-08-19 14:18:02 -0400 |
|---|---|---|
| committer | Galen Williamson <galen@vector35.com> | 2022-08-19 14:18:02 -0400 |
| commit | 496b1e4c57e0e28881f8762cc17fe4154e91841d (patch) | |
| tree | eb2b832963565e4fc36a15cf747f49d40674f6e7 /python | |
| parent | e2107c90ab2cfbf1c4910af976a906149ff13693 (diff) | |
fixed BinaryView.get_functions_by_name to handle cases like `sub_main`
Diffstat (limited to 'python')
| -rw-r--r-- | python/binaryview.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/python/binaryview.py b/python/binaryview.py index bae74982..e3e880c9 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -3907,10 +3907,13 @@ class BinaryView: fns = [] addresses = [sym.address for sym in self.get_symbols_by_name(name, ordered_filter=ordered_filter)] if len(addresses) == 0 and name.startswith("sub_"): - addresses = [int(name[4:], 16)] + try: + addresses = [int(name[4:], 16)] + except: + addresses = [] for address in addresses: for fn in self.get_functions_at(address): - if fn.platform == plat: + if fn.start == address and fn.platform == plat: fns.append(fn) return fns |
