32bit assembly Flashcards

1
Q

Stack pointer register is used to track the top of the stack. As items are moved to and from the stack, this register increments/decrements accordingly. Of all the general purpose registers, this register is rarely/never used for anything other than its intended purpose.

A

ESP

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

in this view you can see contents of memory in the debugger. when you right click for example in ESP and choose “follow in dump” this will take you to that memory space to view.

A

Memory dump in CPU window. (bottom left pane)

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

EDI

A

Destination Index, was designed to store storage pointers of functions such as write address of a string operation.

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

what are the default views for ollydb/immunity debugger

A

CPU instructions (top left)
Registers (top right)
Memory dump (bottom left)
Stack(bottom right)

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

This registers represent boolean values resulting from calculations

A

EFLAGS/segment registers

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

base pointer, holds the base/bottom address of the stack

A

EBP -Enhanced Base Pointer

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

in 32bit CPU there are 8 registers, They can technically be used to store any data, though they were originally architected to perform specific tasks, and in many cases are still used that way today, 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
7
Q

This is the data register

A

EDX, used for mathematical equations like EAX, it compliments EAX.

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

Base Pointer, used to keep track of the base/bottom of the stack. It is 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 resgister you may choose ot use EBP for general porpuse

A

EBP

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

how does MOV work in intel architecture

A

remember with x86 Intel syntax it’s MOV [dst] [src])

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

Source index register, stores pointer to a read location, counter part of EDI

A

ESI

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

2 ways to attach/open a process in immunity Debugger

A

In Immunity, click File –> Attach and select the name of the application/process (in my example, wmplayer).

Note: you can also launch WMP directly from Immunity by clicking File –> Open and selecting the executable.

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

It’s called the accumulator register because it’s the primary register used for common calculations (such as ADD and SUB). While other registers can be used for calculations, THIS REGISTER 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 (more on that in future tutorials!). In addition to its use in calculations, THIS REGISTER is also used to store the return value of a function.

A

EAX

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

Not a general purpose register but stores the location of the next instruction. If you control this register you control execution flow of the application.

A

EIP

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

What is ECX

A

Counter register, used in loops and function repetition counter. it can also store any data like the rest of the registers.

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

This is the base register, no special purpose its a catch all unlike EAX

A

EBX

17
Q

How to reset default view in Immunity/ollydb debugger

A

When you reopen CPU it is not maximized so it is easy to miss that it has the 4-way default layout (disassembly, registers, memdump and stack) inside that single panel.