 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Arcansel Cheater
Reputation: 0
Joined: 04 Jun 2022 Posts: 28
|
Posted: Thu Aug 18, 2022 10:36 pm Post subject: Help with changing specific bits in a value |
|
|
I m trying to make a AA script to change only the last 3 bits while keeping the rest, the value is stored in 4 byte Big endian and i m viewing in Hex, FFFFF### i need to keep whatever is in those F and change only the #. If not possible, then a lua script but i dunno how to use Lua in a AA script altogether or even know how to use Lua at all, i really wanted it to be in just 1 script instead of having a separate one to assist the other.
Note: The value is actually 4 bits in size but the game only uses 3 bits, the max is 99 but it can go up to 999, crashing around 1030ish.
Thanks.
Last edited by Arcansel on Thu Aug 18, 2022 10:55 pm; edited 1 time in total |
|
| Back to top |
|
 |
sbryzl Master Cheater
Reputation: 6
Joined: 25 Jul 2016 Posts: 252
|
Posted: Thu Aug 18, 2022 10:53 pm Post subject: |
|
|
| Code: | newmem:
mov eax,[dwvalue]
and eax,fffff000
mov ecx,[nibble3]
and ecx,fff
or eax,ecx
mov [newval],eax
jmp return
dwvalue:
dd fffff555
nibble3:
dd abc
newval:
dd 0 |
If you need a different endian just flip the and values.
|
|
| Back to top |
|
 |
Arcansel Cheater
Reputation: 0
Joined: 04 Jun 2022 Posts: 28
|
Posted: Thu Aug 18, 2022 10:58 pm Post subject: |
|
|
| sbryzl wrote: | | Code: | newmem:
mov eax,[dwvalue]
and eax,fffff000
mov ecx,[nibble3]
and ecx,fff
or eax,ecx
mov [newval],eax
jmp return
dwvalue:
dd fffff555
nibble3:
dd abc
newval:
dd 0 |
|
Ty very much for the quick reply, i m gonna try it right now, hopefully with my limited knowledge i will be able to modify it for other games if needed.
Update:
Okay, i was gonna ask for more help in understanding the code but i managed to make it work myself, thanks again.
|
|
| 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
|
|