Dripping Reverse Notes (8)

1. JMP instruction: modify the value of EIP

JMP EAX=MOV EIP,EAX (although this instruction cannot be executed)

example

[click and drag to move]

At this point we execute JMP, EAX

insert image description here

2. CALL instruction

CALL EAX=PUSH 地址B && MOV EIP,EAX

example

The circled part is our breakpoint, click on the number and then press F2 to have this effect, then we execute CALL 0x4012C5 and you
insert image description herecan see that both ESP and EIP have changed

3. RET instruction

Essence: POP EIP
​Example:
insert image description hereAfter we execute RET,
insert image description herewe can see that it jumps back to 0x401285 at this time, and the value of EIP becomes 0x401285, and the value of ESP is restored

Four. CMP instruction

This instruction compares two operands, which is equivalent to the SUB instruction, but the result of the subtraction is not stored in the first operand,
but the ZF flag is changed according to the result of the subtraction. When the two operands are equal, ZF The value of the flag bit is 1.
Of course, if the previous operand is smaller than the next operand, the value of the SF flag bit becomes 1
mainly to affect the value of the flag register.
Example:
insert image description hereThen execute CMP ESI, EDI
insert image description hereAt this time we see the value of ESI, EDI No change, ZF became Z1

Five. TEST command

This instruction is similar to the CMP instruction to a certain extent. The "AND" operation is performed on two values, and the result is not saved, but the corresponding flag will be changed. Common usage: use
this instruction to determine whether the value of a register is 0,
insert image description hereand then we execute TEST ECX , ECX
insert image description herecan see that the ZF flag bit value is 1 at this time

Guess you like

Origin blog.csdn.net/m0_51295934/article/details/122696341