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 


Unexpected value after mov

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
thefreestyle
Cheater
Reputation: 0

Joined: 29 Oct 2015
Posts: 35

PostPosted: Sat May 02, 2020 11:28 am    Post subject: Unexpected value after mov Reply with quote

Hi everybody,

Something probably simple but i cant figure this out.

I found address that i want to change, it has one one of 2 values (in 4 bytes) 256 \ 257

When i do :
Code:
mov [rsi+00002705],(int) 257


The value eventually seen as 65792. If ill take calculator and put this number as decimal, the hex value is 10100, which is not exactly what i want. The correct hex value suppose to be 101 = 257 (DEC).
I found another op code that is original to game and it writes the value this way:
Code:
mov [rcx],dil


If i change the value manually at the address to 257 then i get expected result.
What am i missing here ?

Thanks,
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Sat May 02, 2020 2:12 pm    Post subject: Reply with quote

Change 00002705 to 00002704
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
thefreestyle
Cheater
Reputation: 0

Joined: 29 Oct 2015
Posts: 35

PostPosted: Sat May 02, 2020 2:22 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Change 00002705 to 00002704


Works !

can you explain why?

Thanks a lot,
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Sat May 02, 2020 3:45 pm    Post subject: Reply with quote

It was probably a typo. You meant to press "4" but you accidentally pressed "5".

Or it's not a 4-byte value and the debugger gets confused because you said it is.

If you're wondering about the binary format of integers, they're stored as sums of nonnegative powers of 2 with bytes in little endian order. This is more or less a fancy way of saying hexadecimal in reverse byte order.
e.g. the 4 byte value 0x1234ABCD gets stored as the bytes CD AB 34 12 (in that order).
In your case, you want to set a value to 0x101, but you specified the address wrong:
Code:
00 01 00 00
^^ the start of the actual value
00 01 00 00
   ^^ the address you were writing to

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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