Page cover
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Linux

Very Basic

  • General Purpose Registers (GPRs)

32-bit
64-bit
These registers are used for various arithmetic, logical, and data movement operations.

EAX

RAX

Accumulator Register

Used for arithmetic and logical operations. Stores the return value of functions. In mul and div operations, it stores multiplication results or dividend values.

EBX

RBX

Base Register Used as a pointer to data in memory.

Can store memory addresses in some instructions.

ECX

RCX

Counter Register Commonly used for loop counters in LOOP instructions.

Used as a count value for string operations and shifts/rotations.

EDX

RDX

Data Register

Often used in mul and div operations for storing high-order bits of results.

Used for I/O operations with in and out instructions.

ESI

RSI

Source Index Register

Points to source data in string operations like movs, cmps, and scas.

Can be used for general-purpose indexing.

EDI

RDI

Destination Index Register Points to destination data in string operations.

Used in movs, lods, and stos instructions.

  • Stack and Execution Control Registers

32-bit
64-bit
These registers control the flow of execution and stack operations.

ESP

RSP

Stack Pointer Holds the address of the top of the stack.

Automatically adjusted by push and pop instructions.

EBP

RBP

Base Pointer Used as a reference point for stack frames in function calls.

Maintains the base address of the current stack frame.

EIP

RIP

Instruction Pointer

Stores the address of the next instruction to be executed.

Changes automatically after executing each instruction.

Can be manipulated using jmp, call, and ret.

  • Segment Registers

#
Segment registers store memory segment selectors.

CS

Code Segment

Points to the segment containing currently executing instructions.

DS

Data Segment

Points to the segment where data is stored.

SS

Stack Segment

Points to the segment containing the stack.

ES

Extra Segments

Additional segment registers used for different purposes.

  • Flags Register (EFLAGS)

#
The EFLAGS register contains status flags that control operations.

CF

Carry Flag

Set if an arithmetic operation generates a carry or borrow.

ZF

Zero Flag

Set if the result of an operation is zero.

SF

Sign Flag

Set if the result of an operation is negative.

OF

Overflow Flag

Set if signed arithmetic overflows.

PF

Parity Flag

Set if the number of set bits in the result is even.

DF

Direction Flag

Controls string operations (0 = increment, 1 = decrement).

  • Special Purpose Registers

#
These registers are used for specific control and system functions.

CR0–CR4

Control Registers

Control processor modes and memory management.

GDTR

Global Descriptor Table Register

Stores the base address of the GDT.

IDTR

Interrupt Descriptor Table Register

Stores the base address of the IDT.

LDTR

Local Descriptor Table Register

Points to the LDT.

TR

Task Register

Points to the current task state segment (TSS).

  • Create shell code

00. Basic Checks

  • Get all functions

01. ret2libc (NX enabled)

  • Return to libc** [ ASLR OFF ]**

  • Return to libc [ ASLR ON (Bruteforce) ]

  • Return to libc [ ASLR ON (if you have access to machine) ]

02. NOP sled (NX disabled)

03. PWNtool Skeletons

  • ret2libc (32 bit)

04. GDB

  • Basic

  • Exploit

04.1 GDB-Gef

  • Basic

  • Exploit

04.2 GDB-Peda

  • Basic

  • Exploit

04.3 PWNdbg

05. OBJDump

  • Basic

Last updated