Java Decompiler Diversity and its Application to Meta-decompilation

Nicolas Harrand, César Soto-Valero, Martin Monperrus, Benoit Baudry
5/21/2020
cs.SE

Official code: ASSERT-KTH/decompilercmp (21 stars, Java, last commit 2020-06-03).

Abstract

During compilation from Java source code to bytecode, some information is irreversibly lost. In other words, compilation and decompilation of Java code is not symmetric.

Show full abstract

Consequently, decompilation, which aims at producing source code from bytecode, relies on strategies to reconstruct the information that has been lost. Different Java decompilers use distinct strategies to achieve proper decompilation. In this work, we hypothesize that the diverse ways in which bytecode can be decompiled has a direct impact on the quality of the source code produced by decompilers. In this paper, we assess the strategies of eight Java decompilers with respect to three quality indicators: syntactic correctness, syntactic distortion and semantic equivalence modulo inputs. Our results show that no single modern decompiler is able to correctly handle the variety of bytecode structures coming from real-world programs. The highest ranking decompiler in this study produces syntactically correct, and semantically equivalent code output for 84%, respectively 78%, of the classes in our dataset. Our results demonstrate that each decompiler correctly handles a different set of bytecode classes. We propose a new decompiler called Arlecchino that leverages the diversity of existing decompilers. To do so, we merge partial decompilation into a new one based on compilation errors. Arlecchino handles 37.6% of bytecode classes that were previously handled by no decompiler. We publish the sources of this new bytecode decompiler.

View on arXivView PDF

Code Implementations(1)

Dataset and tool to analyse and compare java bytecode decompilers http://arxiv.org/pdf/1908.06895

215Java, ShellJun 12, 20196 years ago
decompilerjavakthopen-science

Similar Papers

Cite this paper

@article{harrand2020java,
  title  = {Java Decompiler Diversity and its Application to Meta-decompilation},
  author = {Nicolas Harrand and César Soto-Valero and Martin Monperrus and Benoit Baudry},
  year   = {2020},
  eprint = {2005.11315},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2005.11315}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2005.11315.svg)](https://codeofpaper.com/paper/2005.11315)

Discussion