Part 1: The Basics Flashcards

1
Q

Immunity Debugger: What is the top-left pane, and what does it display

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Immunity Debugger: What is the bottom-left pane, and what does it display

A

Memory Dump

The Memory Dump – shows the contents of the application’s memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Immunity Debugger: What is the top-right pane, and what does it display

A

Registers

The Registers – displays the contents of the general purpose registers, instruction pointer, and flags associated with the current state of the application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Immunity Debugger: What is the bottom-right pane, and what does it display

A

Stack

The Stack – shows the contents of the current stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

There are 8 general-purpose registers in the x86 architecture, what are they?

A

EAX, EBX, ECX, EDX, EDI, ESI, EBP, and ESP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is EAX

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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)

A

1: AX
2. AH
3. AL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is EBX

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is ECX

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is EDX

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is ESI

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is EDI

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is EBP

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is ESP

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is EIP

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the Segment Registers and EFLAGS register

A

There are two additional registers you’ll see in the Register pane, the Segment Register and EFLAGS register. I won’t cover either in detail but note that the EFLAGS register is comprised of a series of flags that represent Boolean values resulting from calculations and comparisons and can be used to determine when/if to take conditional jumps (more on these later).

17
Q

Memory Dump: How do you view the content of a memory location. where in the panel is it?

A

For example: let’s say you want to view the contents of memory at ESP.

Right-click on ESP, select “Follow in Dump” and the Memory Dump pane will display that location

Bottom left panel.

18
Q

How can you view each Assembly instruction (and corresponding opcode) being processed by the CPU within the CPU Instruction Pane?

Where is the CPU Instruction Pane?

A

You can step through the execution flow of the program one at a time (F7) and see the result of each CPU instruction.

Top-left pane.

19
Q

What is:

ADD/SUB op1, op2

A

add or subtract two operands, storing the result in the first operand. These can be registers, memory locations (limit of one) or constants.

For example, ADD EAX, 10 means add 10 to the value of EAX and store the result in EAX

20
Q

What is:

XOR EAX, EAX

A

Performing an ‘exclusive or’ of a register with itself sets its value to zero; an easy way of clearing the contents of a register

21
Q

What is:

INC/DEC op1

A

increment or decrement the value of the operand by one

22
Q

What is:

CMP op1, op2

A

compare the value of two operands (register/memory address/constant) and set the appropriate EFLAGS value.

23
Q

What is:

Jump (JMP) and conditional jump (je, jz, etc)

A

as the name implies these instructions allow you to jump to another location in the execution flow/instruction set. The JMP instruction simply jumps to a location whereas the conditional jumps (je, jz, etc) are taken only if certain criteria are met (using the EFLAGS register values mentioned earlier). For example, you might compare the values of two registers and jump to a location if they are both equal (uses je instruction and zero flag (zf) = 1).

24
Q

When you see a value in brackets such as ADD DWORD PTR [X] or MOV eax, [ebx] it is referring to the value stored in ________ ?

A

When you see a value in brackets such as ADD DWORD PTR [X] or MOV eax, [ebx] it is referring to the value stored at memory address X.

In other words, EBX refers to the contents of EBX whereas [EBX] refers to the value stored at the memory address in EBX.

25
Q
BYTE = _ byte(s)
WORD = _ byte(s)
DWORD = _ byte(s)
A
BYTE = 1 byte, 
WORD = 2 bytes, 
DWORD = 4 bytes.