Affiliation:
1. Univ. Polite´cnica de Madrid, Madrid, Spain
2. Oxford Univ., Oxford, UK
Abstract
While a compiler produces low-level object code from high-level source code, a decompiler produces high-level code from low-level code and has applications in the testing and validation of safety-critical software. The decompilation of an object code provides an independent demonstration of correctness that is hard to better for industrial purposes (an alternative is to prove the compiler correct). But, although compiler compilers are in common use in the software industry, a decompiler compiler is much more unusual.
It turns out that a data type specification for a programming-language grammar can be remolded into a functional program that enumerates all of the abstract syntax trees of the grammar. This observation is the springboard for a general method for compiling decompilers from the specifications of (nonoptimizing) compilers.
This paper deals with methods and theory, together with an application of the technique. The correctness of a decompiler generated from a simple occam-like compiler specification is demonstrated. The basic problem of enumerating the syntax trees of grammars, and then stopping, is shown to have no recursive solution, but methods of abstract interpretation can be used to guarantee the adequacy and completeness of our technique in practical instances, including the decompiler for the language presented here.
Publisher
Association for Computing Machinery (ACM)
Reference33 articles.
1. ABELSON H. SUSSMAN G. J. AND SUSSMAN J. 1985. Structure and Interpretation of Computer Programs. MIT Press Cambridge Mass. ABELSON H. SUSSMAN G. J. AND SUSSMAN J. 1985. Structure and Interpretation of Computer Programs. MIT Press Cambridge Mass.
2. ABRAMSKY S. AND HANKIN C. EDS. 1987. Abstract Interpretation of Declarative Languages. Ellis Horwood Computers and Their Applications. Halsted Press New York. ABRAMSKY S. AND HANKIN C. EDS. 1987. Abstract Interpretation of Declarative Languages. Ellis Horwood Computers and Their Applications. Halsted Press New York.
3. BOOLOS G. AND JEFFREY R. C. 1989. Computability and Logic. 3rd ed. Cambridge University Press New York. BOOLOS G. AND JEFFREY R. C. 1989. Computability and Logic. 3rd ed. Cambridge University Press New York.
4. From programs to object code and back again using logic programming: Compilation and decompilation;BOWEN J. P.;J. Softw. Maint. Res. Pract.,1993
Cited by
11 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. On the use of statistical machine translation for suggesting variable names for decompiled code: The Pharo case;Journal of Computer Languages;2024-06
2. A comparison of code similarity analysers;Empirical Software Engineering;2017-10-25
3. CPR: cross platform binary code reuse via platform independent trace program;Proceedings of the 26th ACM SIGSOFT International Symposium on Software Testing and Analysis;2017-07-10
4. Type Inference on Executables;ACM Computing Surveys;2016-05-02
5. Processor Rescue;Communications in Computer and Information Science;2015