Shoutbox

DLL Injection (ASM and API) - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: DLL Injection (ASM and API) (/showthread.php?tid=35217)

DLL Injection (ASM and API) by Ash_ on 12-04-2004 at 10:05 AM

i need to create a hook in another program to a dll i create.

im gonna open the process using the OpenProcess API call.
then free-up some memory using the VirtualAllocEx API.
then write in that memory with the WriteProcessMemory api call.
then get addy of the LoadLibrary using the GetProcAddress api
then create a remote thread in the process using API.
then get rid of the memory in the process.

is this the correct way to Inject dlls or is there an easier way?

thanks in advance.


RE: DLL Injection (ASM and API) by TheBlasphemer on 12-04-2004 at 11:45 AM

Remote DLL injection is much simpler,
First VirtualAlloc a bit of memory where you will write the DLL's filename with WriteProcessMemory.
After that call CreateRemoteThread with a pointer to LoadLibrary (since it's in the kernel dll, the address will be the same everywhere), and a pointer to the just allocated memory
wait for the thread to end
and then deallocate your memory,
your dll should then be loaded :)


RE: DLL Injection (ASM and API) by Ash_ on 12-04-2004 at 12:14 PM

thanks TB youve saved me alot of mucking around.


RE: DLL Injection (ASM and API) by RaceProUK on 12-05-2004 at 03:33 PM

quote:
Originally posted by Ash_
thanks TB youve saved me alot of mucking around.
Actually useful to me too.
Now to figure out, with the injected DLL, how to get an IMessenger3 pointer...