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 


Dll Injection With Lua

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

Joined: 12 Jul 2014
Posts: 14

PostPosted: Sat Jul 12, 2014 5:01 am    Post subject: Dll Injection With Lua Reply with quote

What I want to do is automatically inject a DLL when a client starts.

For example, Instead of going to tools>inject DLL, i need a faster way.

This reason is because after the client starts, when you inject it, it will exit.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sat Jul 12, 2014 6:27 am    Post subject: Reply with quote

If your client doesn't need a special launcher you can launch it yourself with debugging and change the entry point to a dll injector routine

e.g: this loads a dll in a program at specific paths (just change them yourself)
Code:

function debugger_onBreakpoint()
  autoAssemble([[
    alloc(function, 1024)
    registersymbol(function)

    alloc(cancontinue,4)
    registersymbol(cancontinue)

    alloc(dllpath, 1024)

dllpath:
  db 'F:\svn\Cheat Engine\bin\speedhack-i386.dll',0

function:
  cmp [cancontinue],1
  jne function
  push dllpath
  call loadlibrarya
  jmp ]]..string.format('%8x',EIP))

  EIP=getAddress('function')
  debug_continueFromBreakpoint(co_run)



  return 1
end

errorOnLookupFailure(false)

createProcess([[F:\svn\Cheat Engine\bin\tutorial-i386.exe]], '', true, true)


--create a timer to check when the dll loader script has been injected as detachIfPossible() isn't possible from inside onBreakpoint
t=createTimer(nil)
t.Interval=1
t.OnTimer=function(sender)
    if getAddress('cancontinue')~=0 then
      detachIfPossible()
      writeInteger('cancontinue',1)
      sender.destroy()
    end
  end
t.Enabled=true


If it does require a launcher, then try a timer that constantly tries to open the process and when it succeeds call the injectDll function on it (it's less accurate though and you may be missing some things)

_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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