Solved

how to insert my DLL into a console application?

Posted on 2002-06-29
6
231 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 25

Accepted Solution

by:
clockwatcher earned 50 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 learn how to clear a vector as well as how to detect empty vectors in C++.

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now