Solved

Reverse engineer C++ using Rational Rose

Posted on 2001-06-21
1
557 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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
wefewf 2 42
How to split this in C++ 4 76
Fibonacci challenge 11 82
Sorting in Excel with Group Headers if the Exist 2 67
RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
This article will show, step by step, how to integrate R code into a R Sweave document
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 …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

772 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

10 Experts available now in Live!

Get 1:1 Help Now