Theme Switcher

Reverse Engineering

Reverse engineering is the process of dismantling an object or system to see how it works.

Reverse Engineering Challenges

Reasons for learning Reverse Engineering

  • Malware analysis.
  • Vulnerability analysis.
  • Software interoperability.
  • To create compatible software or hardware.
  • To create a key generator or bypass certification.

Executable files

These are compiled files that can be run directly by the computer.

Windows Portable Executable(PE) File

Examples of PE file extensions

  • Executables (exe)
  • Dynamic Libraries(DLL)
  • Drivers (.sys), .acm
  • Control panel Extension (.cpl)
  • Extensible Firmware Interface (.efi)
  • Screen Saver (.scr)
PE-file structure

DOS MZ Header Fields

Field Offset Description
e_magic 0x0000 The signature that the system recognizes as a valid DOS executable
e_cblp Bytes on last page of file
e_cp Pages in file
e_crlc Relocations
e_cparhdr Size of header in paragraphs
e_minalloc Minimum extra paragraphs needed
e_maxalloc Maximum extra paragraphs needed
e_ss Initial (relative) SS value
e_sp Initial SP value
e_csum Checksum
e_ip Initial IP value
e_cs Initial (Relative) CS value
e_lfarlc File address of relocation table
e_ovno Overlay number
e_res[4] Reserved words
e_oemid OEM identifier
e_oeminfo OEM information
e_res2[10] Reserved words
e_lfanew 0x003C File address of a new exe header

Linux Executable and Linkable Format (ELF) 

An ELF is a file format used for executables and shared libraries widely used on Unix-like operating systems including Linux, MacOS and Android.

    Examples of ELF extensions

  • Shares object libraries (.so)
  • Archieved library (.a)
  • Lib file (.lib)

Disassembling

Is analyzing machine code to understand the program's functionality & structure. Involves reversing an executable (.exe)

Disassemblers
Category Tools
Disassemblers Interactive Disassembler (IDA)
Ghidra
Binary Ninja
Radare2 & clutter
Ropper
Capstone
Assemblers NASM
MASM
GNU assembler
Armasm
Hex Editors 010 editor
XXD
HxD
Hexedit
Malcat

Decompiling

Decompilers are tools that convert binary code back into a higher-level programming language.

Decompilers

Debugging

Using tools to step through code, examine variables and understand program flow.

Debuggers

Binary Analysis

Examining binary files to identify patterns, relationships & potential vulnerabilities.

Binary Analysis Tools

Malware Analysis

External Resources

Books

  • "An Introduction To Reverse Engineering for Beginners" by Yurichev, Dennis
  • The IDA Pro book by Chris Eagle
  • The Ghidra book by Chris Eagle & Kara Nance

Videos

Websites