A decompiler for Objective-C
Dekompilátor pro Objective-C
diploma thesis (DEFENDED)

View/ Open
Permanent link
http://hdl.handle.net/20.500.11956/83117Identifiers
Study Information System: 143329
Collections
- Kvalifikační práce [11325]
Author
Advisor
Referee
Bednárek, David
Faculty / Institute
Faculty of Mathematics and Physics
Discipline
Software Systems
Department
Department of Software Engineering
Date of defense
5. 9. 2016
Publisher
Univerzita Karlova, Matematicko-fyzikální fakultaLanguage
English
Grade
Excellent
Keywords (Czech)
Objective-C, dekompilátor, analýza programůKeywords (English)
Objective-C, decompiler, program analysisObjective-C je populární programovací jazyk používaný primárně pro vývoj na platformách OS X a iOS. V práci prezentujeme praktický přístup k dekompilaci programů napsaných v Objective-C a zkompilovaných pro architektury x86 a AArch64 za použití kompilátoru LLVM. Na základě známých obecných technik reverzního inženýrství a teorie kompilátorů analyzujeme nové problémy a příležitosti v binárních souborech vzniklých překladem z Objective-C. Poté navrhujeme řešení a algoritmy, které umožní dekompilátoru lépe rozpoznat vysokoúrovňové struktury, které jsou běžné ve zdrojových kódech napsaných v jazyce Objective-C. Tato práce předkládá implementaci nového dekompilátoru zvaného "Cricket" jako grafickou aplikaci pro OS X, která využívá popsané algoritmy a metody pro rozpoznávání vzorů k rekonstrukci zdrojového kódu v Objective-C. Dekompilátor si klade za cíl maximalizovat čitelnost výstupu a umožňuje uživateli dále modifikovat vygenerovaný zdrojový kód. Implementovaný program je poté vyhodnocen na populární open-source knihovně a výstupy jsou porovnány s konkurenčním produktem. Powered by TCPDF (www.tcpdf.org)
Objective-C is a popular programming language primarily used on the OS X and iOS platforms. We present a practical approach to decompilation of programs written in Objective-C and compiled for the x86 and AArch64 architectures using LLVM. Based on already-known generic reverse engineering techniques and compiler theory, this thesis analyzes new challenges and opportunities that occur in Objective-C binaries. We then offer solutions and algorithms that allow a decompiler to better recognize the high-level structures commonly used in Objective-C source codes. The thesis introduces an implementation of a new decompiler called "Cricket", an interactive GUI application for OS X, which uses the described algorithms and pattern matching methods to reconstruct source code in Objective-C. The decompiler tries to maximize readability of the output and allows user interaction to further modify the generated source code. The implemented software is then evaluated on a popular open-source framework and the results are compared to a competing product. Powered by TCPDF (www.tcpdf.org)