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 


Problems with injecting a dll

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
NotReq
Expert Cheater
Reputation: 0

Joined: 02 Jan 2007
Posts: 201

PostPosted: Sat Nov 03, 2007 4:38 pm    Post subject: Problems with injecting a dll Reply with quote

Hi all, I'm constantly getting a rather annoying error while injecting a dll but I can't find what's the problem.

Basically I hook CreateProcessA API and check when a certain applicaion starts


Code:
      invoke strcmp, eax, addr szGameMon
      .IF eax==1
         invoke  OutputDebugString, addr szInjectString
         invoke injectRoutineEX, dword ptr ds:[esp+40]
     .ENDIF


Where dword ptr ds:[esp+40] is a pointer to PROCESS_INFORMATION structure. In my injectRoutineEX I get the just created in CreateProcessA API handle to the process

Code:
    push    EDI
    mov     EDI, procInfo
    mov     eax, ds:[EDI]
    mov     realHandle, eax


then I do the usual routine with allocating needed memory region using VirtualAllocEx, copy the dll's name there, getting LoadLibraryA's address etc, I double checked everything and it works, then I call


Code:
invoke  CreateRemoteThread, realHandle, NULL, 0, dwLoadLibraryA, allocatedStr, 0, NULL


and it successfully returns the created thread handle and that's where GG/GM crash, it seems that the dll don't even get injected and it seems to be GG's problem... so I'm completly lost here, is thera good code sample written in asm of injecting dlls?
Back to top
View user's profile Send private message
Renkokuken
GO Moderator
Reputation: 4

Joined: 22 Oct 2006
Posts: 3249

PostPosted: Sat Nov 03, 2007 5:27 pm    Post subject: Reply with quote

Here.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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