background preloader

Www.program-transformation.org

Facebook Twitter

Exploiting Software: How to Break Code (0785342786958): Greg Hoglund, Gary McGraw. Security Warrior  Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. The image on the cover of Security Warrior is a group of Sumo wrestlers. Sumo is the traditional national sport of Japan. An origin myth about Japan tells how the god Take-Mikazuchi won dominion over the Japanese islands in a Sumo match. Since then, Sumo wrestling has been an integral part of ancient religious ceremonies and was an important entertainment for the Imperial Court in the 1600s, when it became a professional sport. Sumo is one of the oldest martial arts; Judo and Jujitsu derive throws and techniques from Sumo wrestling. Before a match, the athletes march in procession around the ring wearing heavy ceremonial skirts embroidered with their symbols.

There are six Grand Sumo tournaments (basho) a year. Reversing: Secrets of Reverse Engineering. Desquirr :: Desquirr (2002) November 13, 2003 Binary for IDA Pro 4.6 kindly contributed by Joe Stewart. No code improvements. May 7, 2003 Binary for IDA Pro 4.5. No code improvements. October 21, 2002 Early support for ARM machine code and a binary for IDA Pro 4.3 June 20, 2002 Desquirr is now available for download! Desquirr is a decompiler plugin for Interactive Disassembler Pro.

It is currently capable of simple data flow analysis of binaries with Intel x86 machine code. This program is currently under development. See Downloads for documentation, binary and source code. Divide and Conquer · Esagila · 2GooD · Både för ordvrängare och vanligt folk! Decompilation Possible. Program-Transformation.Org: The Program Transformation Wiki Almost every week requests for decompilation programs are made in newsgroups (like comp.lang.c), and these are usually replied with: It is not possible!

People claim that decompilation is similar to converting a hamburger back into a cow, or unscrambling an omelette back to an egg. Here is a typical FAQ entry from C++-FAQ-Lite, and my refutation of it. Also BobStoutOnDecompilation and its refutation. People even write tech reports on the subject. They are far from the truth. Certainly, fully automated decompilation of arbitrary machine-code programs is not possible -- this problem is theoretically equivalent to the Halting Problem, an undecidable problem in Computer Science.

However, many useful algorithms have this sort of theoretical limitation. Disassembling It may even be possible for a decompiler to automatically (i.e. with no human input) decompile a large fraction of real-world machine code programs. The processor Results. Revenge: Research into Reverse engineering and decompiling. CGEN. CGEN (pronounced seejen) is a framework for developing generators of CPU-related tools such as assemblers, disassemblers and simulators. It specifies a description language for describing the architecture and organization of a CPU without reference to any particular application. Additional applications can be written within the framework. CGEN is written in Scheme and can be run under the GNU Guile interpreter. It is placed under a free software license. News October 18, 2009: CGEN 1.1 is released Yeah, it's been awhile.

July 28, 2000: CGEN 1.0 is released This is the first release of CGEN. Documentation A snapshot of the CGEN manual is available as hypertext. The self-service CGEN Faq-O-Matic pages is available for adding your questions and answers. Wiki See the wiki here. Availability If you are not doing active development on CGEN, you should get the latest official release. You can access the development source tree a couple of different ways. Anonymous CVS read-only access CVS snapshots cgen. Njmc Tk. Decompilation Resources. [38] Compiler dependencies  Updated!  Bob Stout Refutation. Program-Transformation.Org: The Program Transformation Wiki This page is my refutation of a Frequently Asked Question answer on decompilation.

The original page is difficult to find now in its complete form, so I have archived it here. As with the other refutation page, I sincerely mean no disrespect to Bob Stout, Jeremy Coffin, or other commentators. This sort of attitude to decompilation is unfortunately common. Ultimately, the naysayers may be correct in a very broad sense, i.e. it may be that machine code decompilers will never be easy enough to use to become mainstream. However, they are wrong in many technical details, so I'll use this opportunity to correct the facts. The reader can decide whether machine code decompilation will eventually become useful to them. Text from the FAQ answer (the text I'm refuting) will appear in red ; my refutation will be in ordinary text. G.3.17 decompil.txt +++Date last modified: 05-Jul-1997 Question: Answer: Don't hold your breath.

