Presentation is loading. Please wait.

Presentation is loading. Please wait.

Reverse Engineering Computer Science Computer Science University of Windsor University of Windsor Shaochun Xu.

Similar presentations


Presentation on theme: "Reverse Engineering Computer Science Computer Science University of Windsor University of Windsor Shaochun Xu."— Presentation transcript:

1

2 Reverse Engineering Computer Science Computer Science University of Windsor University of Windsor Shaochun Xu

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

4 What is Reverse Engineering ? What is Reverse Engineering ? b b You have an unexpected case: You finished one course project using Java Your program runs OK But, by accident, you delete the java file How to hand in your project?

5 What is Reverse Engineering ? What is Reverse Engineering ? b b You have an unexpected case: You finished one course project using Java Your program runs OK But, by accident, you delete the java file How to hand in your project? b b Reverse Engineering

6 What is Reverse Engineering ? What is Reverse Engineering ? Waterfall Model of software development Requirement analysis design Implementation Testing and Maintenance

7 What is Reverse Engineering ? What is Reverse Engineering ? Forward Engineering Requirements Design Source Code Behavior

8 What is Reverse Engineering ? What is Reverse Engineering ? Forward EngineeringReverse Engineering Requirements Design Source Code Behavior

9 What is Reverse Engineering ? What is Reverse Engineering ? Abstraction System Old systemNew System Forward Engineering Re-Implementation Reverse Engineering Abstraction

10 What is Reverse Engineering? b b 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. b b RE can be done at many levels  Software Maintenance  RE generally belongs to Software Maintenance

11 The Early Days of RE b b Law of Software Revolution (Lehman, 1980) b Fundamental strategies for program comprehension (Brooks, 1983) b Taxonomy of Reverse Engineering (Chikofsky&Cross, 1990) b WCRE (Working Conference on R.E., 1990)  IWPC (Int. Workshop on Program Comprehension)

12 Why do we need RE ? Why do we need RE ? b b Recovery of lost information providing proper system documentation b b Assisting with maintenance identification of side effects and anomalies   Migration to another hw/sw platform   Facilitating software reuse

13 Why do we need RE ? Why do we need RE ? b b Benefits maintenance cost savings quality improvements competitive advantages software reuse facilitation

14 Difficulties of Reverse Engineering b b Gap between problem /solution domain b b Gap between concrete and abstract b b Gap between coherency/disintegration b b Gap between hierarchical/associational

15 Scope and Task of Reverse Engineering b b program understanding Problem/Application domain Program/Implemen. domain Mapping

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

17 Discovery of Abstraction b b Discovery of abstraction in large system maintenance purpose evolution purpose reengineering purpose

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

19 Different Approaches Different Approaches b b Restructuring Transformation from one representation to another at the same level,Transformation from one representation to another at the same level, Requirements Design Source code Behavior

20 Different Approaches Different Approaches b b Reverse Engineering Design Recovery – –reproduce all the info for understanding the system Re-documentation – –provide different views of the system b b Re-Engineering first phase --understanding the system second phase--forward engineering

21 Different Approaches Different Approaches Abstraction System Old systemNew System Forward Engineering Re-Implementation Reverse Engineering Abstraction

22 Reverse Engineering Tools b b Analysis Tools b b Browsers b b Object Server b b Task Oriented Tools

23 Example--Java Decompiler b b How to recover bytecode from.class file under Unix/Win with JDK? % javap -c % javap -help (to see the options) b b Java Decompilers http://www.pcug.org.au/~mayon/”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

24 Example--Java Decompiler b b ClassCracker 2 Interface

25 Example--Java Decompiler b b Components of ClassCracker 2 Java decompiler Java decompiler –retrieves Java source code from Java class files Java disassembler Java disassembler –produces Java Assembly Code A Java class file viewerA Java class file viewer –displays Java class file structures.

26 Example--Java Decompiler b b Features of ClassCracker 2 User visual interface.User visual interface. Can decompile class files within zip or jar files.Can decompile class files within zip or jar files. Conversion mode (JAVA, JASM or JDUMP) is selectableConversion mode (JAVA, JASM or JDUMP) is selectable A Batc Mode allows multiple class files to be decompiled simultaneously A Batc Mode allows multiple class files to be decompiled simultaneously more…...more…...

27 Example--Java Decompiler b b ClassCracker 2 System Requirements All platform (Window/Linus/Unix) JDK /JRE b b Do not believe it? From myClass_origin.class ==>myClass.java % javac myClass.java (==>myClass.class) % diff myClass.class myClass_origin.class

28 Example--Java Decompiler b b ClassCracker 2.0--want to try it? http://www.pcug.org.au/~mayon/classcracker/ ccgetdemo.htmlFree download at http://www.pcug.org.au/~mayon/classcracker/ ccgetdemo.html Only first three methods are decoded.Only first three methods are decoded. b Bridge 1.0---Free http://www.geocities.com/SiliconValley/Brid ge/8617/jad.htmlhttp://www.geocities.com/SiliconValley/Brid ge/8617/jad.html

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

30 Questions ? Questions ?


Download ppt "Reverse Engineering Computer Science Computer Science University of Windsor University of Windsor Shaochun Xu."

Similar presentations


Ads by Google