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 


Crash on asm double compare

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
pox911
Grandmaster Cheater
Reputation: 28

Joined: 29 Nov 2008
Posts: 918

PostPosted: Sun Jun 02, 2013 9:59 pm    Post subject: Crash on asm double compare Reply with quote

i have an asm script that alters two sections of code. One pulls and stores a value of something im targeting, the other pulls everything in the area.

My first compare is testing if a buton is held down. If its just that then i can easily toggle an effect on everything in the area. If i try to add a second compare after that button toggle then it just crashes. Whether i make it point toward the stored target value or not. I did a simple compare to 0 and it still crashes.


Any idea why just adding a second compare would do that?

Edit: Oddly swapping the compares around made it not crash. Any idea why?
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Jun 02, 2013 10:10 pm    Post subject: Reply with quote

It's hard to say without seeing the code. Assuming everything is correct, the order of the compare should not matter.
Back to top
View user's profile Send private message
pox911
Grandmaster Cheater
Reputation: 28

Joined: 29 Nov 2008
Posts: 918

PostPosted: Sun Jun 02, 2013 10:13 pm    Post subject: Reply with quote

Code:
BombMem:
pushad
pushfd
cmp [eax+9],00
jne BombNotPressed
push 11
call GetAsyncKeyState
shr ax,#15
cmp ax,1
jne BombNotPressed


those are my two compares. Oddly it only crashed when the compare to 0 was after the keypress.

im probably missing something stupid but what is the compare for a single byte and not all 4?
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Jun 03, 2013 6:35 am    Post subject: Reply with quote

Could you give full AA script, not only a part?
_________________
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25778
Location: The netherlands

PostPosted: Mon Jun 03, 2013 7:37 am    Post subject: Reply with quote

The most often made mistake is not having popfd/popad in all possible outcomes
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Jun 03, 2013 7:59 am    Post subject: Reply with quote

and proper order:

GOOD:
pushfd
pushad

popad
popfd


WRONG:
pushfd
pushad

popfd
popad

_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Mon Jun 03, 2013 6:41 pm    Post subject: Reply with quote

As already suggested, the only thing that comes to mind is improper use of popfd/popad. Also, seeing the entire script would be preferable.
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