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 


Assembly to Lua

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

Joined: 05 Aug 2020
Posts: 86

PostPosted: Sat Aug 08, 2020 2:06 am    Post subject: Assembly to Lua Reply with quote

Can someone convert this AA script to lua plz without using autoAssemble() function of lua??
It's a small code. I am a beginner to lua(not lua but the CE library functions in lua).It will be a great help to someone like me who is trying to learn how to create scripts in lua.
Code:

[ENABLE]
aobscanmodule(INJECT,gta_sa.exe,8B 08 8B 40 08 89 44 24 38 8D 85) // should be unique
alloc(newmem,$1000)
globalalloc(loc,4)
label(code)
label(return)
newmem:
mov [loc],eax

code:
  mov ecx,[eax]
  mov eax,[eax+08]
  jmp return

INJECT:
  jmp newmem
return:
registersymbol(INJECT)

[DISABLE]

INJECT:
  db 8B 08 8B 40 08

unregistersymbol(INJECT)
dealloc(loc)
dealloc(newmem)


If you have time try to explain the steps in comments plzzzzzzzz
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 98

Joined: 14 Jul 2007
Posts: 3356

PostPosted: Sat Aug 08, 2020 4:30 am    Post subject: Reply with quote

If you have no real reason to convert to LUA, then don't.
Assembly is much faster.
Back to top
View user's profile Send private message
sgsgwv$6263
Advanced Cheater
Reputation: 0

Joined: 05 Aug 2020
Posts: 86

PostPosted: Sat Aug 08, 2020 5:07 am    Post subject: Reply with quote

I just want to use some of its features like timers that assembly doesnot have.
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 98

Joined: 14 Jul 2007
Posts: 3356

PostPosted: Sat Aug 08, 2020 6:53 am    Post subject: Reply with quote

The code you posted is a hook - runs every time it's invoked inside the game and hence, you will always have current value.
No timer will do that.
Timers will get you momentary values.

Anyway, if it's timers you want, there are plenty of samples for that here, just search for OnTimer.
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