1 of 36

Reverse Engineering

Computer Science

D.I.A.T.M.

2 of 36

Introduction �To�Reverse Engineering

By, Sonal Pravin

3 of 36

Contents

  • What is Reverse Engineering (RE)?
  • Why do we need Reverse Engineering?
  • Scope and Tasks of Reverse Engineering
  • Different Approaches
  • RE tools
  • Conclusions

4 of 36

What will happen ?

  • You have an unexpected case:
    • You finished one course project using Java
    • Your program runs OK
    • But, by accident, you delete the java file

5 of 36

What will happen ?

  • You have an unexpected case:
    • You finished one course project using Java
    • Your program runs OK
    • But, by accident, you delete the java file

  • Solution is “Reverse Engineering

6 of 36

What is Reverse Engineering?

  • RE encompasses any activity that is done to determine how a product works, to learn the ideas and technology that were used in developing that product.
  • RE can be done at many levels
  • RE generally belongs to Software Maintenance

7 of 36

Forward Engineering �And�Reverse Engineering

By, Puja kumari

8 of 36

What is Forward Engineering ?

Waterfall Model of software development

Requirement

Analysis

Design

Implementation

Testing and

Maintenance

9 of 36

Forward Engineering

Forward Engineering

Requirements

Design

Source Code

Testing & Maintenance

10 of 36

Forward Engineering Vs� Reverse Engineering ?

Forward Engineering

Reverse Engineering

Requirements

Design

Source Code

Testing & Maintenance

11 of 36

Concept of Abstraction System

Abstraction System

Old system

New System

Forward Engineering

Re-Implementation

Reverse Engineering

Abstraction

12 of 36

Why do we need RE ?

  • Recovery of lost information
    • providing proper system documentation
  • Assisting with maintenance
    • identification of side effects and anomalies
  • Migration to another hw/sw platform
  • Facilitating software reuse

13 of 36

Benefits, Difficulties & Scope of�Reverse Engineering

By, Ayan Pradhan

14 of 36

The Early Days of RE

  • Law of Software Revolution (Lehman, 1980)
  • Fundamental strategies for program comprehension (Brooks, 1983)
  • Taxonomy of Reverse Engineering (Chikofsky &Cross, 1990)
  • WCRE (Working Conference on R.E., 1990)

15 of 36

Benefits of Reverse Engineering

  • Benefits
    • maintenance cost savings
    • quality improvements
    • competitive advantages
    • software reuse facilitation

16 of 36

Difficulties of Reverse Engineering

  • Gap between problem

/solution domain

  • Gap between concrete

and abstract

  • Gap between coherency/disintegration
  • Gap between hierarchical/associational

17 of 36

Scope and Task of Reverse Engineering

  • program understanding

Problem/Application

domain

Program/Implemen.

domain

Mapping

18 of 36

Scope and Task of Reverse Engineering

  • Redocumentation and/or document generation
  • Recovery of design approach and design details at any level of abstraction
  • Identifying reusable components and components that need restructuring
  • Recovering business rules
  • Understanding high-level system description.

19 of 36

Discovery of Abstraction & Different Approaches� of Reverse Engineering

By, Sweta Sangam

20 of 36

Discovery of Abstraction

  • Discovery of abstraction in large system
    • Maintenance purpose
    • Evolution purpose
    • Re-Engineering purpose

21 of 36

Levels of abstractions

  • Application
    • Application concepts, business rule, policies
  • Function
    • Logical and functional specification, non-functional requirement
  • Structure
    • Data and control flow, dependency graphs
    • Structure and subsystem charts
    • Architectures
  • Implementation
    • Symbol tables, source text

22 of 36

Different Approaches

  • Restructuring
    • Transformation from one representation to another at the same level,

Requirements

Design

Source code

Behavior

23 of 36

Different Approaches

  • Reverse Engineering
    • Design Recovery
      • reproduce all the info for understanding the system
    • Re-documentation
      • provide different views of the system
  • Re-Engineering
    • first phase --understanding the system
    • second phase--forward engineering

24 of 36

Different Approaches

Abstraction System

Old system

New System

Forward Engineering

Re-Implementation

Reverse Engineering

Abstraction

25 of 36

Practical Implementation�& Tools of �Reverse Engineering

By, Debdeep Kundu

26 of 36

Reverse Engineering Tools

  • Analysis Tools
  • Browsers
  • Object Server
  • Task Oriented Tools

27 of 36

Example--Java Decompiler

  • How to recover bytecode from .class file under Unix/Win with JDK?

% javap -c <filename>

% javap -help (to see the options)

  • Java Decompilers
    • ”ClassCracker” http://www.pcug.org.au/~mayon/
    • “DeCafe Pro" from DeCafe, France at http://decafe.hypermart.net/index.htm
    • “SourceAgain" from Ahpah corp at http://www.ahpah.com

28 of 36

Example--Java Decompiler

  • ClassCracker 2 Interface

29 of 36

Example--Java Decompiler

  • Components of ClassCracker 2
    • Java decompiler
      • retrieves Java source code from Java class files
    • Java disassembler
      • produces Java Assembly Code
    • A Java class file viewer
      • displays Java class file structures.

30 of 36

Example--Java Decompiler

  • Features of ClassCracker 2
    • User visual interface.
    • Can decompile class files within zip or jar files.
    • Conversion mode (JAVA, JASM or JDUMP) is selectable
    • A Batch Mode allows multiple class files to be decompiled simultaneously
    • more…...

31 of 36

Example--Java Decompiler

  • ClassCracker 2 System Requirements
    • All platform (Window/ Linus /Unix)
    • JDK /JRE

  • Do not believe it?
    • From myClass_origin.class ==>myClass.java
    • % javac myClass.java (==>myClass.class)
    • % diff myClass.class myClass_origin.class

32 of 36

Example--Java Decompiler

  • ClassCracker 2.0--want to try it?
    • Free download at http://www.pcug.org.au/~mayon/classcracker/ccgetdemo.html
    • Only first three methods are decoded.

  • Bridge 1.0---Free
    • http://www.geocities.com/SiliconValley/Bridge/8617/jad.html

33 of 36

Conclusions

  • Reverse Engineering is a new research area among software maintenance
  • RE includes activities of understanding the system and recovery info from system
  • Program understanding is the most important subset of Reverse Engineering
  • Discovery of abstraction is key issue

34 of 36

References

  • http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764574817.html
  • http://www.google.com
  • - http://jode.sourceforge.net

35 of 36

THANK YOU

36 of 36

Questions ?