Reverse engineering & Linux Flashcards
What type of architecture is x86-64 (amd64, i64)?
64-bit CISC
What are some properties of CISC?
A single instruction can do multiple things at once (mem access, register read, etc.)
Variable length instruction set
What is the x86-64 architecture?
CISC
The registers used extend an extra 32-bit on the Intel’s x86 architecture
What is a property of x86-64?
The architecture allows for a multi-sized register access, meaning you can access certain parts of a register which are different sizes.
How can multi-sized access be done?
The RAX register can have it’s lower 32-bits accessed using EAX.
The lower 16 bits can be accessed using AX.
The lower 8-bits can be accessed using AL.
How is the x86-64 registers structured?
What is the RAX register in x86-64?
64-bit “long” register
What is the EAX register in x86-64?
32-bit “int” register
Name 3 special registers in x86
RIP: Instruction pointer
RSP: Stack pointer
RBP: Base pointer
How are instructions executed in x86?
Fetch instruction at address in RIP
decode it
run it
Explain the following instruction:
mov rax, 0xdeadbeef
Mov the immediate “0xdeadbeef” into register rax
Explain the following instruction:
mov rax, [0xdeadbeef + rbx * 4]
Move the data at address “0xdeadbeef + rbx * 4” into rax
How are conditionals used in x86?
Use jumps and jump if the provided conditional is true:
- jnz <address>
- je <address>
- jge <address>
- jle <address>
- etc.
What does the conditional jump-flags check?
Checking EFLAGS
What are EFLAGS?
Special registers that stores flags on certain instructions.