
其实我一直想编一个病毒发给田间,可惜一直都没有办法通过360检查,今天又修改了一个,结果还是没用··
····································
#include const int ScrnWidth=1024; const int ScrnHight=768; const long SnowCol =0xFEFFFE; const long SnowColDown =0xFFFFFF; const long SnowColDuck =0xFFDDDD; const int SnowNum = 500; const int ID_TIMER = 1; const char g_szClassName[] = "myWindowClass"; typedef struct POINTAPI { long x; long y; }a; static HDC hDC1; static struct POINTAPI pData[500]; static long pColor[500]; static int Vx,Vy,PVx,PVy,timecont; long Abs(long num) { if(num>=0)return(num); else return(-num); } int Random(int max) { return(rand()%max); } int InitP(int i) { pData[i].x=Random(ScrnWidth); pData[i].y = Random(5); pColor[i] = GetPixel(hDC1, pData[i].x, pData[i].y); } long GetContrast(int i) { long ColorCmp; long tempR; long tempG; long tempB; int Slope; if(PVy!=0) Slope = PVx / PVy; else Slope = 2; if(Slope==0) ColorCmp = GetPixel(hDC1, pData[i].x, pData[i].y + 1); else if(Slope > 1) ColorCmp = GetPixel(hDC1, pData[i].x + 1, pData[i].y + 1); else ColorCmp = GetPixel(hDC1, pData[i].x - 1, pData[i].y + 1); if(ColorCmp==SnowCol)return 0; tempB = Abs((ColorCmp>>16)&0xff - (pColor[i]>>16)&0xff); tempG = Abs((ColorCmp>>8)&0xff - (pColor[i]>>8)&0xff); tempR = Abs((ColorCmp)&0xff - (pColor[i])&0xff); //return(tempR * 0.114 + tempG * 0.587 + tempB * 0.299); return((tempR + tempG + tempB) / 3); } void DrawP(void) { int i; // srand(time(0)); for(i=0;i 5 || GetContrast(i) < 50)SetPixel(hDC1, pData[i].x, pData[i].y, SnowCol); else { SetPixel(hDC1, pData[i].x, pData[i].y - 1, SnowColDuck); SetPixel(hDC1, pData[i].x - 1, pData[i].y, SnowColDuck); SetPixel(hDC1, pData[i].x + 1, pData[i].y, SnowColDown); InitP(i); } } }LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_TIMER: { if(timecont>200) { timecont=0; Vx = Random(4) - 2; Vy = Random(2) + 2; } else timecont+=1; DrawP(); } break; case WM_CREATE: { int j; srand(time(0)); Vx = Random(4) - 2; Vy = Random(2) + 2; for(j = 0;j 0) { TranslateMessage(&Msg); DispatchMessage(&Msg); } return Msg.wParam; }················································分割线····················
已上市经过修改的源代码,全是用C写的,一个占用CPU的,可惜啊,连360都过不了