Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


"js" and "or eax,-01"

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Mon Mar 07, 2016 8:10 pm    Post subject: "js" and "or eax,-01" Reply with quote

Hi there, what does "js" mean? In the memory viewer, the explanation is "jump short if sign". Does "sign" has the same meaning as it has in "signed integer"?
My second question is: what is the following code usually used for?
Code:
or eax,-01


My last question:
Code:
ret 0004


Does it mean this function returns integer 4?
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Tue Mar 08, 2016 2:59 am    Post subject: Reply with quote

1) jump if signed does exactly mean the signing of integeres (which is expressed by the most significant bit I think).

2) You can write that as an
Code:
or eax,FFFFFFFF

whereas the binary expression would be 11111111111111111111111111111111b

3) As CE's disassembler window should already tell you this function does NOT return "4" as a result, but it pops 4 bytes off the stack before returning.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Mar 08, 2016 11:42 am    Post subject: Reply with quote

or eax,-1 is just a faster way for your computer to perform mov eax,-1
Back to top
View user's profile Send private message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Tue Mar 08, 2016 3:21 pm    Post subject: Reply with quote

Thanks guys. Smile
Back to top
View user's profile Send private message
gir489
Grandmaster Cheater
Reputation: 14

Joined: 03 Jan 2012
Posts: 841
Location: Maryland, United States

PostPosted: Wed Mar 09, 2016 12:34 pm    Post subject: Reply with quote

I haven't seen your RETN question answered probably because nobody knows what you're talking about. But you're about to open a can of worms on this if you want this answered properly.

http://marcoramilli.blogspot.com/2011/08/rop-retn-offest-stack-compensation.html
https://courses.engr.illinois.edu/ece390/archive/spr2002/books/labmanual/inst-ref-ret.html

The 4 means it's going to increment the stackpointer by 4 after the Return Near. Why? Probably because the compiler is doing some cleanup.

What is it actually for? Who fucking knows. But ROP programmers abuse it to have it return to an area of code they've injected for RCE. It's really nifty to abuse for pentesting, but really sucks ass for game hacking, I wouldn't bother with it, really. Just ignore it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites