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 Unicode String error

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Xblade Of Heaven
Master Cheater
Reputation: 0

Joined: 16 Oct 2005
Posts: 395
Location: DEAD

PostPosted: Fri Sep 16, 2016 1:20 pm    Post subject: Comparing Unicode String error Reply with quote

Hi guys, i have a small problem and i havent idea why.

I try cmp a UnicodeString:

This code crash the game... no idea why.

Code:
push eax
mov eax,dword ptr[ecx]
or eax,eax
jz code
cmp word ptr[eax+4d8],'A'//"AShockPlayer" Unicode String
jne code
cmp word ptr[eax+4da],'S'
jne code
cmp word ptr[eax+4dc],'h'
jne code
cmp word ptr[eax+4de],'o'
jne code
cmp word ptr[eax+4e0],'c'
jne code
cmp word ptr[eax+4e2],'k'
jne code
cmp word ptr[eax+4e4],'P'
jne code
cmp word ptr[eax+4e6],'l'
jne code
cmp word ptr[eax+4e8],'a'
jne code
cmp word ptr[eax+4ea],'y'
jne code
cmp word ptr[eax+4ec],'e'
jne code
cmp word ptr[eax+4ee],'r'
jne code

MY CODE HERE

code:
pop eax


and this another code no crash the game... the unicode string is correct, somebody can help me for see why game crash using the entire unicodestring comparation?

Code:
push eax
mov eax,dword ptr[ecx]
or eax,eax
jz code
cmp word ptr[eax+4d8],'A'//"AShock" Unicode String
jne code
cmp word ptr[eax+4da],'S'
jne code
cmp word ptr[eax+4dc],'h'
jne code
cmp word ptr[eax+4de],'o'
jne code
cmp word ptr[eax+4e0],'c'
jne code
cmp word ptr[eax+4e2],'k'
jne code

MY CODE HERE

code:
pop eax


regards!

_________________
Welcome to the Hell.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
STN
I post too much
Reputation: 43

Joined: 09 Nov 2005
Posts: 2676

PostPosted: Fri Sep 16, 2016 5:41 pm    Post subject: Reply with quote

Maybe the pointer is invalid for the rest of the offsets (doesn't always contain the string). That'd be my guess

You probably don't need to compare the full string by the way depending on if it's a unique occurrence.

_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
Back to top
View user's profile Send private message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Fri Sep 16, 2016 6:23 pm    Post subject: Reply with quote

Try using byt ptr instead and jumping backward. I don't know how your script is set up but I trivially used a return and textreader label incase your code label can't be moved.
Code:

return:
jmp code

textreader:
push eax
mov eax,dword ptr[ecx]
or eax,eax
jz return
cmp byte ptr[eax+4d8],'A'//"AShockPlayer" Unicode String
jne return
cmp byte ptr[eax+4da],'S'
jne return
cmp byte ptr[eax+4dc],'h'
jne return
cmp byte ptr[eax+4de],'o'
jne return
cmp byte ptr[eax+4e0],'c'
jne return
cmp byte ptr[eax+4e2],'k'
jne return
cmp byte ptr[eax+4e4],'P'
jne return
cmp byte ptr[eax+4e6],'l'
jne return
cmp byte ptr[eax+4e8],'a'
jne return
cmp byte ptr[eax+4ea],'y'
jne return
cmp byte ptr[eax+4ec],'e'
jne return
cmp byte ptr[eax+4ee],'r'
jne return

MY CODE HERE

code:
pop eax
Back to top
View user's profile Send private message
kuntz
Cheater
Reputation: 0

Joined: 29 Aug 2016
Posts: 44
Location: Canada

PostPosted: Fri Sep 16, 2016 6:39 pm    Post subject: Reply with quote

It's important for us to know what line of code is causing the crash. Nothing in the code you posted is invalid, so it's impossible to say what the problem is.

You can try replacing the push/pop eax with pushad/popad but I doubt that is the issue.
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