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 write bit value

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

Joined: 08 Oct 2020
Posts: 71

PostPosted: Thu Oct 29, 2020 4:25 am    Post subject: how to write bit value Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25812
Location: The netherlands

PostPosted: Thu Oct 29, 2020 4:49 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 71

PostPosted: Thu Oct 29, 2020 5:22 am    Post subject: Reply with quote

thank you again dark byte,

additional question, do this only work on "WriteInteger"?
can it work on "WriteBytes" too?, just curious
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25812
Location: The netherlands

PostPosted: Thu Oct 29, 2020 5:24 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 71

PostPosted: Thu Oct 29, 2020 5:42 am    Post subject: Reply with quote

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
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