Reverse Engg Wiki
Reverse Engg Wiki
Reverse engineering is the process of discovering the technological principles of a device, object, or system through analysis of its structure, function, and operation.[1] It often involves taking something (a mechanical device, electronic component, computer program, or biological, chemical, or organic matter) apart and analyzing its workings in detail to be used in maintenance, or to try to make a new device or program that does the same thing without using or simply duplicating (without understanding) the original. Reverse engineering has its origins in the analysis of hardware for commercial or military advantage. The purpose is to deduce design decisions from end products with little or no additional knowledge about the procedures involved in the original production. The same techniques are subsequently being researched for application to legacy software systems, not for industrial or defence ends, but rather to replace incorrect, incomplete, or otherwise unavailable documentation.
Motivation
Reasons for reverse engineering:
Interfacing. RE can be used when a system is required to interface to another system and how both systems would negotiate is to be established. Such requirements typically exist for interoperability. Military or commercial espionage. Learning about an enemy's or competitor's latest research by stealing or capturing a prototype and dismantling it. It may result in development of similar product. Improve documentation shortcomings Reverse engineering can be done when documentation of a system for its design, production, operation or maintenance have shortcomings and original designers are not available to improve it. RE of software can provide the most current documentation necessary for understanding the most current state of a software system Obsolescence Integrated circuits often seem to have been designed on obsolete, proprietary systems, which means that the only way to incorporate the functionality into new technology is to reverse-engineer the existing chip and then re-design it. Software Modernization. RE is generally needed in order to understand the 'as is' state of existing or legacy software in order to properly estimate the effort required to migrate system knowledge into a 'to be' state. Much of this may be driven by changing functional, compliance or security requirements. Product Security Analysis.. To examine how a product works, what are specifications of its components, estimate costs and identify potential patent infringement. Acquiring sensitive data by disassembling and analysing the design of a system component.[4] Another intent may be to remove copy protection, circumvention of access restrictions. Bug fixing. To fix (or sometimes to enhance) legacy software which is no longer supported by its creators. Creation of unlicensed/unapproved duplicates.
Academic/learning purposes. RE for learning purposes may be understand the key issues of an unsuccessful design and subsequently improve the design. Competitive technical intelligence (understand what your competitor is actually doing, versus what they say they are doing).
additional features on low-cost "crippled" hardware (such as some graphics card chip-sets), or even mere satisfaction of curiosity.
Binary software
This process is sometimes termed Reverse Code Engineering, or RCE.[8] As an example, decompilation of binaries for the Java platform can be accomplished using Jad. One famous case of reverse engineering was the first non-IBM implementation of the PC BIOS which launched the historic IBM PC compatible industry that has been the overwhelmingly dominant computer hardware platform for many years. An example of a group that reverse-engineers software for enjoyment (and to distribute registration cracks) is CORE which stands for "Challenge Of Reverse Engineering". Reverse engineering of software is protected in the U.S. by the fair use exception in copyright law.[9] The Samba software, which allows systems that are not running Microsoft Windows systems to share files with systems that are, is a classic example of software reverse engineering,[10] since the Samba project had to reverse-engineer unpublished information about how Windows file sharing worked, so that non-Windows computers could emulate it. The Wine project does the same thing for the Windows API, and OpenOffice.org is one party doing this for the Microsoft Office file formats. The ReactOS project is even more ambitious in its goals, as it strives to provide binary (ABI and API) compatibility with the current Windows OSes of the NT branch, allowing software and drivers written for Windows to run on a clean-room reverseengineered GPL free software or open-source counterpart. WindowsSCOPE allows for reverseengineering the full contents of a Windows system's live memory including a binary-level, graphical reverse engineering of all running processes.
Binary software techniques
Reverse engineering of software can be accomplished by various methods. The three main groups of software reverse engineering are
1. Analysis through observation of information exchange, most prevalent in protocol reverse engineering, which involves using bus analyzers and packet sniffers, for example, for accessing a computer bus or computer network connection and revealing the traffic data thereon. Bus or network behavior can then be analyzed to produce a stand-alone implementation that mimics that behavior. This is especially useful for reverse engineering device drivers. Sometimes, reverse engineering on embedded systems is greatly assisted by tools deliberately introduced by the manufacturer, such as JTAG ports or other debugging means. In Microsoft Windows, low-level debuggers such as SoftICE are popular. 2. Disassembly using a disassembler, meaning the raw machine language of the program is read and understood in its own terms, only with the aid of machinelanguage mnemonics. This works on any computer program but can take quite some time, especially for someone not used to machine code. The Interactive Disassembler is a particularly popular tool. 3. Decompilation using a decompiler, a process that tries, with varying results, to recreate the source code in some high-level language for a program only available in machine code or bytecode. Classification
Reverse Engineering of a software can be done automatically when the goal is Classifying the binary and match it to other binaries. This method is being used mostly for security reasons (detecting viruses etc.).
Source code
A number of UML tools refer to the process of importing and analysing source code to generate UML diagrams as "reverse engineering". See List of UML tools. Although UML is one approach to providing "reverse engineering" more recent advances in international standards activities have resulted in the development of the Knowledge Discovery Metamodel (KDM). This standard delivers an ontology for the intermediate (or abstracted) representation of programming language constructs and their interrelationships. An Object Management Group Standard (on its way to becoming an ISO standard as well), KDM has started to take hold in industry with the development of tools and analysis environments which can deliver the extraction and analysis of source, binary, and byte code. For source code analysis, KDM's granular standards' architecture enables the extraction of software system flows (data, control, & call maps), architectures, and business layer knowledge (rules, terms, process). The standard enables the use of a common data format (XMI) enabling the correlation of the various layers of system knowledge for either detailed analysis (e.g. root cause, impact) or derived analysis (e.g. business process extraction). Although efforts to represent language constructs can be never-ending given the number of languages, the continuous evolution of software languages and the development of new languages, the standard does allow for the use of extensions to support the broad language set as well as evolution. KDM is compatible with UML, BPMN, RDF and other standards enabling migration into other environments and thus leverage system knowledge for efforts such as software system transformation and enterprise business layer analysis.
Jerry can: British and American forces noticed that the Germans had gasoline cans with an excellent design. They reverse-engineered copies of those cans. The cans were popularly known as "Jerry cans". Tupolev Tu-4: Three American B-29 bombers on missions over Japan were forced to land in the USSR. The Soviets, who did not have a similar strategic bomber, decided to copy the B-29. Within a few years, they had developed the Tu-4, a near-perfect copy. V-2 rocket: Technical documents for the V2 and related technologies were captured by the Western Allies at the end of the war. Soviet and captured German engineers had to reproduce technical documents and plans, working from captured hardware, in order to make their clone of the rocket, the R-1, which began the postwar Soviet rocket program that led to the R-7 and the beginning of the space race. K-13/R-3S missile (NATO reporting name AA-2 Atoll), a Soviet reverse-engineered copy of the AIM-9 Sidewinder, was made possible after a Taiwanese AIM-9B hit a Chinese MiG-17 without exploding. The missile became lodged within the airframe, and the pilot returned to base with what Russian scientists would describe as a university course in missile development. BGM-71 TOW Missile: In May 1975, negotiations between Iran and Hughes Missile Systems on co-production of the TOW and Maverick missiles stalled over disagreements in the pricing structure, the subsequent 1979 revolution ending all plans for such co-production. Iran was later successful in reverse-engineering the missile and are currently producing their own copy: the Toophan. China has reversed engineered many examples of Western and Russian hardware, from fighter aircraft to missiles and HMMWV cars. During the Second World War, British military intelligence at the Bletchley Park centre studied captured German "Enigma" message encryption machines. Their operation was then simulated on electro-mechanical devices called "Bombes" that tried all the possible scrambler settings of the "Enigma" machines to help break the coded messages sent by the Germans.
Legality
United States
In the United States even if an artifact or process is protected by trade secrets, reverse-engineering the artifact or process is often lawful as long as it is obtained legitimately.[21] Patents, on the other hand, need a public disclosure of an invention, and therefore, patented items do not necessarily have to be reverse-engineered to be studied. (However, an item produced under one or more patents could also include other technology that is not patented and not disclosed.) One common motivation of reverse engineering is to determine whether a competitor's product contains patent infringements or copyright infringements. The reverse engineering of software in the US is generally a breach of contract as most EULAs specifically prohibit it, and courts have found such contractual prohibitions to override the copyright law which expressly permits it; see Bowers v. Baystate Technologies.[22][23] Sec. 103(f) of the DMCA (17 U.S.C. 1201 (f)) says that if you legally obtain a program that is protected, you are allowed to reverse-engineer and circumvent the protection to achieve interoperability between computer programs (i.e., the ability to exchange and make use of information). The section states: (f) Reverse Engineering. (1) Notwithstanding the provisions of subsection (a)(1)(A), a person who has lawfully obtained the right to use a copy of a computer program may circumvent a technological measure that effectively controls access to a particular portion of that program for the sole purpose of identifying and analyzing those elements of the program that are necessary to achieve interoperability of an independently created computer program with other programs, and that have not previously been readily available to the person engaging in the circumvention, to the extent any such acts of identification and analysis do not constitute infringement under this title. (2) Notwithstanding the provisions of subsections (a)(2) and (b), a person may develop and employ technological means to circumvent a technological measure, or to circumvent protection afforded by a technological measure, in order to enable the identification and analysis under paragraph (1), or for the purpose of enabling interoperability of an independently created computer program with other programs, if such means are necessary to achieve such interoperability, to the extent that doing so does not constitute infringement under this title. (3) The information acquired through the acts permitted under paragraph (1), and the means permitted under paragraph (2), may be made available to others if the person referred to in paragraph (1) or (2), as the case may be, provides such information or means solely for the purpose of enabling interoperability of an independently created computer program with other programs, and to the extent that doing so does not constitute infringement under this title or violate applicable law other than this section. (4) For purposes of this subsection, the term interoperability means the ability of computer programs to exchange information, and of such programs mutually to use the information which has been exchanged.
European Union
Article 6 of the 1991 EU Computer Programs Directive allows reverse engineering for the purposes of interoperability, but prohibits it for the purposes of creating a competing product, and also prohibits the public release of information obtained through reverse engineering of software.[24][25][26] In 2009, the EU Computer Program Directive was superseded and the directive now states:[27] (15) The unauthorised reproduction, translation, adaptation or transformation of the form of the code in which a copy of a computer program has been made available constitutes an infringement of the exclusive rights of the author. Nevertheless, circumstances may exist when such a reproduction of the code and translation of its form are indispensable to obtain the necessary information to achieve the interoperability of an independently created program with other programs. It has therefore to be considered that, in these limited circumstances only, performance of the acts of reproduction and translation by or on behalf of a person having a right to use a copy of the program is legitimate and compatible with fair practice and must therefore be deemed not to require the authorisation of the rightholder. An objective of this exception is to make it possible to connect all components of a computer system, including those of different manufacturers, so that they can work together. Such an exception to the author's exclusive rights may not be used in a way which prejudices the legitimate interests of the rightholder or which conflicts with a normal exploitation of the program.
See also
Antikythera mechanism Benchmarking Bus analyzer Chonda Clean room design CMM Code morphing Connectix Virtual Game Station Cryptanalysis Decompiler Digital Millennium Copyright Act (DMCA) Forensic engineering Industrial CT scanning Interactive Disassembler Knowledge Discovery Metamodel Laser scanner List of production topics Logic analyzer
References
1. ^ Eilam, Eldad & Chikofsky, Elliot J. (2007). Reversing: secrets of reverse engineering. John Wiley & Sons. p. 3. ISBN 978-0-7645-7481-8. 2. ^ Chikofsky, E. J. & Cross, J. H., II (1990). "Reverse Engineering and Design Recovery: A Taxonomy". IEEE Software 7 (1): 1317. doi:10.1109/52.43044. 3. ^ A Survey of Reverse Engineering and Program Comprehension. Michael L. Nelson, April 19, 1996, ODU CS 551 Software Engineering Survey. Furthermore, reverse engineering concept is used to modify or change premade .dll files in an operating systems ^ Internet Engineering Task Force RFC 2828 Internet Security Glossary ^ Varady, T; Martin, R; Cox, J (1997). "Reverse engineering of geometric modelsan introduction". Computer-Aided Design 29 (4): 255268. doi:10.1016/S0010-4485(96)00054-1. ^ Chikofsky, E. J.; Cross, J. H. (January 1990). "Reverse engineering and design recovery: A taxonomy". IEEE Software 7: 1317. doi:10.1109/52.43044. ^ Warden, R. (1992). Software Reuse and Reverse Engineering in Practice . London, England: Chapman & Hall. pp. 283305. ^ Chuvakin, Anton; Cyrus Peikari (January 2004). Security Warrior (1st ed.). O'Reilly. ^ Samuelson, Pamela & Scotchmer, Suzanne (2002). "The Law and Economics of Reverse Engineering". Yale Law Journal 111 (7): 15751663. doi:10.2307/797533. JSTOR 797533. ^ "Samba: An Introduction". 2001-11-27. Retrieved 2009-05-07. ^ W. Cui, J. Kannan, and H. J. Wang. Discoverer: Automatic protocol reverse engineering from network traces. In Proceedings of 16th USENIX Security Symposium on USENIX Security Symposium, pp. 114. ^ W. Cui, M. Peinado, K. Chen, H. J. Wang, and L. Irn-Briz. Tupni: Automatic reverse engineering of input formats. In Proceedings of the 15th ACM Conference on Computer and Communications Security, pp. 391402. ACM, Oct 2008. ^ a b P. M. Comparetti, G. Wondracek, C. Kruegel, and E. Kirda. Prospex: Protocol specification extraction. In Proceedings of the 2009 30th IEEE Symposium on Security and Privacy, pp. 110125, Washington, 2009. IEEE Computer Society. ^ Gold, E (1978). "Complexity of automaton identification from given data". Information and Control 37 (3): 302320. doi:10.1016/S0019-9958(78)90562-4. ^ D. Angluin (1987). "Learning regular sets from queries and counterexamples". Information and Computation 75 (2): 87106. doi:10.1016/08905401(87)90052-6.
4. 5.
6. 7. 8. 9.
10. 11.
12.
13.
14. 15.
16.
^ C.Y. Cho, D. Babic, R. Shin, and D. Song. Inference and Analysis of Formal Models of Botnet Command and Control Protocols, 2010 ACM Conference on Computer and Communications Security. ^ Polyglot: automatic extraction of protocol message format using dynamic binary analysis. J. Caballero, H. Yin, Z. Liang, and D. Song. Proceedings of the 14th ACM conference on Computer and communications security, p. 317-329. ^ Wolfgang Rankl, Wolfgang Effing, Smart Card Handbook (2004) ^ T. Welz: Smart cards as methods for payment (2008), Seminar ITS-Security Ruhr-Universitt Bochum ^ David C. Musker: Protecting & Exploiting Intellectual Property in Electronics, IBC Conferences, 10 June 1998 ^ "Trade Secrets 101," Feature Article, October 2008. Memagazine.org. Retrieved on 2011-05-29. ^ Baystate v. Bowers Discussion. Utsystem.edu. Retrieved on 2011-05-29. ^ Gross, Grant. (2003-06-26) Contract case could hurt reverse engineering | Developer World. InfoWorld. Retrieved on 2011-05-29. ^ Council Directive 91/250/EEC of 14 May 1991 on the legal protection of computer programs. Eur-lex.europa.eu. Retrieved on 2011-05-29. ^ P. B. Hugenholtz (2006). The future of the public domain: identifying the commons in information law. Kluwer Law International. pp. 321. ISBN 978-90-4112435-7. Retrieved 29 May 2011. ^ Jenkins | Trade Mark and Patent Attorneys | Reverse Engineering. Jenkins.eu. Retrieved on 2011-05-29. ^ DIRECTIVE 2009/24/EC OF THE EUROPEAN PARLIAMENT AND OF THE COUNCIL of 23 April 2009 on the legal protection of computer programs
17.
26. 27.
Further reading
Eilam, Eldad (2005). Reversing: Secrets of Reverse Engineering. Wiley Publishing. p. 595. ISBN 0-7645-7481-7. James, Dick (January 19, 2006). "Reverse Engineering Delivers Product Knowledge; Aids Technology Spread". Electronic Design. Penton Media, Inc. Retrieved 2009-0203. Raja, Vinesh; Fernandes, Kiran J. (2008). Reverse Engineering An Industrial Perspective. Springer. p. 242. ISBN 978-1-84628-855-5. Thumm, Mike (2007). "Talking Tactics". IEEE 2007 Custom Integrated Circuits Conference (CICC). IEEE, Inc. Retrieved 2009-02-03. Cipresso, Teodoro (2009). "Software Reverse Engineering Education". SJSU Master's Thesis. ProQuest UML. Retrieved 2009-08-22.