Click to See Complete Forum and Search --> : URGENT - DLL Initialize Calling for Win9x/Me Possible?


quantass
December 17th, 2004, 12:13 AM
I have code that injects a DLL into another process ... works fine .. but i need to call an "Initialize()" routine to have this DLL started. The problem is ... the only way i have been able to call a remote function existing in another process (because recall my dll was "injected" into another process) is to use the CreateRemoteThread(...) function ... It works but ONLY for Win2k/XP ONLY ...

Is there a Win API that will allow me to execute my initializing routine for Win9x/Me Os's? Or is this an impossible feat?

Thank you.

NoHero
December 17th, 2004, 02:00 AM
Please be more exactly:

* Is the other program self written?
* What kind of DLL is it?
* Why don't you load this dll on your own?
* Why just don't you enumerate all modules loaded by the process search for it, open it and use this as HMODULE member of the 'GetProcAddress' function?

quantass
December 17th, 2004, 09:49 AM
Please be more exactly:

* Is the other program self written?
* What kind of DLL is it?
* Why don't you load this dll on your own?
* Why just don't you enumerate all modules loaded by the process search for it, open it and use this as HMODULE member of the 'GetProcAddress' function?

My appologies...


* Is the other program self written?

This other program (call it Process B) is written by a different person ... think of it as a 3rd party tool you find on the net. I am "injecting" my DLL into this "other program" through the process of making the other process "think" its being debugged and setting breakpoints. This is done simply because the NT way of injecting (using thinkgs like CreateRemoteThread) dont exist on Win9x/Me platform.


* What kind of DLL is it?

Not sure what you mean by this sorry ... i haven't written up a dll in about 2+ years so my memory is very choppy on all of this. My DLL has things like subclassing and hooking (api hook for the GetSaveFilename). It also creates and displays gui components on the process it is injected into.


* Why don't you load this dll on your own?

This dll must be injected by my "loader" (call it Process A) into Process B. Process B has no clue how to load my dll into itself and so Process A makes that possible.


* Why just don't you enumerate all modules loaded by the process search for it,

I am not in the running process so i can't enumerate all modules. And when i am in the running process (thru injection) i can't tell that process (Process A) to enumerate and look for it simply because it has no desire to. This definitely can't be done. Only way is to have Process B inject the DLL into Process A and have Process B tell Process A to start an initialization function existing in my injected DLL so my DLL can be initialized. Hope this makes sense.

I can't see any easy way to inject my DLL into another running process WITH the ability to call an iniltialization routine inside that DLL on Win9x/Me platforms. I was able to inject the DLL through the "debugging" technique but havent figured out the initialization part. BTW for the initialization i MUST be able to subclass, and hook and create and display GUI components. That initialization will likely use LoadLibrary/FreeLibrary calls which now definitely rules out my initialization being done in the DllMain function, thus the reason for me NEEDING a way to call my own DLL function from Process A.

NoHero
December 17th, 2004, 11:09 AM
Yes. I see. Regarding to my knowledge there is no way to do this on an Win9x engine. But I have seen several programs - just take a look at these who style up your windows - who seemed to solve that. I am afraid I can't help you.