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 


Additional chars on unicode string

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Redouane
Master Cheater
Reputation: 3

Joined: 05 Sep 2013
Posts: 363
Location: Algeria

PostPosted: Thu Aug 25, 2016 3:02 pm    Post subject: Additional chars on unicode string Reply with quote

This is a Unity game.
Why does this function call return extra characters after "Tenchi Sword"?
The call
Code:
readString(0x4F020C, 22, true)
returns "Tenchi Swor" (Last character missing).

-> Look at the dump, not the disassembler.



Weird chars.png
 Description:
 Filesize:  64.22 KB
 Viewed:  4017 Time(s)

Weird chars.png


Back to top
View user's profile Send private message
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Thu Aug 25, 2016 3:23 pm    Post subject: Re: Additional chars on unicode string Reply with quote

Redouane wrote:
This is a Unity game.
Why does this function call return extra characters after "Tenchi Sword"?
The call
Code:
readString(0x4F020C, 22, true)
returns "Tenchi Swor" (Last character missing).

-> Look at the dump, not the disassembler.


use upper limit of 1000 instead of 24. i'm guessing 24 bytes terminates right between two characters, on the null separator, which returns the ?. 1000 upper limit reads the entire string until the null terminator, so don't worry about reading past the end.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Aug 25, 2016 3:28 pm    Post subject: Reply with quote

it's a bug.
In thise case I think size 25 is recommended. (so it's 0 terminator is also copied which bypasses the bug)

(fixed on github)

_________________
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
Redouane
Master Cheater
Reputation: 3

Joined: 05 Sep 2013
Posts: 363
Location: Algeria

PostPosted: Thu Aug 25, 2016 3:53 pm    Post subject: Reply with quote

Dark Byte wrote:
it's a bug.
In thise case I think size 25 is recommended. (so it's 0 terminator is also copied which bypasses the bug)

(fixed on github)


Thanks.

predprey wrote:
use upper limit of 1000 instead of 24. i'm guessing 24 bytes terminates right between two characters, on the null separator, which returns the ?. 1000 upper limit reads the entire string until the null terminator, so don't worry about reading past the end.

I'll add 2 bytes to the length argument, should be enough, thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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