Large language models in reverse engineering for annotating decompiled code

Loading...
Thumbnail Image

URL

Journal Title

Journal ISSN

Volume Title

School of Science | Master's thesis

Department

Mcode

Language

en

Pages

62

Series

Abstract

Software reverse engineering is a difficult and time-consuming task, where the analyst tries to recover information about the functionality and inner workings of a program without access to its source code. Typically, the main source of information is the binary code of the program. Reducing the costs and duration of this process is of interest due to fields such as malware analysis and black-box vulnerability research relying on the information obtained through reverse engineering. In this thesis, we design and implement an extension for the reverse engineering framework Ghidra to annotate decompiled code using large language models (LLMs). It improves upon the existing alternatives by providing the cross-references of the function under analysis to the model and by offering a more complete user interface integration into the framework. For privacy, the tool is designed for use with models that can be run locally. We also evaluate the quality of the function names produced by the tool. Our results show that the tool produces more useful than misleading names. We also find that the added cross-references improve the results by a significant margin. This work provides a solid base for future developments in LLM-assisted reverse engineering.

Tietokoneohjelmien takaisinmallintaminen on vaikea ja aikaavievä prosessi, jossa yritetään selvittää tietoa ohjelman toiminnasta ilman sen lähdekoodia. Ohjelman binäärikoodi on tässä tilanteessa tyypillisesti tärkein tietolähde. Koska takaisinmallintaminen on keskeinen osa haittaohjelmien analysointia ja haavoittuvuustutkimusta, sen helpottaminen ja nopeuttaminen olisi hyödyllistä. Tässä diplomityössä suunnitellaan ja toteutetaan laajennus takaisinmallintamisympäristö Ghidralle takaisinkäännetyn koodin annotointiin kielimalleja (LLM) käyttämällä. Olemassa oleviin työkaluihin verrattuna se antaa kielimallille enemmän tietoa sisällyttämällä analysoitavan funktion kutsuntakontekstin kehotteeseen. Lisäksi se tarjoaa paremman käyttökokemuksen integroimalla käyttöliittymän kokonaan takaisinmallintamisympäristöön. Yksityisyydensuojan ja tietoturvan takaamiseksi työkalu on suunniteltu käytettäväksi paikallisesti ajettavilla kielimalleilla. Lisäksi työkalun tuottamien funktionimien laatu arvioidaan. Tutkimustulokset osoittavat, että työkalu tuottaa enemmän hyödyllisiä kuin harhaanjohtavia nimiä. Lisäksi havaitaan, että kutsuntakontekstin antaminen kielimallille parantaa tuloksia merkittävästi. Tämä työ antaa hyvän kehityspohjan kielimallien käytölle takaisinmallintamisessa.

Description

Supervisor

Gunn, Lachlan

Thesis advisor

Pasanen, Olli

Other note

Citation