NotReq Expert Cheater
Reputation: 0
Joined: 02 Jan 2007 Posts: 201
|
Posted: Sat Nov 03, 2007 4:38 pm Post subject: Problems with injecting a dll |
|
|
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?
|
|