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 


Comparing an integer with the value in a pointer?

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

Joined: 17 Feb 2016
Posts: 526

PostPosted: Tue Feb 23, 2016 8:59 pm    Post subject: Comparing an integer with the value in a pointer? Reply with quote

Hi there. I want to compare an integer with the value in a pointer, for example:
1. the integer variable "number" equals to 100 (in decimal).
2. the pointer is: byte ptr [ebx+19]
3. I want to do something like this:
Code:

cmp byte ptr [ebx+19],number
jg originalcode


But it seems the comparison does not work, please help, I have been working on this for half a day.... Sad
Back to top
View user's profile Send private message
Daijobu
Master Cheater
Reputation: 13

Joined: 05 Feb 2013
Posts: 301
Location: the Netherlands

PostPosted: Wed Feb 24, 2016 1:18 pm    Post subject: Reply with quote

Code:
64
(int)100


How did you get ebx+19? That's not dword aligned although you're comparing a byte. Try +18 or +1A.

Also, you posted in the LUA section without a LUA related question.

_________________
Scripts/tables from scratch. Relation to other scripts is coincidental. Use of posted code is credited properly.
Euro Truck Simulator 2 Backwards Compatible Cheat
American Truck Simulator Backwards Compatible Cheat
Back to top
View user's profile Send private message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Wed Feb 24, 2016 2:13 pm    Post subject: Reply with quote

I have fixed the issue. Thanks for the reply and sorry for posting in the wrong section.
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 Lua Scripting 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