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 


injectDLL() question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
MErtHRMKsE
Newbie cheater
Reputation: 0

Joined: 02 Jul 2012
Posts: 21

PostPosted: Mon Jul 02, 2012 2:36 pm    Post subject: injectDLL() question Reply with quote

Is there any way to choose what function it'll run?

Exactly like when you do Tools > Inject DLL, it asks which function you want to run.

Thank you
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Mon Jul 02, 2012 2:58 pm    Post subject: Reply with quote

execute this:
Code:

autoAssemble('CreateThread(Exportnameofyourdllfunction)')

_________________
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
MErtHRMKsE
Newbie cheater
Reputation: 0

Joined: 02 Jul 2012
Posts: 21

PostPosted: Mon Jul 02, 2012 3:18 pm    Post subject: Reply with quote

Thank you! But I also have another question, I want to inject the DLL when example a process named 'abc.exe' is opened. I can also store the ID in a table to make sure I don't inject it twice but...

I tried doing this :

Code:

while true do
sleep(10)
end

but it also freezes CE and it crashes... help? :S
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Mon Jul 02, 2012 3:36 pm    Post subject: Reply with quote

you could add a "function onOpenProcess(processid)" function so you know when it opens a process
Just make sure you call reinitializeSymbolhandler() if you use scripts that make use of symbols inside that function

Also, use a timer instead of a loop

Alternatively you could add a "processMessages()" in the while loop so that timers will work. (and buttons and other gui objects too)

And the third option would be to create a nativeThread that does that loop

_________________
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
MErtHRMKsE
Newbie cheater
Reputation: 0

Joined: 02 Jul 2012
Posts: 21

PostPosted: Mon Jul 02, 2012 3:50 pm    Post subject: Reply with quote

I know I didn't mention this but... I'm using the Lua engine :s


How can I create a timer?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Mon Jul 02, 2012 4:23 pm    Post subject: Reply with quote

I know, and the functions and methods I mentioned are all lua functions (I implemented a lot of object pascal into lua)

to create a timer:
Code:

function mycheck(sender)
  --check stuff
  --if found
  object_destroy(sender)
end

t=createTimer(nil)
timer_setInterval(t, 10) --check every 10 milliseconds
timer_onTimer(t, mycheck) --set the function to call
timer_setEnabled(t,true) --activate it if it wasn't active yet

_________________
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
MErtHRMKsE
Newbie cheater
Reputation: 0

Joined: 02 Jul 2012
Posts: 21

PostPosted: Mon Jul 02, 2012 4:41 pm    Post subject: Reply with quote

Thank you so much Very Happy!
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