Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Reverse engineer C++ using Rational Rose

Posted on 2001-06-21
1
Medium Priority
?
612 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

730 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