Can Someone Explain What Is The Push Opcode?

Anything Cheat Engine related, bugs, suggestions, helping others, etc..
Post Reply
exassasinx
Novice Cheater
Novice Cheater
Posts: 21
Joined: Fri Aug 25, 2017 1:05 pm
Reputation: 0

Can Someone Explain What Is The Push Opcode?

Post by exassasinx » Wed Nov 14, 2018 2:39 am

Like the opcode "push 00000163"
How do I know what is the stack or the address of the stack?

DrummerIX
RCE Fanatics
RCE Fanatics
Posts: 1204
Joined: Wed Mar 22, 2017 6:15 pm
Reputation: 886

Re: Can Someone Explain What Is The Push Opcode?

Post by DrummerIX » Wed Nov 14, 2018 2:56 am

In most cases the register rsp or esp holds the address of the top of the stack

MartaLabieniec
Expert Cheater
Expert Cheater
Posts: 100
Joined: Sat Oct 06, 2018 3:19 pm
Reputation: 56

Re: Can Someone Explain What Is The Push Opcode?

Post by MartaLabieniec » Thu Nov 22, 2018 11:43 am

But what means push? What means push 00000163?

Bloodybone
Table Makers
Table Makers
Posts: 265
Joined: Thu Aug 03, 2017 6:19 am
Reputation: 49

Re: Can Someone Explain What Is The Push Opcode?

Post by Bloodybone » Thu Nov 22, 2018 5:04 pm

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 those:

https://en.wikibooks.org/wiki/X86_Disassembly/The_Stack

https://eli.thegreenplace.net/2011/02/0 ... is-on-x86/

And maybe this:

https://software.intel.com/sites/defaul ... f#page=149

Post Reply

Who is online

Users browsing this forum: No registered users