Delphi 7 - DLL Injection Freezing explorer.exe

Posted on 2012-08-20
Last Modified: 2012-08-20
Hi all.

I am injecting a DLL into explorer.exe and it works fine, but only for a little bit..Then explorer.exe freezes and the taskbar is unusable and explorer.exe needs to be restarted...

Injecting other DLL's seem to work fine..

In the code for my DLL it is using a While Loop (but I am using Sleep(1) to ensure it doesn't run up the cpu)..

I have also removed all creation of additional threads..meaning the DLL does not create any extra threads...

explorer.exe's memory does not seem to be running too high and neither is the cpu level...

I don't want to post the DLL code as it is

What are some ideas as to why this would freeze explorer.exe (or any other process I inject into as well).


It seems that it freezes whenever I hover over these icons:

Tested on Vista & Win7
Question by:DjRed
    LVL 36

    Accepted Solution

    some ideas:
    an endless loop with a while
    an endless loop with a repeat
    an endless loop with a goto >> god has forbidden this because of spaghetti coding

    madshi has a very good site with a dll injection technique:

    see the madcodehook for sources
    LVL 36

    Expert Comment

    by:Geert Gruwez
    an injection technique means you inject your call in a chain
    >> maybe you have broken the chain ?

    call first chain item
    >> first chain item calls next chain item
    >> next chain item calls next chain item

    if a chain item doesn't call the next chain item, the chain is broken and a freeze happens
    LVL 36

    Expert Comment

    by:Geert Gruwez
    you are aware that your technique is used by a lot of virusses ?
    this site is against creating or helping creating virusses ...

    just a warning at the moment:
    your private code statement is on the brink of asking the moderators to check this thread

    you could have posted your injection technique code and the loop.
    what the dll does is indeed your private code

    Author Comment

    @ Geert_Gruwez

    "you could have posted your injection technique code and the loop.
    what the dll does is indeed your private code"

    The loop is what the DLL is my DLL code..

    I am not programming malware.

    Author Closing Comment

    Removing the endless loop help's but in the end that is what I need in my code....

    Author Comment

    Seeing as the dll is injected into explorer.exe if i create a thread and the dll exists, the thread is actually running inside explorer.exe and still runs after the dll exists...

    = win for me. doesn't lag out.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Prime numbers are natural numbers greater than 1 that have only two divisors (the number itself and 1). By “divisible” we mean dividend % divisor = 0 (% indicates MODULAR. It gives the reminder of a division operation). We’ll follow multiple approac…
    Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    745 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

    16 Experts available now in Live!

    Get 1:1 Help Now