def match_funcs(qt_funcs):
"""
Convert function names scraped from Qt to their *actual* representation.
The function names we scrape from the Functions window Qt table actually
use the underscore character ('_') as a substitute for a variety of
different characters.
For example, a function named foo%bar in the IDB will appears as foo_bar
in the Functions window table.
This function takes a list of names as they appear in the Functions window
table such as the following:
['foo_bar']
And applies a best effort lookup to return a list of the 'true' function
names as they are stored in the IDB.
['foo%bar']
TODO: rewrite this to be more efficient for larger idbs
TODO: takes first matching function, may want to change it to make the requirements more strict
"""
res = set()
ida_funcs = get_all_funcs()
for f in qt_funcs:
for f2 in ida_funcs:
if len(f) == len(f2):
i = 0
while i < len(f) and (f[i] == f2[i] or f[i] == '_'):
i += 1
if i == len(f):
res.add(f2)
break
return list(res)
评论列表
文章目录