Part 1: The Basics Flashcards
Immunity Debugger: What is the top-left pane, and what does it display
CPU Instructions
The CPU Instructions – displays the memory address, opcode and assembly instructions, additional comments, function names and other information related to the CPU instructions
Immunity Debugger: What is the bottom-left pane, and what does it display
Memory Dump
The Memory Dump – shows the contents of the application’s memory
Immunity Debugger: What is the top-right pane, and what does it display
Registers
The Registers – displays the contents of the general purpose registers, instruction pointer, and flags associated with the current state of the application.
Immunity Debugger: What is the bottom-right pane, and what does it display
Stack
The Stack – shows the contents of the current stack
There are 8 general-purpose registers in the x86 architecture, what are they?
EAX, EBX, ECX, EDX, EDI, ESI, EBP, and ESP
What is EAX
The Accumulator Register.
it’s the primary register used for common calculations (such as ADD and SUB).
EAX has been given preferential status by assigning it more efficient, one-byte opcodes. Such efficiency can be important when it comes to writing exploit shellcode for a limited available buffer space
EAX is also used to store the return value of a function.
EAX refers to the 32-bit register in its entirety. {BLANK1} refers to the least significant 16 bits which can be further broken down into {BLANK2} (the 8 most significant bits of (2)) and {BLANK3} (the 8 least significant bits).
This same whole/partial 32-, 16-, and 8-bit referencing also applies to the next three registers (EBX, ECX, and EDX)
1: AX
2. AH
3. AL
What is EBX
The Base Register.
In 32-bit architecture, EBX doesn’t really have a special purpose so just think of it as a catch-all for available storage. Like EAX, it can be referenced in whole (EBX) or in part (BX, BH, BL).
What is ECX
The Counter Register.
As its name implies, the counter (or count) register is frequently used as a loop and function repetition counter, though it can also be used to store any data.
Like EAX, it can be referenced in whole (ECX) or in part (CX, CH, CL).
What is EDX
The Data Register
EDX is kind of like a partner register to EAX. It’s often used in mathematical operations like division and multiplication to deal with overflow where the most significant bits would be stored in EDX and the least significant in EAX. It is also commonly used for storing function variables.
Like EAX, it can be referenced in whole (EDX) or in part (DX, DH, DL).
What is ESI
The Source Index
The counterpart to EDI, ESI is often used to store the pointer to a read location. For example, if a function is designed to read a string, ESI would hold the pointer to the location of that string.
What is EDI
The Destination Index
Though it can be (and is) used for general data storage, EDI was primarily designed to store the storage pointers of functions, such as the write address of a string operation.
What is EBP
The Base Pointer
EBP is used to keep track of the base/bottom of the stack. It is often used to reference variables located on the stack by using an offset to the current value of EBP, though if parameters are only referenced by register, you may choose to use EBP for general use purposes.
What is ESP
The Stack Pointer
ESP is used to track the top of the stack. As items are moved to and from the stack ESP increments/decrements accordingly.
Of all of the general purpose registers, ESP is rarely/never used for anything other than it’s intended purpose.
What is EIP
The Instruction Pointer
Not a general purpose register, but fitting to cover here,
EIP points to the memory address of the next instruction to be executed by the CPU.
Control the value of EIP and you can control the execution flow of the application (to execute code of your choosing).