Last active
March 16, 2022 18:17
-
-
Save jhftss/5db38772dc70bc6ecbf605d45a96cc5a to your computer and use it in GitHub Desktop.
symbolization using the bindiff results
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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