Skip to content

Instantly share code, notes, and snippets.

@jhftss
Last active March 16, 2022 18:17
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jhftss/5db38772dc70bc6ecbf605d45a96cc5a to your computer and use it in GitHub Desktop.
Save jhftss/5db38772dc70bc6ecbf605d45a96cc5a to your computer and use it in GitHub Desktop.
symbolization using the bindiff results
# From the "Matched Functions" window of the bindiff plugin:
# right click, copy all, and then paste to a bindiff_result.txt
with open('/path/to/bindiff_result.txt', 'r') as file:
file.readline() # skip header line
for line in file.readlines():
sp = line.split('\t')
if len(sp) == 18:
similarity = float(sp[0])
confidence = float(sp[1])
addr = int(sp[3], 16)
name1 = sp[4]
name2 = sp[6].split('(')[0].replace('::', '__').replace('~','Dtor')
if (similarity > 0.8 or confidence > 0.8) and name1.startswith('sub_') and not name2.startswith('sub_'):
#print('rename at 0x%x: %s -> %s'%(addr, name1, name2))
set_name(addr, name2, idaapi.SN_CHECK|idaapi.SN_FORCE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment