identify_matching_functions_by_call: Add support for matching one fn

This commit is contained in:
Léo Lam 2021-01-01 18:58:24 +01:00
parent e6d0305d57
commit d5a9f2bc82
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
1 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
from typing import Dict, List
import argparse
import cxxfilt
from colorama import Fore
@ -34,9 +35,18 @@ class Checker(checker.FunctionChecker):
def main() -> None:
parser = argparse.ArgumentParser("Identifies matching functions by looking at function calls in matching functions")
parser.add_argument("-f", "--fn", help="Functions to analyze", nargs="*")
args = parser.parse_args()
functions_to_analyze = set(args.fn) if args.fn else set()
functions_by_addr: Dict[int, utils.FunctionInfo] = {fn.addr: fn for fn in utils.get_functions()}
fn_checker = Checker()
for fn in functions_by_addr.values():
if functions_to_analyze and fn.decomp_name not in functions_to_analyze:
continue
if fn.status != utils.FunctionStatus.Matching:
continue