- These are my notes and sources for x86 assembly. This is my understanding of it.
- Original roadmap is:
- Learn to write x86 assembly.
- Learn to read x86 assembly.
- Learn x86 reverse engineering.
- Learn binary exploitation.
- I will structure my learning plan as follows.
- I will leave a check mark ( ✓ ) when I'm done with the topic.
- At some point in time I will also start studying the following:
https://github.com/hoppersroppers/nightmare/blob/master/modules/01-intro_assembly/readme.md
-
[✓] Install the necessary tools (
installation/) -
[✓] First program: the
exitsystem call (first_prog/)-
[✓] Write, assemble and run a program that "does nothing", and check the return value (
build.md) -
[✓] Try to exit with various exit codes (
exit8.asmandexit256.asm)
-
-
[✓] Make a
hello worldprogram -
[✓] Call assembly functions from C (
tasks/calling_from_c/Calling_from_c.md)-
[✓] Write an assembly program with a callable function that returns a 32-bit integer (
ret_int.asm) -
[✓] Write a small C program that calls this assembly function and displays the result in decimal, hexadecimal and binary formats (
caller.c) -
[✓] Write a program with a function that returns a negative number (
ret_neg.asm)
-
-
Registers (
registers)-
[✓] Register names and sizes (
x86general.md) -
The
movinstruction -
[✓] Write a program that moves values between registers of different sizes (
registers.md) -
The
xchginstruction
-
-
[✓] Look into machine code (
bin_inspection/howto.md)-
[✓] Check out the machine code of a program with
hexdump -
[✓] Disassemble a program with
objdump
-
-
[✓] Basic Arithmetic (
arithmetic/arithmetics.md)-
[✓] Make a program that sums two numbers (
add.asm) -
[✓] Make a program that subtracts two numbers (
sub.asm) -
[✓] Make a program that uses increment (
inc.asm) -
[✓] Make a program that uses decrement (
dec.asm) -
[✓] Make a program that uses unsigned integer multiplication (
mul.asm) -
[✓] Make a program that uses signed integer multiplication (
imul.asm) -
[✓] Make a program that obtains the negative of a number (
neg.asm)
-
-
[✓] Labels and Unconditional Jumps (
tasks/jump/unconditional_jumps.md)- [✓] Write a program with a
jmpinstruction (jump.asmandlabels.asm)
- [✓] Write a program with a
-
[✓] Flags, Comparisons and Conditional Jumps (
tasks/flags/control_flow.md)-
[✓] Write a program with a conditional jump (
cond_jump.asm) -
[✓] Write a program with a loop (
loop.asm) -
[✓] Write a program using the overflow flag (
overflow.asm) -
[✓] Write a program contrasting the above and below comparisons with the greater than and less than comparisons (
above_below.asm)
-
-
[✓] Logical and Bitwise Operations (
logic/logic.md)-
[✓] Use AND and OR (
and_or.asm) -
[✓] Use NOT and XOR (
not_xor.asm) -
[✓] Shift and Rotate operations (
shift.asm)
-
-
[✓] Data Types, Memory Addressing and the
.dataSection (data/build.md)-
[✓] How memory works in Linux? (
linux_memory.md) -
[✓] Write a program that uses the
.datasection (print_data.asm) -
[✓] Write a program that uses different data types (
types.asm) -
[✓] Write a program that uses addressing with displacement (
ret4bytes.asm) -
[✓] Write a program using addressing with a base register, an index register and scale factor (
ret_words.asm) -
[✓] Write a program using the
.bsssection (bss.asm) -
[✓] Write a program that uses a "global variable" from the
.bsssection (var_bss.asm) -
[✓] Write a program that increments a "global variable" from the
.bsssection (inc_var.asm) -
[✓] Write a program that manipulates an array (
array.asm)
-
-
[✓] The Stack (
stack/stack.md)-
[✓] Write a program that uses
pushandpop(push_pop.asm) -
[✓] Write a program that uses the stack pointer to allocate space and access elements on the stack (
esp1.asmandesp2.asm)
-
-
[✓] The
callInstruction (call/call.md) -
[] Calling External Functions (
extern/external.md)-
[✓] Write a program divided in two files using
extern/global(uselib.asmandlib.asm) -
[✓] Write a program divided into two
.asmfiles using theincludemacro (killer.asmandlibkiller.asm) -
Write a library with a function containing arguments, and call it from another
asmfile -
[] Call a function from C
-
[] Write an assembly library function that takes arguments, and call it from C
-
[] Write an assembly program that calls a C function
-
[✓] Write an assembly program that calls a C library function (
malloc.asm)
-
-
Using the Heap
- [] Use C's
mallocandfreeto allocate and free memory dynamically
- [] Use C's
-
Special
movinstructions-
[] Sign and Zero Extend
movand "size casting" directive -
Conditional
mov
-
-
[✓] Division Arithmetics (
tasks/arithmetics2/division.md) -
[] Manipulating Strings
-
[] Floating point arithmetic
-
[] NASM local labels
-
[] Write a function that receives an integer and prints it
-
[] Write a function that receives an integer and returns a string with it
-
[] Write a bootloader
-
[] Write a function that reverses any string it gets