Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

overloading - LD_PRELOAD equivalent for Windows to preload shared libraries

I'm trying to do exactly what LD_PRELOAD does, i.e. preload a shared library or DLL files on Windows to a given program to override certain functions.

Is there a LD_PRELOAD equivalent for Windows?

I don't have any specific functionalities in mind. I just know that this is possible on Linux, and I'm curious about how overloading a native DLL can be done on Windows.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

AppInit_DLLs.

http://support.microsoft.com/kb/197571

But see also:

AppInit_DLLs should be renamed Deadlock_Or_Crash_Randomly_DLLs

https://blogs.msdn.microsoft.com/oldnewthing/20071213-00/?p=24183/

You may also want to look into "DLL Injection". Four approaches (including AppInint_DLLs) are described here:

http://en.wikipedia.org/wiki/DLL_Injection


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...