sandbeagle How do I cheat?
Reputation: 0
Joined: 30 Dec 2007 Posts: 2
|
Posted: Thu Jun 23, 2016 5:37 pm Post subject: Patching a File with Lua |
|
|
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 |
|