ENESDAYI
Silver Üye
- Katılım
- 12 Eki 2025
- Mesajlar
- 67
- Beğeniler
- 10
// bypass.cpp
#include "bypass.h"
#include <windows.h>
#include <cstdint>
#include <cstdio>
#include <cstdarg>
#include <tlhelp32.h>
#include <psapi.h>
#include <winternl.h>
#pragma comment(lib, "psapi.lib")
#pragma comment(lib, "ntdll.lib")
namespace FairplayKernelBypass {
void PurgeAllDebugRegisters() {
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
if (hSnapshot == INVALID_HANDLE_VALUE) return;
THREADENTRY32 te;
te.dwSize = sizeof(THREADENTRY32);
DWORD currentPid = GetCurrentProcessId();
if (Thread32First(hSnapshot, &te)) {
do {
if (te.th32OwnerProcessID == currentPid) {
HANDLE hThread = OpenThread(THREAD_GET_CONTEXT | THREAD_SET_CONTEXT, FALSE, te.th32ThreadID);
if (hThread) {
CONTEXT ctx = { 0 };
ctx.ContextFlags = CONTEXT_DEBUG_REGISTERS;
if (GetThreadContext(hThread, &ctx)) {
ctx.Dr0 = 0;
ctx.Dr1 = 0;
ctx.Dr2 = 0;
ctx.Dr3 = 0;
ctx.Dr6 = 0;
ctx.Dr7 = 0;
SetThreadContext(hThread, &ctx);
}
CloseHandle(hThread);
}
}
} while (Thread32Next(hSnapshot, &te));
}
CloseHandle(hSnapshot);
}
void MaskModuleIntegrity(HMODULE hModule) {
if (!hModule) return;
uint8_t* pBase = reinterpret_cast<uint8_t*>(hModule);
PIMAGE_DOS_HEADER pDos = reinterpret_cast<PIMAGE_DOS_HEADER>(pBase);
if (pDos->e_magic != IMAGE_DOS_SIGNATURE) return;
PIMAGE_NT_HEADERS pNt = reinterpret_cast<PIMAGE_NT_HEADERS>(pBase + pDos->e_lfanew);
if (pNt->Signature != IMAGE_NT_SIGNATURE) return;
DWORD oldProtect = 0;
if (VirtualProtect(&pNt->OptionalHeader, pNt->FileHeader.SizeOfOptionalHeader, PAGE_EXECUTE_READWRITE, &oldProtect)) {
pNt->OptionalHeader.CheckSum = 0;
pNt->OptionalHeader.SizeOfCode = 0;
pNt->OptionalHeader.AddressOfEntryPoint = 0;
VirtualProtect(&pNt->OptionalHeader, pNt->FileHeader.SizeOfOptionalHeader, oldProtect, &oldProtect);
}
}
void ExecuteDeepMitigation() {
PurgeAllDebugRegisters();
HMODULE hNetc = GetModuleHandleA("netc.dll");
if (hNetc) {
MaskModuleIntegrity(hNetc);
}
HMODULE hSelf = GetModuleHandleA(NULL);
if (hSelf) {
MaskModuleIntegrity(hSelf);
}
FlushInstructionCache(GetCurrentProcess(), NULL, 0);
}
}
void Bypass::Init() {
FairplayKernelBypass::ExecuteDeepMitigation();
}
Bypass olarak bunu kullanıyorum normalde oyuna girerken crash atıyodu düzelttim o zamanda ac 9 HHII atıyo. Varmı bilgisi olan ne yapmalıyım(Yanlış bişey yapmış olabilirim)
#include "bypass.h"
#include <windows.h>
#include <cstdint>
#include <cstdio>
#include <cstdarg>
#include <tlhelp32.h>
#include <psapi.h>
#include <winternl.h>
#pragma comment(lib, "psapi.lib")
#pragma comment(lib, "ntdll.lib")
namespace FairplayKernelBypass {
void PurgeAllDebugRegisters() {
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
if (hSnapshot == INVALID_HANDLE_VALUE) return;
THREADENTRY32 te;
te.dwSize = sizeof(THREADENTRY32);
DWORD currentPid = GetCurrentProcessId();
if (Thread32First(hSnapshot, &te)) {
do {
if (te.th32OwnerProcessID == currentPid) {
HANDLE hThread = OpenThread(THREAD_GET_CONTEXT | THREAD_SET_CONTEXT, FALSE, te.th32ThreadID);
if (hThread) {
CONTEXT ctx = { 0 };
ctx.ContextFlags = CONTEXT_DEBUG_REGISTERS;
if (GetThreadContext(hThread, &ctx)) {
ctx.Dr0 = 0;
ctx.Dr1 = 0;
ctx.Dr2 = 0;
ctx.Dr3 = 0;
ctx.Dr6 = 0;
ctx.Dr7 = 0;
SetThreadContext(hThread, &ctx);
}
CloseHandle(hThread);
}
}
} while (Thread32Next(hSnapshot, &te));
}
CloseHandle(hSnapshot);
}
void MaskModuleIntegrity(HMODULE hModule) {
if (!hModule) return;
uint8_t* pBase = reinterpret_cast<uint8_t*>(hModule);
PIMAGE_DOS_HEADER pDos = reinterpret_cast<PIMAGE_DOS_HEADER>(pBase);
if (pDos->e_magic != IMAGE_DOS_SIGNATURE) return;
PIMAGE_NT_HEADERS pNt = reinterpret_cast<PIMAGE_NT_HEADERS>(pBase + pDos->e_lfanew);
if (pNt->Signature != IMAGE_NT_SIGNATURE) return;
DWORD oldProtect = 0;
if (VirtualProtect(&pNt->OptionalHeader, pNt->FileHeader.SizeOfOptionalHeader, PAGE_EXECUTE_READWRITE, &oldProtect)) {
pNt->OptionalHeader.CheckSum = 0;
pNt->OptionalHeader.SizeOfCode = 0;
pNt->OptionalHeader.AddressOfEntryPoint = 0;
VirtualProtect(&pNt->OptionalHeader, pNt->FileHeader.SizeOfOptionalHeader, oldProtect, &oldProtect);
}
}
void ExecuteDeepMitigation() {
PurgeAllDebugRegisters();
HMODULE hNetc = GetModuleHandleA("netc.dll");
if (hNetc) {
MaskModuleIntegrity(hNetc);
}
HMODULE hSelf = GetModuleHandleA(NULL);
if (hSelf) {
MaskModuleIntegrity(hSelf);
}
FlushInstructionCache(GetCurrentProcess(), NULL, 0);
}
}
void Bypass::Init() {
FairplayKernelBypass::ExecuteDeepMitigation();
}
Bypass olarak bunu kullanıyorum normalde oyuna girerken crash atıyodu düzelttim o zamanda ac 9 HHII atıyo. Varmı bilgisi olan ne yapmalıyım(Yanlış bişey yapmış olabilirim)