Skip to content

Annotated solutions to "xchg rax,rax" by xorpd

Notifications You must be signed in to change notification settings

sstallion/xchg_rax

Repository files navigation

; 0x40 assembly riddles

"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.

-- Amazon Product Description

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.

Building Snippets

To build all snippets, issue:

$ make all

To build a given snippet, issue:

$ make snip_<number>

Note: Snippets are numbered in hex (00 through 3f).

Running Snippets

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.

Contributing

Pull requests are welcome! If a mistake is found, please file an issue on GitHub.