pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/SuboptimalEng/cpp-tutorials/tree/main/017-reading-assembly

l="stylesheet" href="https://github.githubassets.com/assets/repository-6534fbc3f5e83ac0.css" /> cpp-tutorials/017-reading-assembly at main · SuboptimalEng/cpp-tutorials · GitHub
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
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy