I have a handle to a bitmap in another process. If it was in my process I could get a copy via GetObject(hBitmap), but this doesn't work across processes (I thought GDI objects WERE global, but clearly I'm wrong).
Can this injection technqiue solve my problem?
Any advice/comments would be gratefully received!!
Thanks for an excellent foundation for this sort of thing! This saved me lots of time.
I implemented another reader's suggestion to call GetLastError instead of "? 0 : 1", but let's face it, you usually know what the error is ;)
The code did not work in debug mode in my project, as taking the address of a function yieled the address of a jmp table entry instead of the function itself. I'm not sure what option this is, but it should probably be mentioned alongside /GZ.
(I took a much more brute force approach... if RemoteThread() is called with NULL, it returns the current eip. By comparing this result with the address of the function, I can tell if I have to do function import fixup or not.)
I also rigged mine to work by exe name instead of process id, but that belongs in a psapi sample :)
I want to retrive a control's object( to retrive it's properties) which is lying in other application . I have hooked this application' process by a dll .
I am getting all the properties of the control if the application(In which control resides) is writeen in VC++,
But on VB based application I am not getting the poperties.
Why is it so?
Is there any way possible.
I want to retrive a control's object to retrive it's properties, which is lying in other application .What I managed to do is hooking up this application' process by a dll .Now I could send messages to this contol ,but How to get the acess the contol's object to retrive it's properties directly.
Does this source code only work for systems running Windows NT/2000? If so would you have any other code snippets that I could use in order to inject a DLL into a process running on a Windows 9x box? Thanks
in normal thread creation we never allocate memory in process for thered, why do we need that for remote creation....(i have also done the same thing....not as cleanly as u did but have it done....now i am improving my code...thanx to u)to me the reason is the requirement of createremotethread()(at least i have done coz of the function requirements)....but what if this created thread outs another thread....i mean if injected dll creates another thread by normal createthread() function.....in which process memory would the new thread will execute....the process that injects the dll or the target process(to me the target process)....if target process than what are the possibilities of crash as no memeory is allocated for the new thread....now i am trying to do that....till now with no problems.....my thread is working nicely....but it will be cool...if some one like u can assure me the thing
thank u very much for the code....n more thanx in advance if u can guide me a little further on this thread issue