Solved

Reverse engineer C++ using Rational Rose

Posted on 2001-06-21
1
602 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 …
Progress
Starting up a Project

623 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