Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to insert my DLL into a console application?

Posted on 2002-06-29
6
Medium Priority
?
252 Views
Last Modified: 2012-08-13
hi all,

is anybody knows how to insert my dll into a console application, not a gui application. that means i want to insert my dll into an application which doesn't use user32.dll at all.


how to?
0
Comment
Question by:greensleeve
6 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 7119805
As with all DLLs, you load it using a call to:

LoadLibrary() from KERNEL32.DLL.  Then you find addresses for its export functions using GetProcAddress() also from KERNEL32.DLL.  There is no need for USER32.DLL.

BTW, technically speaking you DO NOT "insert" a DLL into any application.  Your application LOADS and then USES a DLL, but at no time is it "inserted".
0
 

Author Comment

by:greensleeve
ID: 7120154
thanks,but i mean i want insert my dll into other processes,i use hook technique, but hook only can insert my dll into those which use user.dll, for those not use user.dll, hook doesn't work.
0
 
LVL 32

Expert Comment

by:jhance
ID: 7120267
What does USER32.DLL have to do with "hooking" and the problem at hand?

Maybe if you explained your situation and what you are trying to do rather than trying to be mysterious, better advice could be offered.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 25

Accepted Solution

by:
clockwatcher earned 200 total points
ID: 7120385
I'm guessing he wants to use DLL injection to hook a console application.  He's probably currently using method 1 of the following article (which relies on USER32) to perform the DLL injection.

  http://www.codeguru.com/system/apihook.html


He may want to read the entire article for different methods of DLL injection-- or preferably pick up Jeffrey Richter's Programming Applications for Windows.

  http://www.amazon.com/exec/obidos/ASIN/1572319968/

But based on his other questions, he's probably trying to hook Winsock calls.  In which case, a proxy DLL may end up making the most sense.  There used to be a stub download available, but I can't find it now.  Here's a possible starting point.

  http://www.sockets.com/devtools.htm
0
 
LVL 11

Expert Comment

by:griessh
ID: 7262540
Dear greensleeve

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "clockwatcher"

comment(s) as an answer.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7332984
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question