 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
rog9001 Expert Cheater
Reputation: 2
Joined: 22 Dec 2015 Posts: 214 Location: Jupiter
|
Posted: Tue Aug 23, 2016 10:28 am Post subject: How to move bytes into a register rather than 4 byte values? |
|
|
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 |
|
 |
ulysse31 Master Cheater
Reputation: 2
Joined: 19 Mar 2015 Posts: 324 Location: Paris
|
Posted: Tue Aug 23, 2016 11:05 am Post subject: |
|
|
| 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 |
|
 |
rog9001 Expert Cheater
Reputation: 2
Joined: 22 Dec 2015 Posts: 214 Location: Jupiter
|
Posted: Tue Aug 23, 2016 11:28 am Post subject: |
|
|
| 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 |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Aug 23, 2016 6:03 pm Post subject: |
|
|
| Code: | | mov byte ptr [edx+00000340],FF |
|
|
| Back to top |
|
 |
|
|
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
|
|