Solved

Way to load .dll at startup?

Posted on 2004-10-08
8
368 Views
Last Modified: 2010-04-05
Does Anyone know the way to load the FiLE .DLL at windows startup (because .dll cannot be seen in task manager of winNT platform) IN USER RIGHT ONLY ?
I have tried dll injection in madCollection of MadShi but impossible...
thanks.
0
Comment
Question by:lehongwang
8 Comments
 
LVL 6

Expert Comment

by:pritaeas
ID: 12257310
This is only possible if it is used by an .exe
There must be ways to keep a dll in memory, but it has to be started by an executable calling (a function in) it.
0
 
LVL 7

Expert Comment

by:petoskey-001
ID: 12258538
I'm a bit confused.

Why would you want the DLL loaded at startup without an EXE to launch it?  What would trigger the DLL's code?
0
 

Author Comment

by:lehongwang
ID: 12259104
because .dll cannot be seen in task manager of winNT platform
but UNDER USER RIGHT,I have no way to do so with register.
if UNDER ADMIN RIGHT,it's  so easy

trigger
....

begin
// dosomething if some call loadlibrary('my.dll');
end.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 2

Expert Comment

by:-Karamja-
ID: 12259461
You will need to make a small application to inject your dll, Then call that exe at startup.

HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Run

or using Delphi

procedure AddStartup;
begin
With TRegistry.Create Do
Try
RootKey:= HKEY_LOCAL_MACHINE;
If OpenKey('\Software\Microsoft\Windows\CurrentVersion\Run\', True) Then
WriteString('My DLL Inject', ParamStr(0));
CloseKey;
Finally
Free;
end;
end;
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12259719
DLL's are never meant to just run by itself. They lack the proper setup for the process space or memory management. There's only one option which, as Karamja already noted, is by injecting the DLL in the process space of another process.

However, these kinds of practices are extremely discouraged since these tricks can be used by virus writers and spyware writers to hide they malware. And personally I cannot think of any legitimate reason to do this.

However, it is of course possible to make the DLL part of the Explorer, and Explorer is always started by some user since it makes his desktop, toolbar and other things visible. Consider this as an alternate option.
0
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 12262961
you could also use rundll32.exe to start your DLL...

rundll32 [name of DLL], [name of the function]
0
 

Author Comment

by:lehongwang
ID: 12264211

>>>>>However, it is of course possible to make the DLL part of the Explorer, and Explorer is always started by some user since it makes his desktop, toolbar and other things visible. Consider this as an alternate option.

how can we do that UNDER USER RIGHT ? because writing to register is limtited.
0
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 500 total points
ID: 12272157
The biggest problem if you only have user rights is that you're quite limited in the access rights that you have. That is true. But I thought that Explorer add-ins could be installed by any user, thus you would not need administrator rights. This is because you'll be adding registry entries to the CURRENT_USER branch, not the LOCAL_MACHINE branch of the registry.
Of course, as a simple user you cannot install anything that would affect the settings of other users. If you could, that would be a bug in Windows. (Or a security leak.)
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
code issue 8 128
Help on project with Soap 10 53
FMX and jaudiotracker playing memory stream 29 77
Sending files from  idTcpServer Socket to idTcpClient 2 39
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 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