Solved

Reverse engineer C++ using Rational Rose

Posted on 2001-06-21
1
565 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 230 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now