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 


Patching a File with Lua

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

Joined: 30 Dec 2007
Posts: 2

PostPosted: Thu Jun 23, 2016 5:37 pm    Post subject: Patching a File with Lua Reply with quote

I'd like to make a lua script to patch an .exe directly rather than in memory, and have it use AOB scans to apply it to multiple file versions.

I have an auto assemble script that will write to the correct addresses in the .exe, but I have to open the file manually with CE and then activate the auto assemble script.

What i'd like is to make is a Lua script that will allow the user to browse for a file and open it, and then activate the AA script to patch the file.

However, I'm not sure how to do this using lua, since openProcess is only for running programs and i don't see an easy way to make it open a file instead.

This is what i've found so far, but i don't know how to relate it to CE's regular lua functions like aobscan and such.

dialog = createOpenDialog(self)
dialog.InitalDir = os.getenv('%USERPROFILE%')
if dialog.execute() == false then return end
FileName= dialog.FileName
local file = assert(io.open(FileName, "rb"))
local filedata = file:read("*all")
file:close()

Is there an easy way to have the trainer just open the file using lua?

Thanks
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