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 read 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: Wed Oct 28, 2020 4:07 am    Post subject: how to read bit value Reply with quote

i just want to ask,
this the syntax read memory,
Code:

readBytes
readSmallInteger
readInteger
readQword
readPointer
readFloat
readDouble
readString

but there no syntax to read bit
and this is data from cheat table
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>
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Wed Oct 28, 2020 4:29 am    Post subject: Reply with quote

readInteger(address) & (1 << bitnumber)

e.g
readInteger("Example.exe+ABC123") & (1 << 0)

or tonumber(AddressList.getMemoryRecordByDescription('test').Value)

_________________
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: Wed Oct 28, 2020 4:58 am    Post subject: Reply with quote

i just want to confirm

the 1 in (1 << 0) is the "BitLength"
and
the 0 in (1 << 0) is the "BitStart"

right?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Wed Oct 28, 2020 5:31 am    Post subject: Reply with quote

half. the 1 is a bitmask. if you want a longer bitlength you will have to calculate a bitmask. Easiest is mask=(1<<bitcount)-1

so if you want to use multiple bits then the formula is:
readInteger(address) & (((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: Wed Oct 28, 2020 5:33 am    Post subject: Reply with quote

ah, thank you very much
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