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 


How to move bytes into a register rather than 4 byte values?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
rog9001
Expert Cheater
Reputation: 2

Joined: 22 Dec 2015
Posts: 214
Location: Jupiter

PostPosted: Tue Aug 23, 2016 10:28 am    Post subject: How to move bytes into a register rather than 4 byte values? Reply with quote

so for example I have this:

Code:

mov [edx+00000340],ecx


This address contains the amount of special ability me and my opponent have. When looking at the values in 4 bytes its always some massive number like "1348304088" or something like that, when looking at the value in float/double it goes from + value to - value and from that - value to + value. But when looking at the values in bytes then it mostly is, no special ability = 0 and after that it goes up (9, 14, 28, 32, 37, 44, 58 etc.). sometimes it does go up and down (58, 64, 60, 68, 72, 69, 77 etc.). I noticed that the highest value in bytes is 175 - 200, I figured that the byte lvl would be the easiest to work with. I want to move bytes into the [edx+00000340] rather then a float or a 4 byte value. How do I do this? do I need to do something like:
Code:

mov cx,FF
mov [edx+00000340],cx

or

mov ch,FF
mov [edx+00000340],ch

or

mov cl,FF
mov [edx+00000340],cl
Back to top
View user's profile Send private message
ulysse31
Master Cheater
Reputation: 2

Joined: 19 Mar 2015
Posts: 324
Location: Paris

PostPosted: Tue Aug 23, 2016 11:05 am    Post subject: Reply with quote

Code:
mov cl,FF
mov [edx+00000340],cl


This should do what you want. It will only change the last byte, so if [edx+00000340] held 0xffffffff, 0xffffff will remain unchanged.

If you want to have zero padding you can use movzx
MOVZX moves an unsigned value into a register and zero-extends it with zero.
Back to top
View user's profile Send private message
rog9001
Expert Cheater
Reputation: 2

Joined: 22 Dec 2015
Posts: 214
Location: Jupiter

PostPosted: Tue Aug 23, 2016 11:28 am    Post subject: Reply with quote

ulysse31 wrote:
Code:
mov cl,FF
mov [edx+00000340],cl


This should do what you want. It will only change the last byte, so if [edx+00000340] held 0xffffffff, 0xffffff will remain unchanged.

If you want to have zero padding you can use movzx
MOVZX moves an unsigned value into a register and zero-extends it with zero.


thanks for the help. I could never figure out when to use cl (al, dl etc.) and when to use ch (ah, dh etc.).

I wrote my script like this:
Code:

push eax
mov al,FF
mov [edx+00000340],al
pop eax
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Aug 23, 2016 6:03 pm    Post subject: Reply with quote

Code:
mov byte ptr [edx+00000340],FF
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