Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

1.0 - Assembly and low level ?

Assembly language is a low-level, machine-specific language: each instruction-set processor uses its own assembly. In our case, x86-64 assembly does not run on a different processor.

High-level languages are translated into assembly or machine code, which the processor executes. Assembly language helps you understand system resources like memory and registers.

It also helps improve algorithm development skills and debugging through practice, because it requires more thought, attention, and a nuanced approach. Function and procedure calls, input/output instructions, and the structure of functions — important implementation details — are best understood when working at a low level.

In the security world, fundamental mechanisms of multiprocessing such as shared memory and threaded processing help to understand race conditions and other bugs associated with those concepts.

1.1 - History and Beginning

The x86-64 instruction set is used by 64-bit operating systems. x86-64 is a CISC (Complex Instruction Set Computing) architecture. There are multiple internal processor design philosophies.

(x86_64, AMD64, x64) is a 64-bit extension of the x86 instruction set. The first widely available implementation was the AMD Opteron in 2003. It introduced 64-bit mode, compatibility mode, and a new 4-level paging mechanism. Compared to 32-bit, it supports larger virtual and physical address spaces and increased the number of general-purpose registers (GPR) from 8 to 16. SSE2 instructions are available and are commonly used in 64-bit mode for floating-point arithmetic.

128-bit vector registers (XMM registers) can store one or two double-precision floating-point numbers or up to four single-precision numbers.

  • 64-bit mode instructions were modified to support 64-bit operands and 64-bit addressing.
  • x86-64 architecture can run 16-bit and 32-bit applications on compatible systems.
  • AMD product names such as Opteron and Athlon were followed by X2, X3, X4 to indicate the number of cores; similar naming was used for Turion, Sempron, Phenom, and others.

It is important to note that readers should have prerequisites in C, C++, or Java, because many explanations assume familiarity with programming concepts and with Linux-based operating systems and their command-line interfaces.

If not, I highly recommend doing a C Pool from 42 School.