Page 1 of 1

Can Someone Explain What Is The Push Opcode?

Posted: Wed Nov 14, 2018 2:39 am
by exassasinx
12345678

Re: Can Someone Explain What Is The Push Opcode?

Posted: Wed Nov 14, 2018 2:56 am
by DrummerIX
In most cases the register rsp or esp holds the address of the top of the stack

Re: Can Someone Explain What Is The Push Opcode?

Posted: Thu Nov 22, 2018 11:43 am
by MartaLabieniec
But what means push? What means push 00000163?

Re: Can Someone Explain What Is The Push Opcode?

Posted: Thu Nov 22, 2018 5:04 pm
by Bloodybone
MartaLabieniec wrote:
Thu Nov 22, 2018 11:43 am
But what means push? What means push 00000163?
It loads("pushes") the hex value of 163 onto the top of the stack. That means that the value will be in [esp] for x32 or [rsp] in the case of x64. If there is another push after that instruction for example push 00000100 then [esp]/[rsp] contains the hex value of 100 and [esp+4]/[rsp+4] contains the hex value of 163. At least if the second value pushed onto the stack is 4 bytes big, if it is 8 bytes big then [esp+8]/[rsp+8] would contain the first value pushed onto the stack.

Instead of push 163 you could also write:

Code: Select all

sub esp,4 // or rsp and sub 8 for 8-Bytes big values 
mov [esp],163
Edit: If you want more information you can read these:

[Link]

[Link]

And maybe this:

[Link]