Reverse Engineering Computer Science Computer Science University of Windsor University of Windsor Shaochun Xu
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
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?
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
What is Reverse Engineering ? What is Reverse Engineering ? Waterfall Model of software development Requirement analysis design Implementation Testing and Maintenance
What is Reverse Engineering ? What is Reverse Engineering ? Forward Engineering Requirements Design Source Code Behavior
What is Reverse Engineering ? What is Reverse Engineering ? Forward EngineeringReverse Engineering Requirements Design Source Code Behavior
What is Reverse Engineering ? What is Reverse Engineering ? Abstraction System Old systemNew System Forward Engineering Re-Implementation Reverse Engineering Abstraction
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
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)
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
Why do we need RE ? Why do we need RE ? b b Benefits maintenance cost savings quality improvements competitive advantages software reuse facilitation
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
Scope and Task of Reverse Engineering b b program understanding Problem/Application domain Program/Implemen. domain Mapping
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.
Discovery of Abstraction b b Discovery of abstraction in large system maintenance purpose evolution purpose reengineering purpose
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
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
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
Different Approaches Different Approaches Abstraction System Old systemNew System Forward Engineering Re-Implementation Reverse Engineering Abstraction
Reverse Engineering Tools b b Analysis Tools b b Browsers b b Object Server b b Task Oriented Tools
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
Example--Java Decompiler b b ClassCracker 2 Interface
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.
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…...
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
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
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
Your consent to our cookies if you continue to use this website.