# Highlight with theme-aware colors any "dangerous" functions: # Note that prefixed versions like "_system" will not be highlighted using this sample code. dangerous = ["strcpy", "gets"] sus = ["printf", "system", "exec"] for fnname in dangerous + sus: if fnname in dangerous: color = HighlightStandardColor.RedHighlightColor if fnname in sus: color = HighlightStandardColor.OrangeHighlightColor for sym in bv.get_symbols_by_name(fnname): for ref in bv.get_code_refs(sym.address): log_info(f"Highlighting dangerous call at {hex(ref.address)}") ref.function.set_user_instr_highlight(ref.address, color)