Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

TL;DR

  • Understanding the basics of assembly code

Video Overview

  • Go over C++ code
  • Debugging basics
    • clang++ -g main.cpp -o main
    • si - step into instruction
    • p $edi - print value in edi
    • x/2d $rbp-0x8 - examine 2 ints in rbp
  • Reading assembly
    • 0x100000f60 <+0>...
    • movl %edi, -0x8(%rbp)
    • addl -0x8(%rbp), %eax
    • callq 0x100000ed0

Helpful LLDB Commands

# Create debuggable executable
clang++ -g main.cpp -o main

# Run lldb
lldb ./main

b main # Breakpoint
n # Next
ni # Next instruction
s # Step into
si # Step into instruction

p $edi # print value in edi
x/2d $rbp-0x8 # examine 2 ints in rbp

Titles

  • How to Read x86 Assembly?

  • How to Read x86 Assembly like English?

  • C++ Deep Dive: How to Read x86 Assembly Code

  • How to Read x86 Assembly Code | C++ Deep Dive for Beginners

  • C++ Assembly Deep Dive: How to Read x86 Assembly Code?

  • How to Read Assembly Code | C++ Tutorial for Beginners

  • x86 Assembly Language Tutorial for C++ Programmers

  • How to Read Assembly Code Like English | C++ Tutorial

  • How to Read C++ Assembly Code for Beginners

  • Intro to Assembly Code | C++ LLDB Tutorial

  • C++ Reverse Engineering: Understanding Clang Assembly in LLDB

Description

In this C++ tutorial, we go over how to read assembly code generated by Clang. We start by understanding the sample C++ code, then we run the LLDB debugger and break on main. We go through each instruction in-depth to learn how the CPU uses mov, call, add, and jmp.

References

  • ChatGPT and Gemini