View previous topic :: View next topic |
Author |
Message |
beagle Cheater Reputation: 0
Joined: 27 Aug 2014 Posts: 36
|
Posted: Sat Feb 04, 2017 9:17 pm Post subject: How to "Open File" instead of OpenProcess? |
|
|
I have a fully functional trainer made with cheat engine lua which uses AoBScan autoassemble scripts, but i would like to convert it to a patcher.
So rather than use OpenProcess to attach to an .exe running in memory, i want to have lua open the .exe file itself and allow me to activate my autoassemble scripts and directly write to the .exe.
Essentially i want to have lua do the same thing that cheat engine does when you manually open file through the process list.
Can this be done?
Thanks
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sat Feb 04, 2017 11:50 pm Post subject: |
|
|
Code: | local f = io.popen("myfile.exe","r")
print(f:read("*a")) --- to get the output |
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
|
Back to top |
|
|
beagle Cheater Reputation: 0
Joined: 27 Aug 2014 Posts: 36
|
Posted: Sun Feb 05, 2017 12:16 am Post subject: |
|
|
Corroder wrote: | Code: | local f = io.popen("myfile.exe","r")
print(f:read("*a")) --- to get the output |
|
i think i've tried this before but i couldnt get anywhere with it. i dont know how to get this to work with auto assemble scripts eg: Script1=getAddressList().getMemoryRecordByDescription('Script1')
Zanzer wrote: | Wait for the next version of cheat engine. :) |
Glorious! This is what i've been waiting for. Is there a timeline for when this will be released?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Sun Feb 05, 2017 3:02 am Post subject: |
|
|
After flying pigs have landed on the frozen plains of hell (soon I think) and the todo list and most reported bugs are fixed/done
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
akumakuja28 Master Cheater Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
Posted: Sun Feb 05, 2017 4:14 am Post subject: |
|
|
Dark Byte wrote: | After flying pigs have landed on the frozen plains of hell (soon I think) and the todo list and most reported bugs are fixed/done |
WTF lol, this forum went crazy today.
As for the OP question IDK what you want to do. BUT, if im understanding it correctly you basically wanna strip the codes of the trainer to be used in a basic CE program? Well...... thts not lua.
Or are you asking how to do a permanent inject with lua then save the file?
Yes you can do this but why would you want too. Problems will happen alot.
idk
_________________
|
|
Back to top |
|
|
beagle Cheater Reputation: 0
Joined: 27 Aug 2014 Posts: 36
|
Posted: Sun Feb 05, 2017 4:23 am Post subject: |
|
|
Dark Byte wrote: | After flying pigs have landed on the frozen plains of hell (soon I think) and the todo list and most reported bugs are fixed/done |
that's great to hear, very excited, i've wanted to do this for months
akumakuja28 wrote: |
As for the OP question IDK what you want to do. BUT, if im understanding it correctly you basically wanna strip the codes of the trainer to be used in a basic CE program? Well...... thts not lua.
Or are you asking how to do a permanent inject with lua then save the file?
Yes you can do this but why would you want too. Problems will happen alot.
idk |
i essentially just want to be able to use my regular lua trainer to open the file .exe and apply the autoassemble scripts to it as if it were a running process, but it looks like it cant do that yet.
you can already do this just by manually opening the file from the process list window and then applying your script, but it would be cool to be able to make a lua patcher that can do all of this automatically with the click of a button :)
this upcoming change will allow for me to do this, so im excited :D
"openFileAsProcess(filename,is64bit): causes cheat engine to open the file with memory access as if it's a process"
|
|
Back to top |
|
|
++METHOS I post too much Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sun Feb 05, 2017 4:31 am Post subject: |
|
|
Why can't you use shellExecute and openProcess, then just add your autoAssemble to your script?
Anyway, there are other tools that will allow you to create memory loaders and patchers. That said, as akumakuja28 pointed out, you may need to incorporate checks or delays to avoid any issues with dynamic memory that gets executed at run-time (e.g. trying to patch memory that hasn't been initialized yet at startup) - assuming you want it to auto-patch.
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sun Feb 05, 2017 4:56 am Post subject: |
|
|
Quote: | i essentially just want to be able to use my regular lua trainer to open the file .exe and apply the autoassemble scripts to it as if it were a running process, but it looks like it cant do that yet.
|
I am not a native speaker, so i trying to understand the matter. From quote above :
- you have regular CE trainer
- you a have a exe file (assume it as a local exe file)
so, to open (running) your exe file from your CE trainer, then use
Code: | shellExecute(path to your exe file) -- if this correct then 'your exe file' has ran an stay in memory |
- next you want apply AA script to 'your exe file'
you can do this from you CE trainer script file by put your AA script / AA script for injection there under lua script.
Maybe something like that...
|
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 54
Joined: 01 Oct 2008 Posts: 941
|
Posted: Sun Feb 05, 2017 5:05 am Post subject: |
|
|
The menu command "Open File" can be used like this:
Code: |
local mf = GetMainForm()
local _openFileAsProcess = mf.miOpenFile.OnClick -- get menu action
_openFileAsProcess(mf) -- seems not work without 'mf', or more extra parameter given.
|
Test with *.cetrainer but not *.exe. The attached *.cetrainer is unproctected, may change the extension to *.ct to view in ce.
OOPS:
sorry the *.cetrainer not properly close itself (process stay in taskmanager), and the directory is mistaken.
It is not related to the usage of the menu action, I'm not used to trainer and directory detail.
It is deleted.
Update with *.ct.
If tried with previous *.cetrainer, close CE and delete idle CheatEngine process in TaskManager, it may hold the file handle prevent it to be modified.
The open dialog should open the most recent *.ct opened directory, but the test file should be in CE Installed directory.
NOTE:
there is no ce symbol generated, not the "process" variable (usually the *.exe name, but empty in this case ). It may not do what OP wanted.
May be the new version support more.
bye~
ADDED:
The attached *.ct is deleted since it is problematic.
The script will write the file opened with some text in the beginning,
without enough information or warning to the user.
Luckily it seems Corroder is only victim. Sorry Corroder.
The edit (the writeString or running an AA script) to the file is immediately and may not be undo, the command should be use with cautious.
_________________
- Retarded.
Last edited by panraven on Sun Feb 05, 2017 7:28 am; edited 5 times in total |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sun Feb 05, 2017 5:15 am Post subject: |
|
|
Yup, panraven bro...
Tested and output file only give two line : - Original : and - File Content..
nothing else...
Regards
|
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 54
Joined: 01 Oct 2008 Posts: 941
|
Posted: Sun Feb 05, 2017 5:26 am Post subject: |
|
|
Corroder wrote: | Yup, panraven bro...
Tested and output file only give two line : - Original : and - File Content..
nothing else...
Regards |
Is a file dialog opened?
_________________
- Retarded. |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sun Feb 05, 2017 7:02 am Post subject: |
|
|
panraven wrote: | Corroder wrote: | Yup, panraven bro...
Tested and output file only give two line : - Original : and - File Content..
nothing else...
Regards |
Is a file dialog opened? |
Yes, fileDialog opened. and i choose many type file to open when open file dialog prompted, eq. existed CT file, txt, exe, etc.
After clicked the file to opened, lua engine just give a result as an address 'FFFFFFF' and a new file without extension created in same folder with opened file. When open that new file created using notepad++, it just contain two lines : - Orlginal and - File Content :. Nothing else.
Regards
EDIT :
Tested Updated CT file :
Opened file E:\CRDR-Tool.ct
Result as picture attach and no new file created at the opened folder.
also no result for :
Code: | print(fileGet(target)) |
Oops, sorry, it's creating a new file "test_openFileAsProcess" on C;\ProgramFiles\cheat engine folder
Contains of the test_openFileAsProcess : - Orlginal and - File Content :. Nothing else.
Description: |
|
Filesize: |
20.91 KB |
Viewed: |
19519 Time(s) |
|
|
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 54
Joined: 01 Oct 2008 Posts: 941
|
Posted: Sun Feb 05, 2017 7:28 am Post subject: |
|
|
The attached *.ct is deleted since it is problematic.
The script will write the file opened with some text in the beginning,
without enough information or warning to the user.
Luckily it seems Corroder is only victim. Sorry Corroder.
You may need to check the files opened if they are damaged by my script.
The edit (the writeString or running an AA script) to the file is immediately and may not be undo, the command should be use with cautious.
_________________
- Retarded. |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sun Feb 05, 2017 9:23 am Post subject: |
|
|
Quote: | The script will write the file opened with some text in the beginning,
without enough information or warning to the user.
|
No problem panraven bro,
Yes the CT file made a little change in the beginning of my CRDR-Tool.ct.
Code: | this line :
<?xml version="1.0" encoding="utf-8"?>
has changed to (somethink like this)
modi&ion="1.0" encoding="utf-8"?> |
and this make error then CRDR-Tool.ct can't open incase Data Error.
But i've fixed the problem. just open with windows notepad and put back this line <?xml version="1.0" encoding="utf-8"?>, save as ct file and problem fixed. CRDR-Tool.ct can open properly.
Beside, i have backup files for my scripts.
Never mind and regards..
|
|
Back to top |
|
|
|