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 


Oh god, what is going on? wsprintf insanity and masm.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Nov 19, 2007 2:03 am    Post subject: Oh god, what is going on? wsprintf insanity and masm. Reply with quote

As wacky as it may be, I want to loop through until I hits the location I specified. (Everything read will eventually all go to a text file, but this is currently blowing my mind) Now, for instance, it's starting at 00900000 and going to 0100579C... well...

Code:
      readloop:
         invoke ReadProcessMemory, gameProcess, base, addr buffer, 4, NULL         
         add base, 00000001h
         cmp base, 0100579Ch
         jne readloop
         je result
         result:            
            mov eax, dword ptr [buffer]
            invoke wsprintf, addr buffer, addr format, eax
            invoke SetDlgItemText, hwnd, IDC_EDT1, addr buffer


this works no problem... but... Instead of 3, it shits out 300, 7 would turn into 700. 10F would turn into 10f00, etc. basically, it's correct... except it's uh... moved over.

Now if I for example start at 0100579C and just do this...

Code:
      readloop:
         invoke ReadProcessMemory, gameProcess, base, addr buffer, 4, NULL         
            mov eax, dword ptr [buffer]
            invoke wsprintf, addr buffer, addr format, eax
            invoke SetDlgItemText, hwnd, IDC_EDT1, addr buffer



It ends up perfectly fine. What the shit?
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Nov 19, 2007 2:29 am    Post subject: Reply with quote

You step through the code with a debugger and see if eax changes during your extra instructions for the first snippet where it does not in the second.
_________________
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 programming 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