Agreed. While (EOF ! Impossible To Decompile. Program-Transformation.Org: The Program Transformation Wiki There may be a few machine code patterns that are impossible to decompile automatically. These would therefore require expert human intervention to decompile successfully. There are features such as the original comments, variable names and function names that can never be recovered, although very powerful analyses may be able to suggest good (perhaps even better than the original, in some cases) alternatives. These unrecoverable features are not the aim of this page, since correct decompilations can be generated (even if usually less readable that the original) without recovering the original comments or names.

Reference combined with casts This is an example of a machine code pattern that initially I thought was not decompilable automatically. However, correct, if less readable, code is possible with an automatic decompiler. Consider a reference to a memory variable. Binary Translation. Program-Transformation.Org: The Program Transformation Wiki What is binary translation Binary tanslation is the process of automatically translating binary object code from one machine Mi to another. The machines are normally different. Binary translation either takes place at software or hardware level. There are three ways, which binary translation may take place, ranging from the most difficult to more easy translation: Translation of applications by software: - If the machines and the operating systems are different. . - If the machines are different, but supports the same operating system.

Translation of operating systems by software: - If the machines are different and we want the object code for the source machine to run on the target machine. In the latter case, we also meet translation of operating systems by hardware, like DAISY and BOA. Another area, which is mistakenly supposed to be binary translation is, if the machines are the same and support different operating systems. Links. Antique Software: Turbo C version 2.01. Decompilation. Decompilation is the reverse process of compilation i.e. creating high level language code from machine/assembly language code. At the basic level, it just requires to understand the machine/assembly code and rewrite it into a high level language, but things are not as simple as they seem, particularly when it comes to implementing a decompiler.

Throughout this discussion, we will be using the C language for the high level language, and the 8086 assembly language for the low level language. The ethics of decompilation Is decompilation legal, and is it allowed? There are many situations when decompilation can be used... To recover lost source code. Usually all software are copyrighted by the authors. In all practical purposes, decompiling programs which were created by you can't be questioned! Is decompilation possible? Let's take a look at a normal C compiler. However, things are a bit different if any compiler optimizations are used while building the original executable. 1. 2. 3. DisC - Decompiler for TurboC. DisC is a decompiler for the TurboC compiler. It can interpret a DOS executable file generated by the TurboC compiler and give you a C-language program which functions similarly. Please note that that this is a decompiler specific for the TurboC compiler and not others, since most of the logic used by the decompiler to interpret the machine code is specifically tailored for the TurboC compiler.

Trying it out on executables generated by other compilers will NOT give expected results. Features Complete recursive decompilation of the executable, including all functions which are called. Features not implemented (and which i wanted to implement...) Does not recognize floating point code. History DisC started as a timepass project when i was in my undergraduate studies. Under the Hood So what is this DisC doing? Structured code When compiling, all high level constructs like "if", "for", "while", "do... while" etc... are translated to branches and then code is generated by the compiler. Downloads. Do Di. Program-Transformation.Org: The Program Transformation Wiki Hans-Peter Diettrich, better known as DoDi, is author of a well-known set of Visual Basic decompilers (VBDis 3/4/5), and has worked on decompilers for executables as well. In 1986 he bought his first Atari ST and then wrote disassemblers and C-decompilers for several compilers and systems (TOS, UH-Pearl, Amiga DOS and HPUX).

The decompilers all worked well, also for the GFA Basic on the ST. But he never released these programs, because he detest software piracy. In 1994 he found that MS had put the sources into the executables compiled with VB3, and because MS didn't respond to his questions, he decided to publish a simple decompiler to make this fact known to every programmer. This resulted in the VBDis3 decompiler. He has apparently completed decompilers for VB4 and VB5, but these are nowhere near as complete (in the decompilation sense) as the one for VB3. CategoryDecompilation. Kevin Quitt. Program-Transformation.Org: The Program Transformation Wiki Kevin D.

Quitt wrote the following, about his compiler specific approach: The executable has to be examined to see if it's a compressed executable (like what PKLITE does) and if so, it has to be uncompressed. Or just exclude that type of executable, with information for the user. Check the copyright notice to verify the compiler and version are correct. A single- version decompiler could be expanded to multiple versions of the same compiler by using files containing the critical data for each--but let's work on that later.

Although he thinks that dcc will be better than exec-2-c, he doubts whether their approach will lead to better results than his, both with respect to reconstructing the original work-flow, and with respect to reconstructing the data type information. CategoryDecompilation. Dis Assembly. Program-Transformation.Org: The Program Transformation Wiki Disassembly is the process of translating an executable program into its equivalent assembly representation. The greatest problem with disassembling is determining what is code (instructions) and what is data, as both are represented in the same way in current machines. Further, disassembly is equivalent to the Halting Problem and hence cannot be fully automated for all input programs.

This page contains information about various commercial, shareware and freeware disassemblers, and tools for building disassemblers. Because of the relative immaturity of machine code decompilation, it is presently the case that for large, commercial reverse engineering projects, a good disassembler is probably a better option than a decompiler. IDA Pro. Possibly obsolete products WDASM 1.7b: Windows Disassembler Program. CategoryDecompilation. Asm 21 To C. XACT. Relipmo C. Ferma T. Fermat Transformation System. Assembly Decompilers. Program-Transformation.Org: The Program Transformation Wiki Decompilation from assembly language is easier than decompiling native executable (machine code) programs, but harder than decompiling programs compiled to virtual machines (Java or .NET bytecodes, for example). The main difference is that assembly language programs have code separated from data. There are often strong hints about the types of data elements as well (e.g. a floating point location could be initialised to a floating point value).

Also of course, comments and the names of variables and procedures can be transferred to the decompiled program. Assembly language decompilation could be viewed as a source to source translation or program transformation. The Fermat Transformation System The RelipmoC i386 to C decompiler XACT Assembly Language to C Transformation Asm21ToC ADSP-21xx to C decompiler The Interactive Decompiler CategoryDecompilation. Decompilation Compiler Specific. Program-Transformation.Org: The Program Transformation Wiki This approach tries to find the reverse mapping of the executable to the source based on analysing the output generated by a specific compiler. This will usually give better results with respect to generating source code that resembles the original source code.

This approach is limited in the sense that a decompiler has to be constructed for each individual compiler. KevinQuitt's approach. DoDi (Hans-Peter Diettrich, author of VBDis 3/4/5) The Royal Holloway University of London has a Analog Devices ADSP-21xx assembly language to ANSI-C "reverse compiler". See Asm21ToC. Disinformation Decompiler for Infocom interactive fiction games. CategoryDecompilation. Program-Transformation.Org. The Program Transformation Wiki Program transformation techniques are used in a many areas of software engineering ranging from program synthesis, via program optimization and program refactoring, to reverse engineering and documentation generation.

Many theories, tools and applications have been developed over the last 30 years. Often the results of these efforts are used only in the community that developed them. Program-transformation.org is dedicated to collecting, organizing and disseminating information about all aspects of program transformation in order to share results across communities. Such an effort cannot possibly be achieved by a static web site. Therefore, this site is based on TWiki, a system for collaborative web development. Entry Points There are a number of EntryPoints that focus on specific aspects of program transformation.

Categories Another way to browse the pages is by considering the various categories. CategoryCategory: full list of all categories Collections. The Decompilation Wiki. Automatic Decompiler.