The Wayback Machine - https://web.archive.org/web/20240529060937/https://www.geeksforgeeks.org/software-engineering-reverse-engineering/
Open In App

Reverse Engineering – Software Engineering

Last Updated : 16 Jan, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Software Reverse Engineering is a process of recovering the design, requirement specifications, and functions of a product from an analysis of its code. It builds a program database and generates information from this. This article focuses on discussing reverse engineering in detail.

What is Reverse Engineering?

Reverse engineering can extract design information from source code, but the abstraction level, the completeness of the documentation, the degree to which tools and a human analyst work together, and the directionality of the process are highly variable.

Objective of Reverse Engineering:

  1. Reducing Costs: Reverse engineering can help cut costs in product development by finding replacements or cost-effective alternatives for systems or components.
  2. Analysis of Security: Reverse engineering is used in cybersecurity to examine exploits, vulnerabilities, and malware. This helps in understanding of threat mechanisms and the development of practical defenses by security experts.
  3. Integration and Customization: Through the process of reverse engineering, developers can incorporate or modify hardware or software components into pre-existing systems to improve their operation or tailor them to meet particular needs.
  4. Recovering Lost Source Code: Reverse engineering can be used to recover the source code of a software application that has been lost or is inaccessible or at the very least, to produce a higher-level representation of it.
  5. Fixing bugs and maintenance: Reverse engineering can help find and repair flaws or provide updates for systems for which the original source code is either unavailable or inadequately documented.

Reverse Engineering Goals:

  1. Cope with Complexity: Reverse engineering is a common tool used to understand and control system complexity. It gives engineers the ability to analyze complex systems and reveal details about their architecture, relationships and design patterns.
  2. Recover lost information: Reverse engineering seeks to retrieve as much information as possible in situations where source code or documentation are lost or unavailable. Rebuilding source code, analyzing data structures and retrieving design details are a few examples of this.
  3. Detect side effects: Understanding a system or component’s behavior requires analyzing its side effects. Unintended implications, dependencies, and interactions that might not be obvious from the system’s documentation or original source code can be found with the use of reverse engineering.
  4. Synthesis higher abstraction: Abstracting low-level features in order to build higher-level representations is a common practice in reverse engineering. This abstraction makes communication and analysis easier by facilitating a greater understanding of the system’s functionality.
  5. Facilitate Reuse: Reverse engineering can be used to find reusable parts or modules in systems that already exist. By understanding the functionality and architecture of a system, developers can extract and repurpose components for use in other projects, improving efficiency and decreasing development time.
reverse-engineering

Reverse Engineering

Reverse Engineering to Understand Data:

Reverse engineering of data occurs at different levels of abstraction .It is often the first reengineering task.

  1. At the program level, internal program data structures must often be reverse engineered as part of an overall reengineering effort.
  2. At the system level, global data structures (e.g., files, databases) are often reengineered to accommodate new database management paradigms (e.g., the move from flat file to relational or object-oriented database systems).

Internal Data Structures

Reverse engineering techniques for internal program data focus on the definition of classes of objects.

  1. This is accomplished by examining the program code with the intent of grouping related program variables.
  2. In many cases, the data organization within the code identifies abstract data types.
  3. For example, record structures, files, lists, and other data structures often provide an initial indicator of classes.

Database Structures

A database allows the definition of data objects and supports some method for establishing relationships among the objects. Therefore, reengineering one database schema into another requires an understanding of existing objects and their relationships.
The following steps define the existing data model as a precursor to reengineering a new database model:

  1. Build an initial object model.
  2. Determine candidate keys (the attributes are examined to determine whether they are used to point to another record or table; those that serve as pointers become candidate keys).
  3. Refine the tentative classes.
  4. Define generalizations.

Reverse Engineering to Understand Processing:

To understand processing begins with an attempt to understand and then extract procedural abstractions represented by the source code. To understand procedural abstractions, the code is analyzed at varying levels of abstraction :system, program, component, pattern, and statement.

  1. Each of the programs that make up the application system represents a functional abstraction at a high level of detail. A block diagram, representing the interaction between these functional abstractions, is created.
  2. Each component performs some subfunction and represents a defined procedural abstraction. A processing narrative for each component is developed.

For large systems, reverse engineering is generally accomplished using a semiautomated(partial automation) approach. Automated tools can be used to help you understand the semantics of existing code. The output of this process is then passed to restructuring and forward engineering tools to complete the reengineering process.

