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 


Cheat Engine Trainer Form

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

Joined: 13 Jan 2012
Posts: 7

PostPosted: Mon Jan 23, 2012 9:23 pm    Post subject: Cheat Engine Trainer Form Reply with quote

Hi,

When I create an EXE trainer, is there a way to disable the form, and just have the forms I create with Lua, or should I create the form in the designer and use that.

Also I want to know if I there is a way to check if a DLL is injected, so that I don't try to inject it twice.

I also want to check if this is BP when running a function in the DLL from Lua:

Code:
injectDLL("y:\\dev\\mydll.dll");
    reinitializeSymbolhandler();

    autoAssemble(
        "globalalloc(tempfunc, 1024)\n" ..
        "tempfunc:\n" ..
        "mov eax, my_init\n" ..
        "call eax\n" ..
        "ret\n"
        );

    autoAssemble( "CreateThread(tempfunc)\n" );


If I pack the DLL in the EXE what is the path to the DLL, that I should use with injectDLL?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Mon Jan 23, 2012 9:55 pm    Post subject: Reply with quote

Just create your own form and write the script that is usually automatically generated for you manually (The trainerscript generator is as it's name says, just a simple script generator based on the config you give)

Just make sure that your script when executed at least shows one form (CE picks the icon of the first visible form for the taskbar)

as for checking if a dll is injected try to keep track of that yourself (e.g a global variable that when injected is true)
also, it's not really a problem if a dll gets injected multiple times, loading a dll a second time just increases it's reference count

(alternatively, run an aa script that accesses a dll export and check if it fails or not)

You can add the dll as a tablefile which you can extract when loaded.
Code:

yourdllTF=findTableFile('yourdll.dll')
tablefile_saveToFile(yourdllTF, "Pathtodllextraction\\yourdll.dll")
injectdll("Pathtodllextraction\\yourdll.dll")

You can make use of getCheatEngineDir() if you wish to write it to the place CE's exe is

tip:
You can make use of [[ ]] as strings
e.g:
Code:

    autoAssemble([[
        globalalloc(tempfunc, 1024)
        tempfunc:
        mov eax, my_init
        call eax
        ret
    ]]);


as for
Quote:

I also want to check if this is BP when running a function in the DLL from Lua

No idea what you mean with BP (breakpoint?)

(tip2: No need to set eax to the address of my_init, you can directly call my_init)

_________________
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
View user's profile Send private message MSN Messenger
bolav
How do I cheat?
Reputation: 0

Joined: 13 Jan 2012
Posts: 7

PostPosted: Mon Jan 23, 2012 10:01 pm    Post subject: Reply with quote

Thanks for the help.

Quote:
as for checking if a dll is injected try to keep track of that yourself (e.g a global variable that when injected is true)
also, it's not really a problem if a dll gets injected multiple times, loading a dll a second time just increases it's reference count


I was thinking more if my trainer was restarted, and the game is not. The game crashes, but that is probably because of my init then. I could fix the DLL to not run init if it is already inited.

Quote:
Not really sure what you mean with that.


Just if this is the preferred way to call a function in the DLL from Lua.
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