"xchg rax,rax" is a collection of assembly gems and riddles I found over many years of reversing and writing assembly code. The book contains 0x40 short assembly snippets, each built to teach you one concept about assembly, math or life in general.
This repository contains annotated solutions to xchg rax,rax by xorpd. Solutions were developed using the Netwide Assembler (NASM) for x86-64 and may be built on Linux and macOS using the provided Makefile.
To build all snippets, issue:
$ make all
To build a given snippet, issue:
$ make snip_<number>
Note: Snippets are numbered in hex (
00
through3f
).
Snippets can be run as-is, however there will not be any interesting output. A GDB command file is included with each solution to demonstrate behavior.
To execute the command file for a given snippet, issue:
$ gdb -batch -x gdb/snip_<number>
Note: Sample command file output can be found in the
output
directory.
Pull requests are welcome! If a mistake is found, please file an issue on GitHub.