A new string distance for computing binary code similarities
Ciprian Oprişa, George Cabău, Gheorghe Sebestyen Pal · 2014
A binary program can be represented as a string of operation codes by disassembling it and removing the instruction operands. Using this representation, the problem of detecting if two programs are similar can be reduced to computing the distance between two strings. The most common types of edit distance are fit for this task but unfortunately their running time is quadratic. A new type of edit distance called deq distance is proposed and it can be computed in linear time. This distance also measures the number of operations required to transform a string into another but only allows the operations that can be performed on a double ended queue. The new distance has been tested in clustering algorithms and produced quality clusters, very similar to the ones produced by a regular edit distance. The performance evaluation also showed that the new distance can be computed faster for strings longer than 300 characters, making it appropriate for finding similarities between malware samples.