Client Protection System – Auto Detection Name and Close [C++]

  • Konbuyu başlatan Konbuyu başlatan Admin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 0
  • Görüntüleme Görüntüleme 35

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
English:

Hello, today I am sharing a code I used for client protection. I no longer need it because I now use much more advanced tools and no longer rely on it. The code scans all possible names from an array, and if it detects a specific phrase, it completely shuts down the game, saves a protection log in a .txt file, and informs the player about the shutdown. The code detects open names in folders, browsers, Discord, Notepad, or any other application. As soon as any phrase from the array appears, the client is automatically closed, and the user is notified about the detection of suspicious activity.

Türkçe:
Merhaba, bugün eskiden müşteri koruması için kullandığım bir kodu paylaşıyorum. Artık daha gelişmiş araçlar kullandığım için bu koda ihtiyacım kalmadı ve kullanmıyorum. Kod, bir dizideki tüm olası isimleri tarar ve belirli bir ifade tespit edilirse oyunu tamamen kapatır, bir .txt dosyasına koruma mesajı kaydeder ve oyuncuyu oyun kapanışı hakkında bilgilendirir. Kod, klasörlerde, tarayıcılarda, Discord'da, Not Defteri'nde veya herhangi bir uygulamada açık isimleri tespit eder. Dizideki bir ifade göründüğünde, istemci otomatik olarak kapanır ve kullanıcıya şüpheli bir hareketin tespit edildiği bilgisi verilir.

Code:
Kod:
Userinterface.cpp #include <fstream> #include <string> #include <shellapi.h> #include <regex> #include <thread> #include <chrono> #include <windows.h> std::vector<std::string> windowBlackList = {     "inject",     "lalaker",     "hlbot",     "eterwizard",     "etermgr",     "m2bob",     "netlimiter",     "metin2mod",     "wireshark",     "unpack",     "clicker",     "debugger",     "Wiersz polecenia",     "ymir work",     "stmod",     "hlb0t",     "metin2 bot",     "m24pro" }; static BOOL CALLBACK FindBlacklistWindow(HWND hWnd, LPARAM lparam) {     int length = GetWindowTextLength(hWnd);     char* buffer = new char[length + 1];     GetWindowTextA(hWnd, buffer, length + 1);     std::string windowTitle(buffer);     if (IsWindowVisible(hWnd) && length != 0)     {         for (const auto& blacklisted : windowBlackList)         {             if (std::regex_search(windowTitle, std::regex(blacklisted, std::regex_constants::icase)))             {                 std::ofstream textfile("protection.txt", std::ios::out | std::ios::app);                 textfile << "Protection Alert: Suspicious activity detected. Client terminated." << std::endl;                 ShellExecuteA(NULL, "open", "protection.txt", NULL, NULL, SW_SHOWNORMAL);                 TerminateProcess(GetCurrentProcess(), 0);                 exit(0);             }         }     }     delete[*] buffer;     return TRUE; } void ScanForBlockedWindows() {     while(true)     {         EnumWindows(FindBlacklistWindow, NULL);         std::this_thread::sleep_for(std::chrono::milliseconds(200));     } } void Protection() {     CreateThread(NULL, NULL, LPTHREAD_START_ROUTINE(ScanForBlockedWindows), NULL, NULL, 0); } //////////////////////// Find: int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {      Add after: Protection();

Client Protection System – Otomatik Tanıma ve Kapatma Sistemi (C++)

Metin2 özel sunucu geliştirme sürecinde, güvenlik ve hile önleme sistemleri hayati öneme sahiptir. Oyuncuların adil bir oyun deneyimi yaşaması için geliştirilen bu sistemlerden birisi de 'Client Protection System'dir. Bu sistem, istemci tarafında çalışan kötü amaçlı yazılımları veya izinsiz programları otomatik olarak tanıyıp, gerekli durumlarda istemcinin kapatılmasını sağlar. Bu yazıda, Client Protection System adı verilen bu koruma mekanizmasının nasıl çalıştığını ve C++ ile nasıl uygulanacağını detaylıca ele alacağız.

Client Protection System Nedir?
Client Protection System, Metin2 özel sunucularında istemci güvenliğini artırmak amacıyla geliştirilmiş bir sistemdir. Bu sistem sayesinde, oyuncu istemcisinde çalışan izinsiz programlar (örneğin aimbot, speedhack, wallhack gibi) otomatik olarak tespit edilir. Sistem, tanımlanan proseslerin adlarına göre tarama yapar ve şüpheli olanları tespit ettikten sonra oyun istemcisinin kapanmasını sağlar.

Sistem Nasıl Çalışır?
Bu sistem genellikle iki ana bileşenden oluşur:

1. Proses Adı Tabanlı Tanıma: Sistem, belirlenen proses isimlerini (örneğin 'cheat.exe', 'hacktool.exe') kontrol eder. Eğer listede tanımlı bir proses aktifse, sistem bunu hile olarak değerlendirir.
2. Otomatik Kapatma Mekanizması: Hile tespit edildiğinde, sistem doğrudan istemciyi kapatabilir veya sunucuya uyarı gönderebilir.

Neden Kullanılır?
Metin2 özel sunucularda PvP sistemlerin sağlıklı işlemesi için hile kullanımını engellemek büyük önem taşır. Bu sistem sayesinde, hile kullanan oyuncuların tespiti hızlı olur ve sunucuda adil oyun ortamı sağlanır. Ayrıca, sistem C++ ile geliştirildiği için performans kaybı minimum düzeydedir.

