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 communicate between lua and assembly?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Wene
How do I cheat?
Reputation: 0

Joined: 19 Dec 2019
Posts: 1

PostPosted: Thu Dec 19, 2019 6:44 pm    Post subject: How to communicate between lua and assembly? Reply with quote

My problem is pretty simple, in what way can u communicate between lua and assembly?

I'm pretty new to programming in cheat engine, I can program in LUA, but I've never tried to program in Assembly.

Is there some kind of specialized code to send a value from Assembly to LUA and then send it back from LUA?

Some info on the subject would be nice. Question

I tried running this simple code, but it only gave me errors.
Here's the code I tried out:
Code:

newmem:
{$lua}
--Lua code
print(rbp)
{$asm}
code:
  mov [rax], rbp
  mov eax,[rsi]
  jmp return

INJECT:
  jmp newmem
return:
registersymbol(INJECT)
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4715

PostPosted: Thu Dec 19, 2019 8:54 pm    Post subject: Reply with quote

{$lua} blocks in an AA script are run only once when the script is assembled. They aren't run every time the code in newmem is run.

Read this topic for an example of how to call a CE Lua function from another process:
https://forum.cheatengine.org/viewtopic.php?t=605733

_________________
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