Steps of Software Reverse Engineering: 

  1. Collection Information: This step focuses on collecting all possible information (i.e., source design documents, etc.) about the software. 
  2. Examining the Information: The information collected in step-1 is studied so as to get familiar with the system. 
  3. Extracting the Structure: This step concerns identifying program structure in the form of a structure chart where each node corresponds to some routine. 
  4. Recording the Functionality: During this step processing details of each module of the structure, charts are recorded using structured language like decision table, etc. 
  5. Recording Data Flow: From the information extracted in step-3 and step-4, a set of data flow diagrams is derived to show the flow of data among the processes. 
  6. Recording Control Flow: The high-level control structure of the software is recorded. 
  7. Review Extracted Design: The design document extracted is reviewed several times to ensure consistency and correctness. It also ensures that the design represents the program. 
  8. Generate Documentation: Finally, in this step, the complete documentation including SRS, design document, history, overview, etc. is recorded for future use. 

Reverse Engineering Tools:

Reverse engineering tools accept source code as input and produce a variety of structural, procedural, data, and behavioral design. Reverse engineering if done manually would consume a lot of time and human labor and hence must be supported by automated tools. Some of the tools are given below:

  1. CIAO and CIA:  A graphical navigator for software and web repositories and a collection of Reverse Engineering tools.
  2. Rigi: A visual software understanding tool.
  3. Bunch: A software clustering/modularization tool.
  4. GEN++: An application generator to support the development of analysis tools for the C++ language.
  5. PBS: Software Bookshelf tools for extracting and visualizing the architecture of programs.


Previous Article
Next Article

Similar Reads

Difference between Forward Engineering and Reverse Engineering
Forward engineering and reverse engineering are two approaches to software development, with different goals and processes. Table of Content What is Forward Engineering?Characteristics of forward engineeringWhat is Reverse Engineering?Key Elements of Forward engineering and reverse engineeringDifference between Forward Engineering and Reverse Engin
5 min read
Introduction to Software Engineering - Software Engineering
Software is a program or set of programs containing instructions that provide desired functionality. Engineering is the process of designing and building something that serves a particular purpose and finds a cost-effective solution to problems. Table of Content What is Software Engineering?Key Principles of Software EngineeringMain Attributes of S
8 min read
Difference between Software Engineering and Computer Engineering
1. Software engineering: Software Engineering refers to the study of software which tell us about how Software is formed and about the processes involved in the formation of Software. It is basically known as Software Engineering because it applies the principles of Engineering in order to create software. Thus it is called Software Engineering and
6 min read
Evolution of Software Engineering : From an Art To Engineering Discipline
Software Engineering is a systematic and cost-effective technique for Software Development. It is an engineering approach to develop Software. For example: If someone wants to travel from Punjab to Delhi. There are two approaches one can follow to achieve the same result: The normal approach is just to go out and catch the bus/train that is availab
13 min read
Requirements Engineering Process in Software Engineering
Requirements Engineering is the process of identifying, eliciting, analyzing, specifying, validating, and managing the needs and expectations of stakeholders for a software system. Table of Content What is Requirements Engineering?Requirements Engineering ProcessTools Involved in Requirement EngineeringAdvantages of Requirements Engineering Process
12 min read
Re-engineering - Software Engineering
Software Re-engineering is a process of software development that is done to improve the maintainability of a software system. Re-engineering is the examination and alteration of a system to reconstitute it in a new form. This process encompasses a combination of sub-processes like reverse engineering, forward engineering, reconstructing, etc.  Tab
8 min read
Difference between Software Engineering process and Conventional Engineering Process
Software Engineering Process and Conventional Engineering Process, both are processes related to computers and development. In this article, we will see the similarities as well as differences between both, that is Software Engineering Process and the Conventional Engineering Process. Table of Content Software Engineering ProcessConventional Engine
4 min read
Penetration Testing and Reverse Engineering
What is Penetration Testing? Penetration Testing has been evolving throughout the year with a robust increase in highly sophisticated attacks. Every organization is now aware of the damage caused by cyber-attacks. Private and Government organizations are now conducting scheduled penetration tests for every three months or less than that. The attack
3 min read
Abstraction Levels in Reverse Engineering
Reverse engineering holds a wide range of tasks that can aid to the understanding and modifying software systems. Its main purpose is to identify and recover program requirements and design requirements information from the system. The abstraction is the process of ignoring certain details in order to simplify the problem and facilitate the specifi
7 min read
Software Engineering | Classification of Software Requirements
According to IEEE standard 729, a requirement is defined as follows: A condition or capability needed by a user to solve a problem or achieve an objectiveA condition or capability that must be met or possessed by a system or system component to satisfy a contract, standard, specification or other formally imposed documentsA documented representatio
5 min read
Article Tags :