skip to main content
10.1145/1831708.1831741acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

N-version disassembly: differential testing of x86 disassemblers

Published:12 July 2010Publication History

ABSTRACT

The output of a disassembler is used for many different purposes (e.g., debugging and reverse engineering). Therefore, disassemblers represent the first link of a long chain of stages on which any high-level analysis of machine code depends upon. In this paper we demonstrate that many disassemblers fail to decode certain instructions and thus that the first link of the chain is very weak. We present a methodology, called N-version disassembly, to verify the correctness of disassemblers, based on differential analysis. Given a set of n - 1 disassemblers, we use them to decode fragments of machine code and we compare their output against each other. To further corroborate the output of these disassemblers, we developed a special instruction decoder, the nth, that delegates the decoding to the CPU, the ideal decoder. We tested eight of the most popular disassemblers for Intel x86, and found bugs in each of them.

References

  1. D. Bruschi, L. Cavallaro, and A. Lanzi. Diversified Process Replicae for Defeating Memory Error Exploits. In 3rd International Workshop on Information Assurance. IEEE Computer Society, 2007.Google ScholarGoogle Scholar
  2. D. Chanet, B. De Sutter, B. De Bus, L. Van Put, and K. De Bosschere. Automated Reduction of the Memory Footprint of the Linux Kernel. ACM Transactions on Embedded Computing Systems, 6(4):23, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. L. Chen and A. Avizienis. N-Version Programming: A Fault-Tolerance Approach to Reliability of Software Operation. In Proceedings of the 25 International Symposium on Fault-Tolerant Computing, 1995.Google ScholarGoogle Scholar
  4. C. Cifuentes and M. V. Emmerik. Recovery of Jump Table Case Statements from Binary Code. Science of Computer Programming, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. C. Cifuentes and K. J. Gough. Decompilation of Binary Programs. Software, Practice and Experience, July 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. B. Cox, D. Evans, A. Filipi, J. Rowanhill, W. Hu, J. Davidson, J. Knight, A. Nguyen-tuong, and J. Hiser. N-Variant Systems: A Secretless Framework for Security through Diversity. In Proceedings of the 15th USENIX Security Symposium, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. G. Dabah. diStorm64. http://ragestorm.net/distorm/.Google ScholarGoogle Scholar
  8. M. Dalla Preda, M. Madou, K. De Bosschere, and R. Giacobazzi. Opaque Predicates Detection by Abstract Interpretation. In Proceedings of the 1st International Workshop on Emerging Applications of Abstract Interpretation, 2006.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. B. De Sutter, B. De Bus, K. De Bosschere, P. Keyngnaert, and B. Demoen. On the Static Analysis of Indirect Control Transfers in Binaries. In Proceedings of the International Conference on Parallel and Distributed processing Techniques and Applications (PDPTA), 2000.Google ScholarGoogle Scholar
  10. D. R. Engler and W. C. Hsieh. DERIVE: A Tool That Automatically Reverse-Engineers Instruction Encodings. In Proceedings of the ACM SIGPLAN Workshop on Dynamic and Adaptive Compilation and Optimization (Dynamo), 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Free Software Foundation. GNU Binutils http://www.gnu.org/software/binutils/Google ScholarGoogle Scholar
  12. I. Guilfanov. Simplex method in IDA Pro, 2006. http://www.hexblog.com/2006/06/simplex_method_in_ida_pro.html.Google ScholarGoogle Scholar
  13. I. Guilfanov. Jump tables, 2008. http://hexblog.com/2008/01/jump_tables.html.Google ScholarGoogle Scholar
  14. Hex-Rays. IDA Pro. http://www.hex-rays.com/idapro/.Google ScholarGoogle Scholar
  15. R. N. Horspool and N. Marovac. An Approach to the Problem of Detranslation of Computer Programs. The Computer Journal, 23(3):223--229, 1980.Google ScholarGoogle ScholarCross RefCross Ref
  16. Intel. Intel 64 and IA-32 Architectures Software Developers Manual, Nov. 2008. Instruction Set Reference.Google ScholarGoogle Scholar
  17. Intel Corporation. XED2. http://www.pintool.org/.Google ScholarGoogle Scholar
  18. C. Kruegel, W. Robertson, F. Valeur, and G. Vigna. Static Disassembly of Obfuscated Binaries. In Proceedings of USENIX Security, August 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. C. Linn and S. Debray. Obfuscation of Executable Code to Improve Resistance to Static Disassembly. In Proceedings of the 10th ACM conference on Computer and communications security (CCS), 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. L. Martignoni, R. Paleari, G. Fresi Roglia, and D. Bruschi. Testing CPU emulators. In Proceedings of the 2009 International Conference on Software Testing and Analysis (ISSTA), Chicago, Illinois, U.S.A. ACM, July 2009. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. W. M. McKeeman. Differential Testing for Software. Digital Technical Journal, 10(1), 1998.Google ScholarGoogle Scholar
  22. V. Mohan. Udis86. http://udis86.sourceforge.net/.Google ScholarGoogle Scholar
  23. NASM Team. The netwide assembler. http://www.nasm.us/.Google ScholarGoogle Scholar
  24. G. C. Necula and P. Lee. Proof-carrying code. Technical Report CMUCS-96-165, School of Computer Science, Carnegie Mellon University, Sept. 1996.Google ScholarGoogle Scholar
  25. R. Paleari, L. Martignoni, G. F. Roglia, and D. Bruschi. A Fistful of redpills: How to automatically generate procedures to detect CPU emulators. In Proceedings of the 3rd USENIX Workshop on Offensive Technologies (WOOT), Montreal, Canada. ACM, Aug. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. B. Schwarz, S. Debray, and G. Andrews. Disassembly of Executable Code Revisited. Prooceedings of the Working Conference on Reverse Engineering (WCRE), 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. H. Theiling and A. Angewandte. Extracting Safe and Precise Control Flow from Binaries. In Proceedings of the 7th Conference on Real-Time Computing Systems and Applications, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Tröger and C. Cifuentes. Analysis of Virtual Method Invocation for Binary Translation. In Proceeding of the 9th Working Conference on Reverse Engineering (WCRE), 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. S. Udupa, S. Debray, and M. Madou. Deobfuscation: Reverse Engineering Obfuscated Code. In Proceedings of the 12th Working Conference on Reverse Engineering, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. L. Vinciguerra, L. Wills, N. Kejriwal, P. Martino, and R. Vinciguerra. An Experimentation Framework for Evaluating Disassembly and Decompilation Tools for C++ and Java. In Proceedings of the 10th Working Conference on Reverse Engineering, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. B. Yee, D. Sehr, G. Dardyk, B. Chen, R. Muth, T. Ormandy, S. Okasaka, N. Narula, and N. Fullagar. A sandbox for portable, untrusted x86 native code. In IEEE Symposium on Security and Privacy, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. O. Yuschuk. OllyDbg. http://www.ollydbg.de/.Google ScholarGoogle Scholar

Index Terms

  1. N-version disassembly: differential testing of x86 disassemblers

    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
    • Published in

      cover image ACM Conferences
      ISSTA '10: Proceedings of the 19th international symposium on Software testing and analysis
      July 2010
      294 pages
      ISBN:9781605588230
      DOI:10.1145/1831708

      Copyright © 2010 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 12 July 2010

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate58of213submissions,27%

      Upcoming Conference

      ISSTA '24

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader