Click to See Complete Forum and Search --> : injection problem


DiGitalX
September 21st, 2005, 09:03 AM
hi all,
i'm working on a project that uses dll injection but my problem is when i inject the dll into explorer.exe .... explorer stops responding :( why ??? ....... in a second test when iexplorer.exe is running before the injection it works ok...... i'm using win98.... and my code of injection is...........

DWORD PID, BytesWritten, ThreadId;
LPVOID Paramaters, Process, Thread;

char* DLL = "c:\\windows\\system32\\xvoice.dll";
GetWindowThreadProcessId(FindWindow("shell_traywnd", NULL), &PID);
Process = OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID);
Paramaters = xVirtualAllocEx(Process, NULL, 4096, MEM_COMMIT, PAGE_READWRITE);
WriteProcessMemory(Process, Paramaters, DLL, 4096, &BytesWritten);
Thread = xCreateRemoteThread(Process, NULL, 0, GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA"), Paramaters, 0, &ThreadId);
WaitForSingleObject(Thread, INFINITE);
xVirtualFreeEx(Process, Paramaters, 4096, MEM_RELEASE);
CloseHandle(Thread);
CloseHandle(Process);

I'm using ELiRT.h to implement x* functions and linked the project with ELiRT_COFF.lib (attached if you want to view them)

please ppl if there's any help let me know .... thanks in advance

Regards DiGitalX

golanshahar
September 21st, 2005, 09:11 AM
this may help: API Hooking Revealed (http://www.codeguru.com/Cpp/W-P/system/misc/article.php/c5667)

Cheers

DiGitalX
September 21st, 2005, 09:32 AM
thanks golanshahar but i need an injection by using loadlibrary & createremotethread technique

Regards DiGitalX

pengch
September 21st, 2005, 09:36 AM
createremotethread is a NT version API