Eax, EBX, ECx, EDX, ESI, EDI, EBP, ESP, etc. are the names of General registers on the CPU in x86 assembly language, and are 32-bit registers. These registers can be viewed as variables in C language.
For example:Add eax,-2;// It can be considered that a value such as-2 is added to the variable eax.
These 32-bit registers have multiple purposes, but each of them has "expertise" and has its own special features.
EaxIt is an accumulator, which is the default register of many addition multiplication commands.
EBXIt is a base register that stores the base address in memory addressing.
ECXIs the counter, is the counter of the repeated (REP) prefix command and loop command.
EdXIt is always used to place the remainder produced by integer division.
ESI/EDI is called" source/destination index register "(source/destination index), because in many string operation commands, DS: ESI refers to the source string, ES: EDI points to the target string.
EBPIs the base pointer, which is most often used as the frame pointer for calling high-level language functions ). when cracking, you can often see the starting point of a standard function.Code:
Push EBP;Save current EBP
MoV EBP, esp;Set EBP as the current stack pointer
Sub ESP, xxx;Reserve XXX bytes for function temporary variables.
...
In this way, EBP forms a framework of this function. The EBP is above the original EBP, And the return address and parameter. EBP are under temporary variables.MoV ESP, EBP/pop EBP/RETYou can.
ESPSpecifically used as a stack pointer, It is vividly called a stack top pointer. The top of the stack is a region with a small address. The more data pushed into the stack, the smaller the ESP. On a 32-bit platform, ESP is reduced by 4 bytes each time.
Part 2 registers: