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 


MessageBeep Issue.

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

Joined: 28 Jun 2010
Posts: 662

PostPosted: Thu Mar 08, 2012 4:22 am    Post subject: MessageBeep Issue. Reply with quote

Code:
mov eax,[Emperor.exe+F12B1C]
push 0xffffffff   
call MessageBeep
cmp dword ptr [ecx+04],0000001c
jne here
mov dword ptr [ecx+08],0
here:
mov eax,[ecx+08]
ret
nop


Using MessageBeep function causes to crash the game. Am I using it in incorrect fashion?
Back to top
View user's profile Send private message Send e-mail
Dark Byte
Site Admin
Reputation: 474

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

PostPosted: Thu Mar 08, 2012 5:35 am    Post subject: Reply with quote

The call to MessageBeep changes registers (like eax) . Save the registers before the call and restore afterwards
_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Thu Mar 08, 2012 5:48 am    Post subject: Reply with quote

There is no need of saving eax in my case here. As you can see eax is modified by some pointers. But Registers? Does other register is also changed by MessageBeep ?
Could it be because of the flags?
Back to top
View user's profile Send private message Send e-mail
Dark Byte
Site Admin
Reputation: 474

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

PostPosted: Thu Mar 08, 2012 6:10 am    Post subject: Reply with quote

http://en.wikipedia.org/wiki/X86_calling_convention#stdcall
ECX and EDX might also get changed

Personally I prefer using pushad / popad to save and restore all registers so I don't have to worry about the specific ones (and speed can be neglected)

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
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