80 likes | 185 Views
CS675 Software Reverse Engineering Sadia Afroz, Omar Badran, Dan Moyer. Lab 2 Presentation Bytecode Analysis of a Java Application. MDG and Reachability Scripts. The scripts produce an MDG and Graphiz file from the XML/ODEM output file of CDA
E N D
CS675 Software Reverse EngineeringSadia Afroz,Omar Badran, Dan Moyer Lab 2 Presentation Bytecode Analysis of a Java Application
MDG and Reachability Scripts • The scripts produce an MDG and Graphiz file from the XML/ODEM output file of CDA • One script does all operations based on the command line arguments • The script generates the mdg and gv file for the full JES application as well as the appropriate mdg and gv file based on the 3rd and 4th arguments • Command line format has 4 arguments • genMDG [in file] [out file] [uses|uses+|usedBy|usedBy+] [class list] • The class list is comma delimited
Script that Creates MDG and Graphviz files • Creates MDG file with simple bigrams • Left class is the calling class • Right class is the dependant class • The Graphviz file has some added syntax: • Type of graph • Curly braces • Double-quotes(“”) and arrows (->) • Demo
MDG Explanation • Mail calls all other classes • Considered the “Main” class • ShutdownService • the only class that calls back
Reachability • uses: Takes as input a list of one or more class names and returns the MDG that only contains the classes listed in the input and the classes that they use (directly). So the MDG should be a set of trees (i.e., a forest) where each tree is of height 0 (if a class does not use any other class) or 1 (if a class uses one or more other classes). • uses+: Same as the uses script, except it computes the transitive uses relations. So the MDG should be a set of trees of arbitrary height. • usedBy: Takes as input a list of one or more class names and returns the MDG that only contains the classes listed in the input and the classes that use them (directly). So the MDG should be a set of trees (forest) of height one. • usedBy+: Same as the usedBy script, except it computes the transitive usedBy relations. So the MDG should be a set of trees of arbitrary height.
MDG Subset of JES The following is one interesting MDG subset generated using the UsedBy+ for the EmailAddress class.