SlideShare a Scribd company logo
Reverse
Engineering
101
Take a peek under the hood!
Introduction
What is reversing?
Compilers and
Assembly
The compilation process and
machine code
Reversing
Basics
Disassembling machine code,
tools, and analysis
Live Demo
Reversing a compiled
executable
01 02
03 04
INTRODUCTION
What is reverse engineering?
Reverse Engineering
● The process of analyzing the internals of a piece of software, to figure out how it does what it does
● Various processes and tools for doing so
○ Ghidra, IDA Pro, Radare, etc.
● Static and Dynamic Analysis
Compilers & ASM
How do processors execute code? How do programming
languages compile to executable code?
Compiled Languages
● Some high level languages are compiled into machine code
○ C, C++, Go, Rust
● Machine code is directly interpreted by the processor
○ EXE, DLL, OSX, ELF files contain machine code
● Machine code is composed of instructions that the processor executes
○ mul (multiply), add (add), mov (move), jmp (jump)
● The format and set of instructions is defined by the ISA
○ Instruction Set Architecture
How Does Compilation Work?
● Preprocessing
○ Stripping comments, preprocessor directives
● Compilation
○ AST construction, intermediate representation (IR)
● Assembly
○ From IR, to assembly, to machine code (object files)
● Linking
○ Stitching object files together, adding dynamic library entries
Assembly
● Machine code consists of non-human readable instructions
● Assembly is essentially human-readable machine code
○ An architecture-specific programming language
● x86, ARM, MIPS, RISC-V, etc.
Reversing Basics
How do we disassemble executables? Can we derive the
original source code from a compiled executable?
A 30,000 foot view
● Static Analysis
○ Disassembly
○ Decompilation
● Dynamic Analysis
○ Debugging (GDB)
○ System call tracing
○ Network activity tracing
How to Read Assembly
● Registers
○ eax, ebx, ebp, esp (x86)
● Basic instructions and their operands
○ e.g. mul eax, ebx
● The C Calling Convention (cdecl)
○ How function calls are implemented in C
○ How accessing variables work
● Executable File Sections
○ What each section does and its properties
○ (for ELF) .text, .data, .bss, .rodata
1 More Thing - The Stack
● Some memory space used primarily for:
○ Local variables
○ Passing function arguments
● Behaves like a stack
○ Push & Pop operations
● Grows into lower address space
○ RBP is higher than RSP
Memory layout of a program
Reading ASM
Reverse Engineering 101
Reverse Engineering 101
xchng rax, rax
Translating C to ASM
https://godbolt.org/
● While loops, For loops
● Conditions
● Function Calls
Decompilation
● Inverse operation of compilation - generating high level source code from a compiled binary
● Tools:
○ IDA Hex Rays
○ Ghidra
● Translation to high level pseudocode may not be 1-to-1
○ We’ll be taking a look at this
ctf101.org
What’s The Point?
● Malware analysis
● Become a better developer
○ Understanding how programs may be vulnerable
● Embedded programming
● CTFs!
○ https://ctf.gdscutm.com/
Cool Applications
CREDITS: This presentation template was created by
Slidesgo, including icons by Flaticon, and infographics
& images by Freepik
THANKS!
@gdscutm

More Related Content

PPTX
Lecture for computer organization COAL Lec-1.pptx
PDF
linux_internals_2.3 (1).pdf àaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
PDF
Baby Demuxed's First Assembly Language Function
PDF
Finding Xori: Malware Analysis Triage with Automated Disassembly
PDF
BUD17-302: LLVM Internals #2
PDF
High performance json- postgre sql vs. mongodb
PDF
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
PDF
BUD17-310: Introducing LLDB for linux on Arm and AArch64
Lecture for computer organization COAL Lec-1.pptx
linux_internals_2.3 (1).pdf àaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Baby Demuxed's First Assembly Language Function
Finding Xori: Malware Analysis Triage with Automated Disassembly
BUD17-302: LLVM Internals #2
High performance json- postgre sql vs. mongodb
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
BUD17-310: Introducing LLDB for linux on Arm and AArch64

Similar to Reverse Engineering 101 (20)

PDF
A Journey into Hexagon: Dissecting Qualcomm Basebands
PDF
Compiler design notes phases of compiler
PPT
10 instruction sets characteristics
PPTX
Introduction to Simplified instruction computer or SIC/XE
PPT
isa architecture
PPT
isa architecture
PDF
Dart the better Javascript 2015
PPTX
03-IntroAssembly.pptx Introduction to assmebly language
PDF
Binary art - Byte-ing the PE that fails you (extended offline version)
PDF
Linux-Internals-and-Networking
PDF
Embedded platform choices
PDF
Log forwarding at Scale
PDF
Dfrws eu 2014 rekall workshop
PDF
Assembly language part I
PDF
Assembly language part I
PDF
3 boyd direct3_d12 (1)
PDF
Unmanaged Parallelization via P/Invoke
PDF
SystemML - Datapalooza Denver - 05.17.16 MWD
PDF
Introduction to Processor Design in System Verilog
PDF
The Parquet Format and Performance Optimization Opportunities
A Journey into Hexagon: Dissecting Qualcomm Basebands
Compiler design notes phases of compiler
10 instruction sets characteristics
Introduction to Simplified instruction computer or SIC/XE
isa architecture
isa architecture
Dart the better Javascript 2015
03-IntroAssembly.pptx Introduction to assmebly language
Binary art - Byte-ing the PE that fails you (extended offline version)
Linux-Internals-and-Networking
Embedded platform choices
Log forwarding at Scale
Dfrws eu 2014 rekall workshop
Assembly language part I
Assembly language part I
3 boyd direct3_d12 (1)
Unmanaged Parallelization via P/Invoke
SystemML - Datapalooza Denver - 05.17.16 MWD
Introduction to Processor Design in System Verilog
The Parquet Format and Performance Optimization Opportunities
Ad

