Solved

Pure Invisible & Hidden application

Posted on 2000-04-29
9
262 Views
Last Modified: 2013-11-20
Is there a way to hide an application completely in Windows 95 and above?
I mean, hidden from taskbar, taskmon, the screen AND PROGRAM MANAGER!!

This is a tough one!
0
Comment
Question by:Aphroditus
9 Comments
 
LVL 1

Expert Comment

by:Rheingold
ID: 2762607
Hi

yes, there are ways to do that. Here is the Delphi source to hide your app from the task manager. Yeah, I know we're in MFC area here, but I just have this example and at least you know which API to use. I don't know if it works on Win2K or WinNT though.

Procedure StealthMode;
Var hNdl:hwnd;
    RegisterServiceProcess: TRegisterServiceProcess;
begin
        hNdl:=LoadLibrary('KERNEL32.DLL');                               // Load Library!!
        RegisterServiceProcess:=GetProcAddress(hNdl, 'RegisterServiceProcess'); // Find loc.
             RegisterServiceProcess (GetCurrentProcessID, 1);  // Into stealth mode
        FreeLibrary(hNdl);                                // Good programming practice
end;

Regards
0
 

Author Comment

by:Aphroditus
ID: 2762828
I don't understand this bit of code at all since its all Pascal...

Could you explain with C++ Windows API instead?
0
 

Author Comment

by:Aphroditus
ID: 2762843
I don't understand this bit of code at all since its all Pascal...

Could you explain with C++ Windows API instead?
0
 
LVL 1

Expert Comment

by:poohbear_68
ID: 2762952
Try this code.  It's translated from Rheingold's code.

   typedef UINT (CALLBACK* LPREGISTERSERVICEPROC)(DWORD,DWORD);

   HINSTANCE hDLL = LoadLibrary("KERNEL32.DLL");
   if(hDLL)
   {
      LPREGISTERSERVICEPROC lpRegisterServiceProc =
         (LPREGISTERSERVICEPROC)GetProcAddress(hDLL, "RegisterServiceProcess");

      if(!lpRegisterServiceProp)
      {
         // handle the error
      }
      else
      {
         // call the function
         DWORD dwRet = lpRegisterServiceProc(GetCurrentProcessId(), 1);
      }
     
      FreeLibrary(hDLL);      
   }
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 11

Expert Comment

by:mikeblas
ID: 2764141
Note that RegisterServiceProcess is an undocumented API--remember to heed all the caveats that go with using undocumented features. A lso, remember that the effect of the API is to allow an app to continue to run even after the user has logged off.

You can find a sample which hides an app using documented APIs by checking out the STEALTH.ZIP sample at http://www.nwlink.com/~mikeblas/samples/ . (Note that my website will someday move to http://www.mooseboy.com/ )

..B ekiM
0
 
LVL 2

Accepted Solution

by:
JunHaan earned 142 total points
ID: 2777542
To actually hide your application from the windows Task Manager is simple, you'd just need to unregister your application's process service...
Here's some code you could follow :

first, declare some global variables and our function prototype :
void __fastcall reg(bool which); //function prototype

//Globals
typedef DWORD (WINAPI *TRegisterServiceProcess)(DWORD,DWORD);
bool registered=false;

then, insert this code anywhere in your app:
void __fastcall reg(bool which)
{
     HMODULE hmod;
     TRegisterServiceProcess pReg;
     hmod = LoadLibrary("kernel32.dll"); //Load kernel32.dll

     if (!hmod) return; //return if unable to load kernel32.dll
     (TRegisterServiceProcess) pReg = (TRegisterServiceProcess)::GetProcAddress(hmod,"RegisterServiceProcess"); //Get the process address to RegisterServiceProcess
     if (!pReg) {FreeLibrary(hmod); return;}
     else
     {
       if (which) pReg(0,1); //unregister our process  
       else pReg(0,0);
     }
     registered = true;
     FreeLibrary(hmod);
   }

then override your application's initialization routine and add :

reg(true);

This will partially hide your application from the task manager. Your application will still be visible if a process viewer is used(like the one included with Microsoft Visual Studio 6.0) and that's another story...

Hope this helps.
0
 

Author Comment

by:Aphroditus
ID: 2777567
thanks man!
0
 

Author Comment

by:Aphroditus
ID: 2777586
thanks man!
0
 

Expert Comment

by:rvr2k1
ID: 9106738
how about hiding the application from the task manager for window nt/xp?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand data scrubbing tool 13 32
centeredAverage challenge 8 130
FizzBuzz challenge 9 76
Making an alias 7 79
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

912 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