Software Construction and Evolution CSSE 375 Reverse Engineering

  • Slides: 21
Download presentation
Software Construction and Evolution - CSSE 375 Reverse Engineering Tools and Techniques Shawn &

Software Construction and Evolution - CSSE 375 Reverse Engineering Tools and Techniques Shawn & Steve Left – Reengineering from the competition can be seen as theft!

Using: SW Reengineering Techniques v Reverse Engineering / Redocumentation /Design Recovery Requirements eer gin

Using: SW Reengineering Techniques v Reverse Engineering / Redocumentation /Design Recovery Requirements eer gin En se ver Software Salvaging Re v eer Migration gin v Physical Design En Conversion rd v Architecture wa Restructuring /Refactoring For v Implementation Recall the Famous “U” 2

Extracting Info from Software Q 11

Extracting Info from Software Q 11

Visualizing Static Models Examine static structure, architecture l Relationships between software artifacts Visualization: l

Visualizing Static Models Examine static structure, architecture l Relationships between software artifacts Visualization: l l l Class diagrams Hierarchical graphs Program Dependence Graphs (PDG) Q 12 4

Reverse Engineering Tool: Rigi View 1 These tools use “Rigi standard format” to store

Reverse Engineering Tool: Rigi View 1 These tools use “Rigi standard format” to store relationships about a system. Like, “call main printf” to record that “main” has a dependency on the printf function. 5

Rigi View 2: Show By Class 6

Rigi View 2: Show By Class 6

Rigi View 2: Show By Class (2) 7

Rigi View 2: Show By Class (2) 7

Visualizing Dynamic Models v Examine run-time behavior of software l v Debugger, profiler, source

Visualizing Dynamic Models v Examine run-time behavior of software l v Debugger, profiler, source code instrumentation Visualization: l l l Scenarios (sequence diagrams, activity diagrams) State diagrams Animations Q 13 8

j. GRASP http: //www. jgrasp. org/ Control Structure Diagram Data Structure Diagram UML Class

j. GRASP http: //www. jgrasp. org/ Control Structure Diagram Data Structure Diagram UML Class Diagram

j. GRASP Environment 10

j. GRASP Environment 10

Reverse Engineering: Alias “Reversing” “If you think Reverse Engineering Design from Java is hard,

Reverse Engineering: Alias “Reversing” “If you think Reverse Engineering Design from Java is hard, abstracting up from binary is near impossible!” Shawn “However, don’t count on the fact that hackers can’t do it!” Steve

Software “Reversing” v Reversing is dissecting a program and examining its internals v Common

Software “Reversing” v Reversing is dissecting a program and examining its internals v Common applications of Reversing in the software industry to recover the source code of a program because: l l l Source code/documentation was lost Need to find how the program does particular operations Need to improve the performance of a program Need to fix a “bug” Need to identify a security vulnerability / malware Q 14 12

Model of Reversing Hard, but doable if the conditions are good. Really hard, and

Model of Reversing Hard, but doable if the conditions are good. Really hard, and traction is mostly when small segments or simple situations are attempted. Q 15 13

Hex Editors v Hex editors read executing programs from RAM v Display their contents

Hex Editors v Hex editors read executing programs from RAM v Display their contents in hexadecimal code v Enable the editing of the running hexadecimal code Hex Editors RAM Editor Data Recovery Tools Win. Hex x x Tsearch x RAM Disassembler x

Hex Editors: Win. Hex 15

Hex Editors: Win. Hex 15

Decompilers v Decompile a binary programs into readable source code v Replace all binary

Decompilers v Decompile a binary programs into readable source code v Replace all binary code that could not be decompiled with assembly code Executable Decompiler Source Code Q 16

Decompilers: REC 17

Decompilers: REC 17

Disassemblers/Debuggers: Olly. Dbg 18

Disassemblers/Debuggers: Olly. Dbg 18

Legal Issues: Interoperability v Exposed software interfaces allows development of interoperable software that runs

Legal Issues: Interoperability v Exposed software interfaces allows development of interoperable software that runs on the platform v Legal case: Sega vs. Accolade l Ruled in favor of Accolade as they did not violate code copyright of Sega 19

Legal Issues: Competition v v Opponents of software reversing claim that it stifles innovation

Legal Issues: Competition v v Opponents of software reversing claim that it stifles innovation Illegal l l v Quite provable: directly stealing code Hard to prove: decompiling programs and recompiling them to generate a different, but functionally equivalent binary Legal l Reversing small parts of a product to gather information, not code Then develop code independently Funny how scale and independence plays such a role… Q 17 20

Legal Issues: Copyright Law v Copyright violation: directly copy protected code sequences from the

Legal Issues: Copyright Law v Copyright violation: directly copy protected code sequences from the competitor’s product into you own product v Some have claimed that intermediate copies during RE decompilation violates copyright v If the final product does not contain anything that was directly copied from the original product, copying is considered fair use 21