More from GDSC UofT Mississauga (20)

PDF
CSSC ML Workshop
PPTX
ICCIT Council × GDSC: UX / UI and Figma
PDF
Community Projects Info Session Fall 2023
PDF
GDSC x Deerhacks - Origami Workshop
PDF
Michael's OWASP Juice Shop Workshop
PDF
MCSS × GDSC: Intro to Cybersecurity Workshop
PDF
PDF
Discord Bot Workshop Slides
PDF
Web Scraping Workshop
PDF
Devops Workshop
PDF
HTML_CSS_JS Workshop
PDF
DevOps Workshop Part 1
PDF
Docker workshop GDSC_CSSC
PDF
Back-end (Flask_AWS)
PDF
Full Stack React Workshop [CSSC x GDSC]
PDF
Git Init (Introduction to Git)
PPTX
Database Workshop Slides
PPTX
ChatGPT General Meeting
PPTX
Elon & Twitter General Meeting
CSSC ML Workshop
ICCIT Council × GDSC: UX / UI and Figma
Community Projects Info Session Fall 2023
GDSC x Deerhacks - Origami Workshop
Michael's OWASP Juice Shop Workshop
MCSS × GDSC: Intro to Cybersecurity Workshop
Discord Bot Workshop Slides
Web Scraping Workshop
Devops Workshop
HTML_CSS_JS Workshop
DevOps Workshop Part 1
Docker workshop GDSC_CSSC
Back-end (Flask_AWS)
Full Stack React Workshop [CSSC x GDSC]
Git Init (Introduction to Git)
Database Workshop Slides
ChatGPT General Meeting
Elon & Twitter General Meeting
Ad

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
August Patch Tuesday
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Machine Learning_overview_presentation.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Getting Started with Data Integration: FME Form 101
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Network Security Unit 5.pdf for BCA BBA.
Teaching material agriculture food technology
Programs and apps: productivity, graphics, security and other tools
MIND Revenue Release Quarter 2 2025 Press Release
August Patch Tuesday
Unlocking AI with Model Context Protocol (MCP)
Machine Learning_overview_presentation.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Heart disease approach using modified random forest and particle swarm optimi...
Getting Started with Data Integration: FME Form 101
OMC Textile Division Presentation 2021.pptx
A comparative study of natural language inference in Swahili using monolingua...
Spectral efficient network and resource selection model in 5G networks
SOPHOS-XG Firewall Administrator PPT.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation theory and applications.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Diabetes mellitus diagnosis method based random forest with bat algorithm
Network Security Unit 5.pdf for BCA BBA.

Reverse Engineering 101

  • 2. Introduction What is reversing? Compilers and Assembly The compilation process and machine code Reversing Basics Disassembling machine code, tools, and analysis Live Demo Reversing a compiled executable 01 02 03 04
  • 4. Reverse Engineering ● The process of analyzing the internals of a piece of software, to figure out how it does what it does ● Various processes and tools for doing so ○ Ghidra, IDA Pro, Radare, etc. ● Static and Dynamic Analysis
  • 5. Compilers & ASM How do processors execute code? How do programming languages compile to executable code?
  • 6. Compiled Languages ● Some high level languages are compiled into machine code ○ C, C++, Go, Rust ● Machine code is directly interpreted by the processor ○ EXE, DLL, OSX, ELF files contain machine code ● Machine code is composed of instructions that the processor executes ○ mul (multiply), add (add), mov (move), jmp (jump) ● The format and set of instructions is defined by the ISA ○ Instruction Set Architecture
  • 7. How Does Compilation Work? ● Preprocessing ○ Stripping comments, preprocessor directives ● Compilation ○ AST construction, intermediate representation (IR) ● Assembly ○ From IR, to assembly, to machine code (object files) ● Linking ○ Stitching object files together, adding dynamic library entries
  • 8. Assembly ● Machine code consists of non-human readable instructions ● Assembly is essentially human-readable machine code ○ An architecture-specific programming language ● x86, ARM, MIPS, RISC-V, etc.
  • 9. Reversing Basics How do we disassemble executables? Can we derive the original source code from a compiled executable?
  • 10. A 30,000 foot view ● Static Analysis ○ Disassembly ○ Decompilation ● Dynamic Analysis ○ Debugging (GDB) ○ System call tracing ○ Network activity tracing
  • 11. How to Read Assembly ● Registers ○ eax, ebx, ebp, esp (x86) ● Basic instructions and their operands ○ e.g. mul eax, ebx ● The C Calling Convention (cdecl) ○ How function calls are implemented in C ○ How accessing variables work ● Executable File Sections ○ What each section does and its properties ○ (for ELF) .text, .data, .bss, .rodata
  • 12. 1 More Thing - The Stack ● Some memory space used primarily for: ○ Local variables ○ Passing function arguments ● Behaves like a stack ○ Push & Pop operations ● Grows into lower address space ○ RBP is higher than RSP Memory layout of a program
  • 17. Translating C to ASM https://godbolt.org/ ● While loops, For loops ● Conditions ● Function Calls
  • 18. Decompilation ● Inverse operation of compilation - generating high level source code from a compiled binary ● Tools: ○ IDA Hex Rays ○ Ghidra ● Translation to high level pseudocode may not be 1-to-1 ○ We’ll be taking a look at this
  • 20. What’s The Point? ● Malware analysis ● Become a better developer ○ Understanding how programs may be vulnerable ● Embedded programming ● CTFs! ○ https://ctf.gdscutm.com/
  • 22. CREDITS: This presentation template was created by Slidesgo, including icons by Flaticon, and infographics & images by Freepik THANKS! @gdscutm