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 dereference in lua?

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

Joined: 27 Feb 2023
Posts: 59

PostPosted: Mon Apr 10, 2023 7:40 am    Post subject: How to dereference in lua? Reply with quote

Hey guys,

I am just wondering how to dereference pointers in lua? in c++ I can just use *, but im not sure if i need an external library like ffi in lua. I need to dereference the address in R8

local gameFunction= 'game.exe+83360'
local RCX = 0x203AA3FA6B0
local RDX = 0x3
local R8 = 0x7C879FF200 --> How do i dereference this
local R9 = 1295


executeCodeEx(0, nil, doAction,
{0, RCX},
{0, RDX},
{0, R8},
{0, R9}
)
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Mon Apr 10, 2023 10:58 am    Post subject: Reply with quote

If the C++ code were running in a different process, you'd have to use ReadProcessMemory, not `*`
Lua code:
Code:
readPointer(0x7C879FF200)

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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