Category: Education

Presentation Description

No description available.


Presentation Transcript

Slide 2: 

DECOMPILER By SIDRA RIFFAT 2007-ag-892 M.Sc. Computer science Supervisor Mr.Tasleem Mustafa


COMPILER A compiler is computer program that translate high level language into low level language. The original sequence is usually called the source code and the output called object code. A program that translate between high-level languages is called language translator or language converter.

Reverse engineering : 

Reverse engineering Reverse engineering one of the important development in the flied of computer sciences. It’s convert the information from a low-level format (that is only readable for computer) to higher level format . Example Disassemblers Decompiler

DeCompiler : 

DeCompiler A Program which translate low level language into high level language called decompiler. Example: Assembly language Machine language Decompilation is the process of converting machine-executable code into a high-level language. There are several reasons do this, such as checking software, translating between different source languages, and recovering the lost source code.

Ethics Of Decompiler : 

Ethics Of Decompiler Recovery of lost source code (by accident or via a disgruntled employee), Migration of applications to a new hardware platform, Translation of code written in obsolete languages not supported by compiler tools nowadays. Recovery of Someone else source code. Determination of existence of virsus.


DECOMPILER PHASES Loader Disassembly Idioms Program analysis Type analysis Structuring Code generation

Loader : 

Loader The first phase of decompilation is loader. It should be able to identify basic facts about the input program, such as the architecture (Pentium, Power PC, etc), and the entry point. Some time the loader should be able to find the equivalent function of the main function of a C program.

Disassembly : 

Disassembly The next logical phase of decompiler series is the disassembly of machine code instruction into a machine independent intermediate representation (IR). For example, the Pentium machine instruction mov eax, 3 add eax, 4 might be translated to the IR eax := a[3+4];

idioms : 

idioms The third phase is idioms, the sequence of code whose combined semantics not immediately apparent from the instructions' individual semantics is called idiomatic sequence. These individual semantics is a part of the disassembly phase, or as part of later analyses, these idiomatic sequences need to be translated into known equivalent IR.

Programme Analysis : 

Programme Analysis Various program analyses can be applied to the IR. In particular, expression propagation combines the semantics of several instructions into more complex expressions.

Type Analysis : 

Type Analysis A good machine code decompiler will perform type analysis.The way registers or memory locations are used result in constraints on the possible type of the location. For example, An instruction implies that the operand is an integer. programs do not use such an operation on floating point values on pointers. add instruction results in three constraints, since the operands may be both integer, or one integer and one pointer (with integer and pointer results respectively; the third constraint comes from the ordering of the two operands when the types are different).

Structuring : 

Structuring The decompilation phase involves structuring of the IR into higher level constructs such as while loops and if/then/else conditional statements. For example, the machine code Unstructured code is more difficult to translate into structured code. Solution include some replication code. Or adding boolean variable.

Code Generation : 

Code Generation The final phase is the generation of the high level code in the back end of the decompiler. Just as a compiler may have several back ends for generating machine code for different architectures, a decompiler may have several back ends for generating high level code in different high level languages. The user may want to change structural aspects, such as converting a while loop to a for loop. These are less readily modified with a simple text editor.

Slide 15: 


authorStream Live Help