skip to main content
research-article

Synthesis of machine code from semantics

Published:03 June 2015Publication History
Skip Abstract Section

Abstract

In this paper, we present a technique to synthesize machine-code instructions from a semantic specification, given as a Quantifier-Free Bit-Vector (QFBV) logic formula. Our technique uses an instantiation of the Counter-Example Guided Inductive Synthesis (CEGIS) framework, in combination with search-space pruning heuristics to synthesize instruction-sequences. To counter the exponential cost inherent in enumerative synthesis, our technique uses a divide-and-conquer strategy to break the input QFBV formula into independent sub-formulas, and synthesize instructions for the sub-formulas. Synthesizers created by our technique could be used to create semantics-based binary rewriting tools such as optimizers, partial evaluators, program obfuscators/de-obfuscators, etc. Our experiments for Intel's IA-32 instruction set show that, in comparison to our baseline algorithm, our search-space pruning heuristics reduce the synthesis time by a factor of 473, and our divide-and-conquer strategy reduces the synthesis time by a further 3 to 5 orders of magnitude.

References

  1. G. Balakrishnan and T. Reps. WYSINWYX: What You See Is Not What You eXecute. TOPLAS, 32(6), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. Bansal and A. Aiken. Automatic generation of peephole superoptimizers. In ASPLOS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. S. Bansal and A. Aiken. Binary translation using peephole superoptimizers. In OSDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. Brumley, I. Jager, T. Avgerinos, and E. Schwartz. BAP: A Binary Analysis Platform. In CAV, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Christodorescu and S. Jha. Testing malware detectors. In ISSTA, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Christodorescu, S. Jha, S. Seshia, D. Song, and R. Bryant. Semantics-aware malware detection. In S&P, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. B. Dutertre and L. de Moura. Yices: An SMT solver, 2006. http://yices.csl.sri.com/.Google ScholarGoogle Scholar
  8. U. Erlingsson and F. Schneider. SASI enforcement of security policies: A retrospective. In Workshop on New Security Paradigms, pages 87–95, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. Gulwani, S. Jha, A. Tiwari, and R. Venkatesan. Synthesis of loopfree programs. In PLDI, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. Henning. SPEC CPU2006 Benchmark descriptions. SIGARCH Comput. Archit. News, 34(4):1–17, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. N. Jones, C. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, Inc., 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. R. Joshi, G. Nelson, and K. Randall. Denali: A goal-directed superoptimizer. In PLDI, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. J. Lim and T. Reps. TSL: A system for generating abstract interpreters and its application to machine-code analysis. TOPLAS, 35(4), 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. J. Lim, A. Lal, and T. Reps. Symbolic analysis via semantic reinterpretation. Softw. Tools for Tech. Transfer, 13(1):61–87, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. H. Massalin. Superoptimizer: A look at the smallest program. In ASPLOS, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. N. Ramsey and M. Fernández. Specifying representations of machine instructions. TOPLAS, 19(3), 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. E. Schkufza, R. Sharma, and A. Aiken. Stochastic superoptimization. In ASPLOS, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Solar-Lezama. Program Synthesis by Sketching. PhD thesis, Univ. of Calif., Berkeley, CA, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. A. Solar-Lezama, R. Rabbah, R. Bodik, and K. Ebcio˘glu. Programming by sketching for bit-streaming programs. In PLDI, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. A. Solar-Lezama, L. Tancau, R. Bodik, S. Seshia, and V. Saraswat. Combinatorial sketching for finite programs. In ASPLOS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. A. Solar-Lezama, G. Arnold, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia. Sketching stencils. In PLDI, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. A. Solar-Lezama, C. Jones, and R. Bodik. Sketching concurrent data structures. In PLDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. D. Song, D. Brumley, H. Yin, J. Caballero, I. Jager, M. Kang, Z. Liang, J. Newsome, P. Poosankam, and P. Saxena. BitBlaze: A new approach to computer security via binary analysis. In International Conference on Information Systems Security, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. A. Udupa, A. Raghavan, J. Deshmukh, S. Mador-Haim, M. Martin, and R. Alur. TRANSIT: Specifying protocols with concolic snippets. In PLDI, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in

Full Access

  • Published in

    cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 50, Issue 6
    PLDI '15
    June 2015
    630 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2813885
    • Editor:
    • Andy Gill
    Issue’s Table of Contents
    • cover image ACM Conferences
      PLDI '15: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation
      June 2015
      630 pages
      ISBN:9781450334686
      DOI:10.1145/2737924

    Copyright © 2015 ACM

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 3 June 2015

    Check for updates

    Qualifiers

    • research-article

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader
About Cookies On This Site

We use cookies to ensure that we give you the best experience on our website.

Learn more

Got it!