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 


Reading pointer in Binary type ( Lua ) (solved) !!!!

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Twistedfate
Expert Cheater
Reputation: 1

Joined: 11 Mar 2016
Posts: 231

PostPosted: Sat Oct 08, 2016 1:25 pm    Post subject: Reading pointer in Binary type ( Lua ) (solved) !!!! Reply with quote

Code:
function read()
  local x=readInteger([[[[[mygame.exe+module offset]+offset1]+offset2]+offset3]+offset4]+offset5")



I want my lua script read this pointer in Binary ( I choose 2 and the length 1 )
look the picture .
I want this to use this value in my script to compare If equal zero or one .

The question is How to read the pointer in binary like the picture? In lua script



010.jpg
 Description:
 Filesize:  42.51 KB
 Viewed:  9909 Time(s)

010.jpg




Last edited by Twistedfate on Sat Oct 08, 2016 4:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Sat Oct 08, 2016 1:33 pm    Post subject: Reply with quote

http://stackoverflow.com/questions/8695945/c-get-a-bit-from-a-byte
http://stackoverflow.com/questions/4854207/get-a-specific-bit-from-byte
Back to top
View user's profile Send private message
Twistedfate
Expert Cheater
Reputation: 1

Joined: 11 Mar 2016
Posts: 231

PostPosted: Sat Oct 08, 2016 3:14 pm    Post subject: Reply with quote

I canot understand this can u copy and past to my script please ?


I read main.lua there is
readInteger(address)
readFloat(address) etc

Is there something like that ?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Oct 08, 2016 3:16 pm    Post subject: This post has 1 review(s) Reply with quote

Code:

getAddressList().getMemoryRecordByDescription('pointerscan result').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
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 942

PostPosted: Sat Oct 08, 2016 3:27 pm    Post subject: Reply with quote

Lua 5.3 so ce 6.5+ added bitwise operator, so

For individual bit:
it is something show as is
Code:

a = readInteger(addr)
print((a >> 3)  & 0x01)


For bit field, ie. bit length,bn > 1 with start bit num, bs

something like:
Code:

print((a >> bs) & ((1<<bn) -1))



For ce 6.4, there are a set of bitwise function , bShr, bAnd, bXor ... etc.


bye~

_________________
- Retarded.
Back to top
View user's profile Send private message
cancandodo
Advanced Cheater
Reputation: 0

Joined: 09 Mar 2012
Posts: 62

PostPosted: Mon Dec 10, 2018 3:24 am    Post subject: Reply with quote

tks,i can read binary from integer num now
but the question is
how to write integer from binary?
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 Lua Scripting 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