def main(): features = [] for f in helpers.get_functions(skip_thunks=True, skip_libs=True): for bb in idaapi.FlowChart(f, flags=idaapi.FC_PREDS): features.extend(list(extract_features(f, bb))) import pprint pprint.pprint(features)
def get_functions(self): import capa.features.extractors.ida.helpers as ida_helpers # data structure shared across functions yielded here. # useful for caching analysis relevant across a single workspace. ctx = {} # ignore library functions and thunk functions as identified by IDA for f in ida_helpers.get_functions(skip_thunks=True, skip_libs=True): setattr(f, "ctx", ctx) yield FunctionHandle(f)
def get_functions(self): import capa.features.extractors.ida.helpers as ida_helpers # ignore library functions and thunk functions as identified by IDA for f in ida_helpers.get_functions(skip_thunks=True, skip_libs=True): yield add_ea_int_cast(f)