How to inject a dll into a process and extract a bitmap from a static control?

philter
philter used Ask the Experts™
on
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
I need help writing the dll that will enumerate over the child windows and find the bitmap...I need to extract info out of a closed source app...

Commented:
Refer
http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_20371701.html

I already posted the code to inject dll into another process space.
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

this might help

"Load Your 32-bit DLL into Another Process's Address Space Using INJLIB"

http://www.microsoft.com/msj/code1993to1997/MSJMAY94.exe
By the way most of these articles discuss the use of CreateRemoteThread and other registry methods to load dll into other processes .. theres another eaiser way of doing that by using ShLoadInProc.

i guess you might have a look at that too..

Commented:
I'm probably missing the point, (maybe you need this in real time)but...
you can open the exe in the resource editor if it is just a static bitmap you want to acquire. (Plus if the window is visible you don't need to get into his address space to simply blit your own copy of a visible bitmap.)

Author

Commented:
Ggrundy - yes, if all i needed was a static screen shot, I'd just hit the Print Screen key ;-)  Too bad this isn't that easy...

Author

Commented:
BeyondWu,

hook.cpp(67) : error C2491: 'SubClassWindowEx' : definition of dllimport function not allowed

http://www.complete-ideas.com/cpp/testhook.zip
Commented:
Your project is not correct, it mixed three individual projects together, maybe you haven't see my comments clearly. Let me explain it.

There two dll, and one exe.
one is a system hook dll, used to set up a system hook.
you need to create a new plain "Win32 Dynamic-Link Libraray", and then add the code of hook.h and hook.cpp
(NO MFC)
the secend is another dll used to reside in other process space. I call it resident-dll, you should also need to create a new plain "Win32 Dynamic-Link Libraray" without MFC, then add the code of residentdll.h,residentdll.cpp.
The last is an MFC test program, I think you know how to create a MFC EXE file, and then copy the test code snippet(void CTesthookDlg::OnButton1()...) to your msg-handler.

Author

Commented:
maybe i need to hire you BeyondWu as a consultant (to help me with this) philyer@hotmail.com if you are interested...

Commented:
Hehe...Seems good.
My email is BeyondWu@yahoo.com

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial