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 


Assembly, compare register before proceding

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
AbrasiveZealot
Newbie cheater
Reputation: 0

Joined: 02 Jan 2011
Posts: 21

PostPosted: Fri Jun 13, 2014 7:16 pm    Post subject: Assembly, compare register before proceding Reply with quote

I've got this bit of code, and it crashes. I can't seem to figure out how to continue.

Code:

mov eax,[2380B58]      // Start Setting Up Pointer
cmp [eax],00000000       // Compare To Prevent Crashes
je MyThread    // If Invalid Restart Thread

mov ebx,[eax+30]
cmp [ebx],00000000
je MyThread

mov eax,[ebx+BC]
cmp [eax],00000000
je MyThread

mov ebx,[eax+3D8]
cmp [ebx],00000000
je MyThread

mov eax,[ebx+35C]
cmp [eax],00000000
je MyThread

mov ebx,[eax+CC]
cmp [ebx],00000000
je MyThread

mov eax,[ebx+14]
cmp [eax],00000000
je MyThread

mov ebx,[eax+160]
cmp [ebx],00000000
je MyThread

mov eax,[ebx+A0]       // Finish Setting Up Pointer
cmp [eax],00000000
je MyThread


The crashing happens when I enter a vehicle, and after debugging it i found why. When in a vehicle the pointer becomes invalid and crashes at this line:

mov ebx,[eax+CC]

It happens because the address pointed at by [eax+CC] doesn't contain any data (?? ?? ?? ??). How can I do a compare to check and see that's it's valid? I've tried doing 2 compares to check and see that the value is good (Value > 00000000 && Value < 7FFFFFFF) but it doesn't work. How can I tell if it's good in assembly?
Back to top
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 893

PostPosted: Fri Jun 13, 2014 7:32 pm    Post subject: Reply with quote

cmp reg,0
je start

_________________
A nagy kapu mellett, mindig van egy kis kapu.
----------------------
Come on...
Back to top
View user's profile Send private message
AbrasiveZealot
Newbie cheater
Reputation: 0

Joined: 02 Jan 2011
Posts: 21

PostPosted: Fri Jun 13, 2014 8:06 pm    Post subject: Reply with quote

cmp eax,00000000
cmp [eax],00000000
je MyThread

These both don't trigger a jump

cmp [eax+CC],00000000

And this crashes upon execution because it's comparing something that doesn't exist. So I don't really understand what you mean.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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