Software reverse engineering is an intricate process that involves analyzing binary applications to understand their functionality and inner workings. However, compiler optimizations and obfuscation techniques can make this task challenging, making it difficult to identify functions and understand their behavior. This thesis presents a novel framework that employs a static analysis approach to recognize inlined binary functions in binaries. The proposed framework aims to recognize inlined method calls of template classes through an innovative function fingerprinting format. In particular, our fingerprints capture a reduced version of the Control-Flow Graph of a function, along with the memory accesses it executes concerning a specific object. In addition, our framework automatically generates a database of known fingerprints by analyzing the source code of template classes. Employing sub-graph isomorphism algorithms, we can compare the fingerprints of a target binary application with the database of known ones to detect inlined method calls. We have implemented and tested the proposed framework on a large set of binaries. The results show that it can successfully recognize inlined functions with a high degree of accuracy. In particular, we gathered a set of GitHub projects marked as C++ and we compiled them with different optimizations to enable function inlining. We then tested the performance of our framework in recognizing the most common and significant methods of the classes std::vector, std::map, std::queue, and std::deque. Overall, we achieved a recall of 0.42 with a precision of 0.76.
Il software reverse engineering è un processo complesso che comporta l'analisi di applicazioni binarie per comprendere il loro scopo e il loro funzionamento interno. Tuttavia, le ottimizzazioni del compilatore e le tecniche di offuscamento del codice possono rendere complicata questa attività, rendendo arduo identificare le funzioni e comprenderne il comportamento. Questa tesi propone un nuovo framework che utilizza un approccio di analisi statica per riconoscere le funzioni inlined nelle applicazioni binarie. Il lavoro proposto mira a riconoscere le chiamate dei metodi inlined delle classi modello attraverso un formato innovativo di fingerprinting di funzioni. In particolare, le nostre fingerprint catturano una versione ridotta del Control-Flow Graph di una funzione insieme agli accessi a memoria che essa esegue in relazione ad un oggetto specifico. Inoltre, il nostro framework genera automaticamente un database di fingerprint note analizzando il codice sorgente delle classi modello. Utilizzando algoritmi di isomorfismo di sottografi, siamo in grado di confrontare le fingerprint di un'applicazione binaria con il database di quelle conosciute per identificare i metodi inlined. Abbiamo implementato e testato il framework proposto su un'ampia collezione di binari. I risultati mostrano che esso può riconoscere con successo le funzioni inlined con un alto grado di precisione. In particolare, abbiamo raccolto un insieme di progetti di GitHub etichettati come C++ e li abbiamo compilati con diverse ottimizzazioni per consentire l'inline delle funzioni. Abbiamo quindi testato le prestazioni del nostro framework nel riconoscere i metodi più comuni e significativi delle classi std::vector, std::map, std::queue e std::deque. Nel complesso, abbiamo ottenuto un'accuratezza di 0,42 con una precisione di 0,76.
MemRec: Automatic Recognition of Inlined Binary Functions from Template Classes
Bagarin, Stefano
2021/2022
Abstract
Software reverse engineering is an intricate process that involves analyzing binary applications to understand their functionality and inner workings. However, compiler optimizations and obfuscation techniques can make this task challenging, making it difficult to identify functions and understand their behavior. This thesis presents a novel framework that employs a static analysis approach to recognize inlined binary functions in binaries. The proposed framework aims to recognize inlined method calls of template classes through an innovative function fingerprinting format. In particular, our fingerprints capture a reduced version of the Control-Flow Graph of a function, along with the memory accesses it executes concerning a specific object. In addition, our framework automatically generates a database of known fingerprints by analyzing the source code of template classes. Employing sub-graph isomorphism algorithms, we can compare the fingerprints of a target binary application with the database of known ones to detect inlined method calls. We have implemented and tested the proposed framework on a large set of binaries. The results show that it can successfully recognize inlined functions with a high degree of accuracy. In particular, we gathered a set of GitHub projects marked as C++ and we compiled them with different optimizations to enable function inlining. We then tested the performance of our framework in recognizing the most common and significant methods of the classes std::vector, std::map, std::queue, and std::deque. Overall, we achieved a recall of 0.42 with a precision of 0.76.File | Dimensione | Formato | |
---|---|---|---|
Thesis_Stefano_Bagarin.pdf
accessibile in internet per tutti
Descrizione: Thesis
Dimensione
1.46 MB
Formato
Adobe PDF
|
1.46 MB | Adobe PDF | Visualizza/Apri |
Executive_Summary_Stefano_Bagarin.pdf
accessibile in internet per tutti
Descrizione: Executive Summary
Dimensione
716.11 kB
Formato
Adobe PDF
|
716.11 kB | Adobe PDF | Visualizza/Apri |
I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
https://hdl.handle.net/10589/203177