当前位置:网站首页>游戏多开检测的几种实现方法及破解方法参考
游戏多开检测的几种实现方法及破解方法参考
2022-07-30 15:38:00 【陈子青 - See】
目录
游戏多开检测只是对游戏的进程数进行限制,分为事前检测、事中检测、和事后检测。
事中检测和事后检测往往没有提示,是游戏公司封号、处罚的手段,事前检测即禁止游戏多开,本文介绍常见的几种禁止游戏多开的方法,并给出破解方法,仅供参考。
枚举进程的多开检测
基本原理就是枚举所有系统进程,如果发现游戏进程名已经存在则无法继续打开新的进程。
bool isMulOpenByProcess()
{
HANDLE hProShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
if (hProShot == INVALID_HANDLE_VALUE) return false;
PROCESSENTRY32 pw{ sizeof(pw)};
int count = 0;
BOOL bRet = Process32First(hProShot, &pw);
if (!bRet) return false;
do{
_wcslwr_s(pw.szExeFile, wcslen(pw.szExeFile) + 1);
if (wcscmp(pw.szExeFile, L"muldectection.exe") == 0) count++;
//wprintf(L"%s\n", pw.szExeFile);
} while (Process32Next(hProShot, &pw));
if (count > 1) return true;
return false;
}参考破解方法—程序运行时修改进程名
互斥对象多开检测
互斥对象是内核对象,当创建带名称的互斥对象时,如果该互斥对象存在,则创建失败。可以利用这一点实现躲开检测。
bool isMulOpenByMutex()
{
HANDLE hMutex = CreateMutexA(NULL, FALSE, "MulDectection");
if (ERROR_ALREADY_EXISTS == GetLastError()) return true;
return false;
}
参考破解方法—可以在PE文件结构中删除互斥对象的句柄;hook CreateMutexA函数 等
信号量多开检测
信号量是内核对象,同互斥对象的原理类似,创建信号量时可以指定信号量的最大数量,程序运行时,可以让信号量加一,如果没法加一,说明信号量数量达到了设置最大值,以此来进行躲开检测
bool isMulOpenBySemaphore()
{
HANDLE hSema;
hSema = OpenSemaphoreA(SEMAPHORE_ALL_ACCESS, FALSE, "MulDectection");
if (!hSema)
hSema = CreateSemaphoreA(NULL, 0, 3, "MulDectection");
if (!ReleaseSemaphore(hSema, 1, 0)) return true;
return false;
}参考破解方案——可以调用WaitForSingleObject减少信号量数量
窗口多开检测
程序运行时寻找是否有同名窗口,如果已经存在则为程序多开。
HWND hWnd=FindWindowA(NULL,"ConsoleWindowClass");
if (hWnd != NULL) return true;参考破解方案——修改窗口名
共享内存检测多开
通过进程间共享内存段的方式来检测多开
#pragma data_seg("_hdata")
int g_count = 0;
#pragma data_seg()
#pragma comment(linker,"/SECTION:_hdata,RWS")
bool isMulOpenByMemory()
{
g_count++;
if (g_count > 1)return true;
return false;
}参考破解方案——修改共享内存段的变量的值
示例代码汇总
#include<Windows.h>
#include<iostream>
#include<tlhelp32.h>
#pragma data_seg("_hdata")
int g_count = 0;
#pragma data_seg()
#pragma comment(linker,"/SECTION:_hdata,RWS")
bool isMulOpenByProcess()
{
HANDLE hProShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
if (hProShot == INVALID_HANDLE_VALUE) return false;
PROCESSENTRY32 pw{ sizeof(pw)};
int count = 0;
BOOL bRet = Process32First(hProShot, &pw);
if (!bRet) return false;
do{
_wcslwr_s(pw.szExeFile, wcslen(pw.szExeFile) + 1);
if (wcscmp(pw.szExeFile, L"muldectection.exe") == 0) count++;
//wprintf(L"%s\n", pw.szExeFile);
} while (Process32Next(hProShot, &pw));
if (count > 1) return true;
return false;
}
bool isMulOpenByMutex()
{
HANDLE hMutex = CreateMutexA(NULL, FALSE, "MulDectection");
if (ERROR_ALREADY_EXISTS == GetLastError()) return true;
return false;
}
bool isMulOpenBySemaphore()
{
HANDLE hSema;
hSema = OpenSemaphoreA(SEMAPHORE_ALL_ACCESS, FALSE, "MulDectection");
if (!hSema)
hSema = CreateSemaphoreA(NULL, 0, 3, "MulDectection");
if (!ReleaseSemaphore(hSema, 1, 0)) return true;
return false;
}
bool isMulOpenByFindWindow()
{
HWND hWnd=FindWindowA(NULL,"ConsoleWindowClass");
if (hWnd != NULL) return true;
return false;
}
bool isMulOpenByMemory()
{
g_count++;
if (g_count > 1)return true;
return false;
}
int main()
{
if (isMulOpenByMemory())
{
MessageBoxA(NULL, "程序禁止多开", "MulDectection", MB_OK);
return -1;
}
MessageBoxA(NULL, "打开成功!", "MulDectection", MB_OK);
return 0;
}边栏推荐
- How to do a good job in technology selection
- Promise笔记(一)
- 经典实例分割模型Mask RCNN原理与测试
- Flask之路由(app.route)详解
- Core Topics under Microservice Architecture (2): Design Principles and Core Topics of Microservice Architecture
- Back waves are coming!Ali produced the "second generation" container technical manual and brain map, which is too fragrant
- 静态网页和动态网页的不同之处;该如何选择服务器呢
- Classes and Objects (Part 2)
- [flutter]什么是MaterialApp和Material design
- 武汉星起航:海外仓基础建设成为跨境电商企业的一大出海利器
猜你喜欢

二、判断 & 循环

Huawei ADS reports an error when obtaining conversion tracking parameters: getInstallReferrer IOException: getInstallReferrer not found installreferrer

go 学习03 基础知识变量类型

应用OPC解决方案实现控制系统数据的安全交换

涨姿势了!原来这才是多线程正确实现方式

Shell脚本的概念

FME's scheme and operation process for reading and writing cass data
加密生活,Web3 项目合伙人的一天

类和对象(下篇)
![[Developers must see] [push kit] Collection of typical problems of push service 2](/img/70/d5127d57d2f3532deb7314d737820b.png)
[Developers must see] [push kit] Collection of typical problems of push service 2
随机推荐
针对 MySQL/InnoDB 刷盘调优
tiup env
ISELED---the new choice of ambient lighting scheme
数组元素逆置
Manage components using TiUP commands
MySql 和 PostgreSQL 数据库 根据一张表update另一张表数据
服务器装好系统的电脑怎么分区
Huawei ADS reports an error when obtaining conversion tracking parameters: getInstallReferrer IOException: getInstallReferrer not found installreferrer
Overview of TiDB Tool Functions
代码随想录笔记_哈希_1l两数之和
yarn安装详细教程说明、升级教程、修改yarn的全局和缓存目录、yarn基本命令
70 lines of code, a desktop automatic translation artifact
在树莓派上驱动CSI摄像头
TiDB tool download
C#西门子S7 协议通过偏移量的方式读写PLC DB块
php how to query string occurrence position
AI遮天传 DL-CNN
【HMS core】【FAQ】push kit、WisePlay DRM、Location Kit、Health Kit、3D Modeling Kit、SignPal Kit典型问题合集4
FME's scheme and operation process for reading and writing cass data
rhce笔记3