| View previous topic :: View next topic |
| Author |
Message |
kucingkembar Advanced Cheater
Reputation: 0
Joined: 08 Oct 2020 Posts: 71
|
Posted: Thu Oct 29, 2020 4:25 am Post subject: how to write bit value |
|
|
this similar with my previous post,
this is how you read bit value using script
| Code: | readInteger("Example.exe+ABC123") & (1 << 0)
--(code provided by dark byte) |
but how to write bit value using the script?,
and this is cheat table if it necesarry
| Code: |
<Description>"Test"</Description>
<LastState Value="1" RealAddress="0123ABCD"/>
<VariableType>Binary</VariableType>
<BitStart>0</BitStart>
<BitLength>1</BitLength>
<ShowAsBinary>0</ShowAsBinary>
<Address>Example.exe+ABC123</Address>
|
thank you |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25813 Location: The netherlands
|
Posted: Thu Oct 29, 2020 4:49 am Post subject: |
|
|
| Code: |
writeInteger(Address,readInteger(Address) & (~(((1<<BitLength)-1) << BitStart)) | ((NewValue & ((1<<BitLength)-1)) << BitStart))
|
_________________
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 |
|
 |
kucingkembar Advanced Cheater
Reputation: 0
Joined: 08 Oct 2020 Posts: 71
|
Posted: Thu Oct 29, 2020 5:22 am Post subject: |
|
|
thank you again dark byte,
additional question, do this only work on "WriteInteger"?
can it work on "WriteBytes" too?, just curious |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25813 Location: The netherlands
|
Posted: Thu Oct 29, 2020 5:24 am Post subject: |
|
|
yes, but keep in mind that writeBytes and readBytes behave differently than writeWord/Integer, etc... as writeBytes takes a bytearray and readbytes returns multiple bytes
and a byte is just a byte _________________
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 |
|
 |
kucingkembar Advanced Cheater
Reputation: 0
Joined: 08 Oct 2020 Posts: 71
|
Posted: Thu Oct 29, 2020 5:42 am Post subject: |
|
|
thank you again dark byte,
it clear for now,
anyway, will you add the ReadBit and WriteBit in the future?, just ask |
|
| Back to top |
|
 |
|