Description of the project:
Assembly Dissection Tool is a Reverse Engineering Final Year Project developed by using C#.Net with which we can construct a class diagram by supplying a CLR dll. This project takes a dll or an exe file as an input and analyses to construct tree view with all classes in that dll as nodes.
• Opening a file
• Determining if a file is a valid CLR type
• Creating the tree structure and classes
• Individual Class Analysis (Reflection)
• Type configurability
• Drawing the diagram
• Save support
• Print support
• Controls module: deals with developing GUI controls, user controls.
• Analyzer module: deals with reading the meta data from a dll or exe and generating list of data members and member functions.
• Helper module: deals with providing zoom, save and print support.
o Microsoft .Net framework 2.0
o Microsoft C#.Net language
o Microsoft Visual Studio 2005 IDE
Modules and functionalities
1. Main Module
a. Form About.
b. Form Main.
c. Form Save
d. Form Settings.
e. Form Zoom
f. InputBox Dialog
Student training methodology
a. Template design
o At the time of training we will discuss the flow modules wise and ask them to design rough/draft templates
b. UML diagrams
Auto Diagrammer Features are:
• Opening a File
• Determining If a File Is A Valid CLR Type
• Create the Tree and Classes
• Should Type Be Included
• Individual Class Analysis (Reflection)
• User Selects Which Classes Should Be Shown On Diagram
• Customizing what’s shown on the Diagram
• Saving a Diagram
• Printing support
a. Design the Form main with tool strip controls
b. Write a code for opening a dll in the existing Computer(by using open file dialog control)
a. Check the opened file is dll or not.
b. check the open dll is clr type or not if not provide a warning message to the user
c. If provided dll is clr type dll then add that in to add type tree.
a. Write a method to get list of class present in the dll.
b. Write a code such that all the classes, constucters and methods should be formatted in a tree structure.
c. write a functionality ,such that if user don’t select any class in the name space, by default it should select the all classes present in the class.
d. Write a functionality to draw the class diagram with contain all the methods and fields properties etc..,
a. By using zoom method we have to zoom the diagram. (By clicking zoom button)
b. write a functionality to get the different types of zoom s like (25%,50% ) .
c. write a functionality to user enter the specific zoom level
a. Write functionality for saving a image in the user system. (By clicking save button use save file dialog box control) image should be stored in different type of format like .bmp, .jpeg, .gif etc
b. Write a functionality to take a print of the class diagram. (Using print file dialog box)*(by clicking print button)
a. write a functionality such that the user can select his required methods, interface, fields
b. Write the functionality to select the back ground start color, classes color
c. Write a functionality to select the hide and open tree view
d. Write functionality to the help menu.
Classes and controls used in Assembly Decision tool
- Open file dialog control: This control is used to open a file in the system.
- Menu strip control: This control is used to set the all the desired fields on the top of the menu bar.
- Tool tip control : It is used to bind the values or buttons to the menu strip control ( For ex in if we take file menu when we click on this a drop down list comes and we have open file, save file all this comes under this tool tip control)
- Print Document: It is used to print the document.
- Print Dialog: This control is used to display a dialog box that enable user to print option for the user.
- Status strip: Display info to the user about the object viewed, object components (here we use this control for progress bar).
- Tool tip: Used to display info when mouse moves a pointer over an associate control.
- Save file dialog: It displays a dialog box that promotes a user to select location for saving a file.
- In this form we use tool tip control.
- Here we use menu strip.
Classes used in this project:
- File info: This class provides instance method to create, delete, and opening file. For this he is passing open file dialog as a parameter after this he is calling the garbage collector to collect the us.
- In process file he process the file using DotNetObject class. In dot net object class is used to check weather the given dll is system type or not.
- Background worker: This class is used to execute an operation on separate thread. In this class he wrote the background color of the page, this is executed when the page is loaded.
- Draw Diagram: Here we should assign a tree view node to tree view control and we should call render panel control in render panel, write code such if there is at least 1 required class for diagram or select them all.
- He created list and to that he getting all the classes which are to be drawn, get the list of all drawable classes from the static method Namespace.cs, and create a new panel, add these drawable class control one by one to panel. Final after completing show panel.
- Zoom: in this class we use the Bitmap classes. In Bitmap class we use the get Bitmap For Control method in this he is getting all the classes need to draw height,width of the diagram and return the bitmap type after get this the user assign the value to the frmzoom Currentimage.
- Save Diagram: Here the user provides different types of save options like .gif, .bmp etc.., which Image Format should now be used, we have to write a code. Then he assigns all formats to imgformat object and calls the garbage collector.
- Save the image, however if we are saving the image to the save file name the Bitmap object maintains a lock on the physical file, so we need to use another dummy Bitmap to hold the original image, so that the lock creates by the original image saving process can be released, then we can save the dummy Bitmap contents back to the original image and conduct the save.
Then he calls the render plan to build the list of the class then he save the image.
- Print: in this he is using the getBitmapForControl method in this method in this method he is assign the height, width ,background color pnl set Location and size then he is calling renderpanel () method to build the list of class to be drawn then he is calling some event handler with passing the parameter as the bitmap image then he print the image with the help of printer controls
- Exit: Here the user exist from the application, he is using the static class concept
- Settings:Here he is calling the process file method he check there it’s a valid clr type or not and it’s a system type
- Show or Hide:Here the user if its true the treeview control should be shown here the form resize should be done with resize method
- Help: Here we are calling the From about c\form that is a static form