Reverse › Module 2 › Lesson 4
Lab — CPU
Pack CPU modes, registers, and stack/heap literacy — trace YOUR toy binary on $RE_LAB.
Visual · re_cpu_lab
Lab: CPU/memory pack. $RE_LAB only. Original Cyberlium.
Opening
One honest gdb session on YOUR toy binary beats ten disassembly screenshots without context.
Lessons 2-1–2-3 covered modes, registers, and memory layout. This lab merges a literacy pack and optional short trace of YOUR toy binary inside $RE_LAB — break at main, log registers at one compare, sketch stack frame. No unauthorized targets — YOUR compiled toy only. Next: Quiz — CPU and Memory Literacy.
1. Lab contract: CPU/memory pack
Create $HOME/cyberlium-lab/t23-m02-l04-cpu-lab.txt merging modes table, register sheet, stack diagram, and one gdb register snapshot from YOUR toy binary.
Optional: 10-step gdb session in $RE_LAB — break main, step to compare, log RAX/RDI and RSP.
Command guide
Try these commands — Lab contract: CPU/memory pack
═══ TOOLS & WEBSITES ═══ Browse / read these (authorized learning only — stay in YOUR lab / program scope)
ELF sections — https://man7.org/linux/man-pages/man5/elf.5.html (stack/heap in process image) readelf -S — https://man7.org/linux/man-pages/man1/readelf.1.html LiveOverflow — https://www.youtube.com/c/LiveOverflow (memory layout videos)
═══ INSTALL ═══
Linux (Debian/Ubuntu):
Command — copy this
sudo apt install binutils
macOS: Built-in (Xcode CLI) or brew install binutils
Command — copy this
brew install binutils
Windows: Use WSL binutils Use WSL or install file for Windows
═══ LINUX / macOS ═══
Command — copy this
export LAB_RE=${LAB_RE:-$HOME/cyberlium-lab/t23-re}
file "$LAB_RE/bin/check"
readelf -S "$LAB_RE/bin/check" | grep -E '\.text|\.data|\.bss|\.stack' | head -8
objdump -d "$LAB_RE/bin/check" | grep -A6 '<main>:' | head -10═══ WINDOWS ═══
Command — copy this
Get-Content $HOME/cyberlium-lab/t23-re/roe.txt | Select-String targets
Primary tools to practice this lesson: objdump, readelf, file. Reference sites: ELF sections (https://man7.org/linux/man-pages/man5/elf.5.html); readelf -S (https://man7.org/linux/man-pages/man1/readelf.1.html); LiveOverflow (https://www.youtube.com/c/LiveOverflow). Run every command in the box — install first, then the usage lines — only on YOUR lab / program scope.
2. Cross-check target authorization
Confirm traced binary is YOUR toy or approved crackme — not commercial warez. Redact any neighbor hostnames from notes.
Rebuild toy binary if source changed; update sha256 in pack.
3. Lock the proof
chmod 600 on the pack. Quiz next — then Assembly Literacy.
CPU literacy feeds disassembly reading in the next module.
4. What you ship: CPU/memory literacy pack for $RE_LAB
Modes + registers + stack diagram + optional trace. $RE_LAB named. YOUR toy binary only. chmod 600.
5. What you record before the next lesson
Date. CPU lab pack path. $RE_LAB named. File t23-m02-l04-cpu-lab.txt chmod 600.
6. Wrong vs right: commercial piracy vs crackmes/CTF toys
Worked failure — same MSF word, opposite target. Right never needs a café Wi-Fi or classmate laptop.
Wrong
Trace a commercial crack from torrent. Skip authorization check on target.
Right
Write YOUR CPU/memory pack with toy binary trace. chmod 600. Next: Quiz — CPU and Memory Literacy.
Mission: freeze YOUR CPU lab pack
1) Merge M2 literacy sections. 2) Add one register snapshot from YOUR toy binary. 3) chmod 600. Never trace unauthorized commercial binaries.
Stuck? Ask Cyberlium AI Mentor
One compare breakpoint teaches more than skimming disassembly.
Knowledge Check
APPLY: This lab requires:
Multiple choice
Knowledge Check
APPLY: True or False: Stack diagram should include return address and locals.
True or False
Knowledge Check
APPLY: gdb register snapshot should note:
Multiple choice