This repo is for research of Espressif-IDf related CVE-2019-12586->7, because the esp-wifi-lib use libraray without source code, so ghidriff is been used as a disassembler diff program.
Before ghidriff, I wrote a small script to filter the libraries which are not 100% same but over 9%
def file_similarity(file1, file2):
with open(file1, 'rb') as f1, open(file2, 'rb') as f2:
bytes1 = bytearray(f1.read())
bytes2 = bytearray(f2.read())
distance = sum(abs(b1 - b2) for b1, b2 in zip(bytes1, bytes2))
max_distance = len(bytes1) + len(bytes2)
similarity = 1 - distance / max_distance
return similarity
The result of vastly different libraries are:
wpa2_internal.o:-19.00080671184253
ieee80211_api.o:-12.077891205874195
ieee80211_sta.o:-20.02386530014641