Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Reverse engineer C++ using Rational Rose

Posted on 2001-06-21
1
Medium Priority
?
632 Views
Last Modified: 2010-04-17
How to reverse engineer C++ code using Rational Rose?
Example will be helpful.
0
Comment
Question by:C_Sharp
1 Comment
 
LVL 4

Accepted Solution

by:
prashant_n_mhatre earned 920 total points
ID: 6216050
You can use Rational Rose C++ Analyzer for this purpose.
This is a standard example. I have simplified it to show how to reverse engineer two header files, propel.h and move.h.
 
Create the propel.h and move.h files Using any Editor.
This how you can create it in Visual Studio.

To do this in Visual Studio, open up Microsoft C++.
First select from the menu bar File->New. Select the
Workspaces tab.  Enter the name of your workspace and click <OK>.
 
Next from the menu bar select File->New.  Select the
Projects tab, click once to highlight on the Win 32 console
Application menu choice and enter the name of your project
in the appropriate text field on the right side of the dialog box and click <OK>.  Click the empty project radio button and click <Finish>.  Next click <OK> to close the dialog box.
 
Next from the menu bar select File->New.  Select the
Files tab, and click once to highlight the C/C++ Header file menu choice and enter the name of your file (for our example we will use propel.h ).
 
Now enter the following piece of code as it appears into the file propel.h.  You can cut and paste the code
from this example if you would like.
 
propel.h should look like:
 
======================================
 
class engine
{
int start();
int throttle(int setting);
//control speed
int stop;
};
 
=====================================
 
Next from the menu bar select File->save to save the file.
 
Next from the menu bar select File->New.  Select the
Files tab, and click once to highlight the C/C++ Header file menu choice and enter the name of a file for a second time. We will call this file move.h.
 
Now enter the following piece of code as it appears into the file move.h.
 
move.h should look like:
======================================
 
#include "propel.h"
class vehicle
{
 
private:
     engine motive_power;
 
public:
      int x;
};
 
//for use on land
class car : public vehicle
{
};
 
//for use on sea
class boat : public vehicle
{
};
 
========================================
 
Next from the menu bar select File->Save All.
 
Now start Rose.  Select File->New from the menu bar to open up a new model. Name it what you would like.
 
Now we are ready to start the analyzer.  Select Tools->C++->Reverse Engineering.  This will bring up the analyzer.  Next select File->New. The analyzer should display a project window named "project 1".
 
Next select the <caption> button to enter the name of the caption. Notice the name is displayed in the resulting caption dialog box.  Next From the menu bar select File->Save As to save the project.  We will save ours as re.pjt
 
On re.pjt click the <files> button.  Here you need to specify the source files for reverse engineering.  Select the files to be reverse engineered from the "Files Not In List(Filtered)" box and click <Add Selected>.  If the
files you are trying to reverse engineer are not showing up in "Files Not In List(Filtered)" box BE SURE THAT THE DIRECTORY STRUCTURE is pointing to where those files are on the hard drive.  Once you have move.h and  propel.h in the "Files In List(Unfiltered)" box click <OK>.
 
Select all files by highlighting. (Headers will do.) Press F3. Ignore any errors if you have. Press F8 and specify the directory to save the model.
 
Now Start Rose and open the .mdl that you have saved.

Hope this helps...
PRASHANT.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Make the most of your online learning experience.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Loops Section Overview

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question