Free sample lesson ยท Da World: C and ARM64 Reversing

First Build

Can your phone compile and run a C program in under five minutes?

Lesson 1 of the Wondering course Da World: C and ARM64 Reversing

Your Phone as a Lab

Can your phone compile and run a C program in under five minutes? With Termux on Android, it can.

You already know basic C. This course uses that C to learn reverse engineering and ARM64 assembly, right on the phone you carry.

Every later lesson repeats one loop: write C, build it, run it, and inspect the instructions the compiler produced.

The course loop
  • Write C: Start from a small C source file.
  • Build it: Compile the source into an executable.
  • Run it: Check that the program actually works.
  • Inspect it: Read the instructions the compiler produced.

This lesson gets that loop working for the first time.

Three Tools, Three Jobs

The loop needs three tools.

clang compiles C source into a native ARM64 executable your phone can run.

gdb lets you pause a running program and inspect its registers and memory.

objdump disassembles the compiled binary, so you can read its machine instructions next to your original C code.

Who does what

Miss any one of them and the loop breaks.

Installing the Toolchain

Imagine a learner with ten spare minutes and a fresh Termux install on an ARM64 Android phone.

Their first command is pkg update && pkg install clang gdb binutils.

The update refreshes the package list. Then one install line pulls in everything the loop needs.

One install line, three tools
  • pkg install: Run after pkg update.
  • clang package
  • clang: The compiler.
  • gdb package
  • gdb: The debugger.
  • binutils package
  • objdump: The disassembler.

Watch for a common surprise: there is no package named objdump. The binutils package provides objdump.

Write, Compile, Run

Next, the learner writes hello.c: a main function that calls printf("Hi\n").

They compile with clang -g -O0 hello.c -o hello. The -g flag keeps debug information, and -O0 turns off optimization, so the output stays close to the source.

The -o hello part names the executable.

Running ./hello prints Hi. Build and run both work.

From hello.c to Hi
  • Write: Create hello.c with a main that calls printf.
  • Compile: Run clang -g -O0 hello.c -o hello.
  • Run: Type ./hello in Termux.
  • Check: The program prints Hi.

Reading the Disassembly

Now the inspect step. The learner runs objdump -d hello | grep -A8 "<main>:".

The -d flag disassembles the binary. The grep shows the <main>: label plus the next eight lines.

The output lists ARM64 instructions, such as stp x29, x30 and bl printf.

That bl printf is the call you wrote in C. Spotting it confirms the whole toolchain works.

Same program, two views
  • C source
  • ARM64 output

When a Tool Is Missing

Back to the ten-minute break. If any tool is missing, the learner cannot start reversing.

So check each tool before writing code. For example, try clang --version, and do the same for gdb and objdump.

If a command is not found, run the install line again and recheck.

Once all three respond, move on to hello.c.

Is the toolchain ready?
  • Fresh Termux
  • Try each tool: Run clang, gdb, and objdump.
  • Any not found?
  • Run install line: pkg install clang gdb binutils
  • Build hello.c
  • Yes
  • Recheck
  • No

Your Working Loop

You now have the basic loop for the whole course.

clang builds, the program runs, objdump shows the instructions, and gdb is ready for pausing a program to look at registers and memory.

To explain it to a colleague, keep it plain: install three packages, compile with -g -O0, run, then disassemble.

Every later milestone starts here.

Who really wrote the instructions?

Check yourself

In Termux, the objdump tool is installed by running pkg install _____

  • binutils
  • objdump

Answer: binutils

objdump is not its own package in Termux. It ships inside binutils, so 'pkg install clang gdb binutils' gives you the compiler, the debugger, and the disassembler.

In a reversing toolchain, _____ compiles C source into a native ARM64 executable, _____ pauses a running program to inspect registers and memory, and _____ disassembles the binary into readable instructions.

Answer: In a reversing toolchain, clang compiles C source into a native ARM64 executable, gdb pauses a running program to inspect registers and memory, and objdump disassembles the binary into readable instructions.

Each tool covers one part of the loop: clang builds, gdb inspects a live, running program, and objdump reads the compiled instructions without running the program.

A learner compiles calc.c with 'clang -g -O0 calc.c -o calc'. What do the -g and -O0 flags do?

  • -g adds debug info; -O0 disables optimization
  • -g enables GPU code; -O0 sets the output file
  • -g strips symbols; -O0 maximizes optimization
  • -g adds debug info; -O0 maximizes optimization

Answer: -g adds debug info; -O0 disables optimization

-g adds debug information so gdb can map instructions back to source lines. -O0 turns off optimization, so the disassembly stays close to the original C and is easier for a beginner to read. The output filename is set by -o, not by these flags.

Keep going

This is lesson 1 of 15 in Da World: C and ARM64 Reversing. Next up:

  1. World Grid
  2. Creature Structs
  3. Tick Loop
  4. Pointers & Memory
  5. Random Rules

Start this course free

Wondering turns any topic into short lessons you can read, watch, or listen to, with practice questions and an AI tutor.