Assembly Basics Flashcards
Immunity Debugger - F9
Play/Run Program
Immunity Debugger - F7
Step into next instruction (but pause execution)
EAX
Accumulator Register 32-bits common calculations (ADD / SUB) efficient - one-byte opcodes good for limited available buffer space (compact shellcode)
AX
Lower half of EAX
16-bits
AH
Higher half of AX 8-bits
AL
Lower half of AX 8-bits
EBX
Base Register
32-bits
Catch-all register
No special purpose
BX
Lower half of EBX
16-bits
BH
Higher half of BX 8-bits
BL
Lower half of BX 8-bits
ECX
Counter Register
32-bits
Frequently used for Loop and Function repetition counter
Can store any data like EAX
CX
Lower half of ECX
16-bits
CH
Higher half of CX 8-bits
CL
Lower half of CX 8-bits
EDX
Data Register 32-bits Mathematical operations Division / Multiplication used for overflow were most significant bits stored in EDX and least significant bits stored in EAX
DX
Lower half of EDX
16-bits
DH
Higher half of DX 8-bits
DL
Lower half of CX 8-bits
ESI
Source Index
Counterpart to EDI
Stores the pointer to the read location
E.g. If a function is designed to read a string, ESI would hold the pointer to the location of that string
EDI
Destination Index
Can be and is used for general data storage it’s primarily designed to store the storage pointers functions, such as the write address of a string operation
EBP
Base Pointer
Used to keep track of the base/bottom of the stack
Used to reference variables located on the stack by using an offset to the current value of EBP
If parameters are only referenced by register, you may choose to use EBP for general use
ESP
Stack Pointer
Used to track the top of the stack - LIFO
ESP increments/decrements when items are added/removed from the stack