Uygulama Adımları
1. Proses Listesi Oluşturma: Öncelikle tespit edilmesi istenen proses isimlerini bir diziye ya da dosyaya tanımlamalısınız.
2. Aktif Prosesleri Tarama: Windows API kullanarak çalışan tüm prosesleri tarayın ve listedeki isimlerle eşleştirin.
3. Tespit Edilen Proses Olduğunda Eylem Gerçekleştirme: Eğer eşleşme varsa, istemciyi kapatabilir veya sunucuya log gönderebilirsiniz.

Örnek C++ Kod Parçası
```cpp
BOOL IsProcessRunning(const char* processName) {
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hSnapshot == INVALID_HANDLE_VALUE) return FALSE;
PROCESSENTRY32 pe32;
pe32.dwSize = sizeof(PROCESSENTRY32);
if (!Process32First(hSnapshot, &pe32)) {
CloseHandle(hSnapshot);
return FALSE;
}
do {
if (strcmp(pe32.szExeFile, processName) == 0) {
CloseHandle(hSnapshot);
return TRUE;
}
} while (Process32Next(hSnapshot, &pe32));
CloseHandle(hSnapshot);
return FALSE;
}

Metin2 Özel Sunucularda Entegrasyon
Bu sistem, Metin2 client src (istemci kaynak kodu) içine entegre edilerek, oyun başlatıldığında arka planda sürekli olarak tarama yapacak şekilde ayarlanabilir. Bu sayede, oyuncu tarafından açılan hile programları anında tespit edilir. Sistem aynı zamanda loglama özelliğiyle birlikte sunucu tarafında da izlenebilir.

Avantajlar
- Performans dostudur.
- Kolayca özelleştirilebilir.
- C++ ile yazılmıştır, dolayısıyla düşük seviyeli kontrol sağlar.
- Hızlı tespit ve müdahale imkânı sunar.

Sonuç
Client Protection System, Metin2 özel sunucularında hile önleme stratejilerinizin temel taşlarından biridir. C++ tabanlı yapı sayesinde güçlü ve esnek bir koruma sağlar. Doğru uygulandığında, sunucunuzdaki oyun deneyimi daha adil ve güvenli hale gelir. Bu tür sistemler, özellikle PvP odaklı Metin2 sunucuları için kritik öneme sahiptir.


Client Protection System – Auto Detection and Close System (C++)

In the process of developing Metin2 private servers, security and anti-cheat systems are of vital importance. These systems ensure that players experience fair gameplay. One such system is the 'Client Protection System'. This system automatically detects malicious software or unauthorized programs running on the client side and, when necessary, forces the client to close. In this article, we will examine in detail how this protection mechanism, called Client Protection System, works and how it can be implemented with C++.

What is Client Protection System?
Client Protection System is a security feature developed for Metin2 private servers to enhance client-side security. With this system, unauthorized programs running on the player's client (such as aimbot, speedhack, wallhack, etc.) are automatically detected. The system scans based on predefined process names and evaluates any matches found as cheating, triggering the game client to close.

How Does the System Work?
The system typically consists of two main components:

1. Process Name-Based Detection: The system checks for predefined process names (e.g., 'cheat.exe', 'hacktool.exe'). If a process from the list is active, the system flags it as cheating.
2. Auto-Close Mechanism: When cheating is detected, the system can directly close the client or send an alert to the server.

Why Use It?
Preventing cheating is crucial for PvP systems in Metin2 private servers to function properly. This system enables quick detection of cheaters, ensuring a fair gaming environment on the server. Additionally, since it is developed with C++, performance loss remains at a minimum level.

Implementation Steps
1. Create Process List: First, define the process names you want to detect in an array or file.
2. Scan Active Processes: Use Windows API to scan all running processes and match them against your list.
3. Execute Action Upon Detection: If a match occurs, you can close the client or send a log to the server.

Sample C++ Code Snippet
```cpp
BOOL IsProcessRunning(const char* processName) {
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hSnapshot == INVALID_HANDLE_VALUE) return FALSE;
PROCESSENTRY32 pe32;
pe32.dwSize = sizeof(PROCESSENTRY32);
if (!Process32First(hSnapshot, &pe32)) {
CloseHandle(hSnapshot);
return FALSE;
}
do {
if (strcmp(pe32.szExeFile, processName) == 0) {
CloseHandle(hSnapshot);
return TRUE;
}
} while (Process32Next(hSnapshot, &pe32));
CloseHandle(hSnapshot);
return FALSE;
}

Integration in Metin2 Private Servers
This system can be integrated into the Metin2 client src (client source code) to continuously scan in the background once the game is launched. Thus, cheat programs opened by the player are instantly detected. The system also allows tracking on the server side through its logging functionality.

Advantages
- Performance-friendly.
- Easily customizable.
- Written in C++, allowing low-level control.
- Offers fast detection and response capabilities.

Conclusion
Client Protection System is one of the foundational elements of your anti-cheat strategies in Metin2 private servers. Thanks to its C++ base structure, it provides strong and flexible protection. When properly applied, it makes the gaming experience on your server more fair and secure. Such systems are critically important for PvP-oriented Metin2 servers.
 

Şuan Bu Konuyu Görüntüleyen Kullanıcılar (Toplam : 0, Üye : 0, Misafir : 0)

Benzer konular

Geri
Üst Alt