Skip to content
doubtly

1 answer

Answer: Software reverse engineering is the process of analysing an existing program (often with poor or no documentation) to recover its design, specifications and requirements, i.e. going from code back to higher levels of abstraction. It is the opposite direction of forward engineering.

Diagram (in words): Forward engineering goes Requirements → Design → Code. Reverse engineering goes the other way: Code (and data) → Module/structure specification → Design → Requirements specification. Re-engineering = reverse engineering followed by forward engineering of an improved system.

Objectives:

  • Understand and maintain legacy systems whose original developers or documents are no longer available.
  • Recover lost design and produce updated documentation.
  • Detect side effects, redundant code and reusable components.
  • Support migration to a new platform or language and re-engineering.

Levels of reverse engineering:

  • Processing (program) level: understanding what each routine and module does.
  • Data level: recovering internal data structures and the database schema (e.g. building an ER diagram from tables).
  • User interface level: working out how the UI behaves for re-design.

Steps in reverse engineering:

  1. Collect information: gather source code, any old design documents, manuals and talk to users.
  2. Examine the information: study it to become familiar with the system.
  3. Extract the structure: build a structure chart / call graph showing modules and calls.
  4. Record functionality: describe what each module does using structured English, decision tables etc.
  5. Record data flow: draw data flow diagrams showing how data moves between processes.
  6. Record control flow: capture the high-level control structure of the program.
  7. Review the extracted design: check it repeatedly against the code for correctness and consistency.
  8. Generate documentation: produce the final design document, SRS and other records for future maintenance.

Code-level activities: code restructuring (cleaning messy logic), redocumentation, design recovery, decompiling/disassembling binaries when source is missing.

Tools: decompilers and disassemblers (e.g. Ghidra, IDA), debuggers, call-graph and UML generators in IDEs, database schema extractors.

Advantages: extends the life of legacy software, lowers maintenance cost, helps migration and reuse, helps find security holes.

Limitations: time-consuming, may miss the original intent, and may raise legal/licensing issues when applied to others' software.

Supriya B. · 21 May 2024 Report
Was this answer helpful?

Your answer

Log in or create a free account to answer this question.