UnLmtD Grandmaster Cheater Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Fri May 04, 2007 6:28 pm Post subject: Driver loader |
|
|
Hey guys, well finally I understood how to hide a process using a driver <3 www.rootkit.com
The thing is when I was testing the driver on my PC, I was using OSR driver loader. Now I want to implant the loader code in my application.
I tried using this Code: | #include <windows.h>
#include <iostream>
int _cdecl main(void)
{
HANDLE hSCManager;
HANDLE hService;
SERVICE_STATUS ss;
hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE);
printf("Load Driver\n");
if(hSCManager)
{
printf("Create Service\n");
hService = CreateService(hSCManager, "Hider",
"Rootkit exemple",
SERVICE_START | DELETE | SERVICE_STOP,
SERVICE_KERNEL_DRIVER,
SERVICE_DEMAND_START,
SERVICE_ERROR_IGNORE,
"C:\\hideprocess.sys",
NULL, NULL, NULL, NULL, NULL);
if(!hService)
{
hService = OpenService(hSCManager, "Hider",
SERVICE_START | DELETE | SERVICE_STOP);
}
if(hService)
{
printf("Start Service\n");
StartService(hService, 0, NULL);
printf("Press Enter to close service\r\n");
getchar();
ControlService(hService, SERVICE_CONTROL_STOP, &ss);
DeleteService(hService);
CloseServiceHandle(hService);
}
CloseServiceHandle(hSCManager);
}
return 0;
} |
But for some reason it didn't work . Anyone got a better code?
I know I must use those API's : OpenSCManager, CreateService, StartService, StopService, CloseServiceHandle
But can't figure it out Help pl0x
***EDIT***
O well if anyone wondered I took a look at http://www.catch22.net/tuts/kernel1.asp driver unloader. Seems good, I like the way of putting the driver in the .exe (Didn't know you could do that)
If you know any better way post please <3
_________________
|
|