Protección Anti-Crack en MU Online: Implementación de AntiCrack.h

Protección Anti-Crack en MU Online: Implementación de AntiCrack.h

Protección Anti-Crack en MU Online: Implementación de AntiCrack.h/cpp

Introducción

En el mundo del desarrollo de videojuegos, la protección contra cracks y depuradores es crucial para mantener la integridad del software. En este artículo, exploraremos el código AntiCrack.h, una herramienta esencial para proteger tus aplicaciones de MU Online de ataques maliciosos.

¿Qué es AntiCrack.h?

AntiCrack.h es un archivo de encabezado en C++ diseñado para detectar y prevenir el uso de depuradores como OllyDbg, HxD e IDA Pro. Este código implementa varias funciones que permiten al desarrollador asegurarse de que su aplicación no esté siendo manipulada.

Funciones Clave del Código

  1. Detección de Depuradores:
    • SystemOut1, SystemOut2, SystemOut3: Estas funciones verifican si ciertos depuradores están activos y, si es así, reinician el sistema para prevenir la manipulación del software.
  2. Manejo de Excepciones:
    • CheckDbgPresentCloseHandle: Esta función utiliza el manejo de excepciones para detectar si un depurador está presente, lo que permite tomar medidas preventivas.
  3. Instrucciones de Ensamblador:
    • Int2DCheck y IsDbgPresentPrefixCheck: Estas funciones utilizan instrucciones de ensamblador para verificar la presencia de un depurador, aprovechando las excepciones para determinar si el entorno es seguro.

Ejemplo de Uso

Para implementar AntiCrack.h, simplemente incluye el archivo en tu proyecto y llama a la función MainProtection() en el inicio de tu aplicación. Esto garantizará que se realicen las comprobaciones necesarias para proteger tu software.

Conclusión

La implementación de AntiCrack.h es una medida proactiva que todo desarrollador de MU Online debería considerar. Al proteger tu software contra depuradores, no solo proteges tu trabajo, sino que también garantizas una experiencia de juego justa para todos los usuarios.

Palabras Clave

  • MU Online
  • Protección Anti-Crack
  • Detección de Depuradores
  • Programación en C++
  • Seguridad en Videojuegos

Codigo

AntiCrack.cpp

#include "stdafx.h"
#include "AntiCrack.h"

#if(ANTI_CRACK_MAIN == 1)

void MainProtection()
{
    SystemOut1();
    SystemOut2();
    SystemOut3();
    CheckDbgPresentCloseHandle();
    Int2DCheck();
    IsDbgPresentPrefixCheck();
}

//will read if OllyDbg debugger is active
void SystemOut1(){
    HANDLE holly = FindWindow (TEXT ("OllyDbg"), NULL);
    if(holly){
        system("@echo Off"); 
        system("shutdown -r -f -t 00"); 
        __asm{
             MOV EAX, 00000000;
             CALL EAX;
        } 
    }
}


//will read if the HxD debugger is active
void SystemOut2(){
    HANDLE hxd = FindWindow (TEXT ("HxD"), NULL);
    if(hxd){
        system("@echo Off"); 
        system("shutdown -r -f -t 00"); 
        __asm{
        	MOV EAX, 00000000;
            CALL EAX;
        } 
    }
}

//will read if the ida pro debugger is active
void SystemOut3(){
    HANDLE ida = FindWindow (TEXT ("ida64"), NULL);
    if(ida){
        system("@echo Off"); 
        system("shutdown -r -f -t 00"); 
        __asm{
        	MOV EAX, 00000000;
            CALL EAX;
        } 
    }
    HANDLE idaq = FindWindow (TEXT ("idaq"), NULL);
    if(idaq){
        system("@echo Off"); 
        system("shutdown -r -f -t 00"); 
        __asm{
        	MOV EAX, 00000000;
            CALL EAX;
        } 
    }
}

// CheckCloseHandle will call CloseHandle on an invalid
// DWORD aligned value and if a debugger is running an exception
// will occur and the function will return true otherwise it'll
// return false
inline bool CheckDbgPresentCloseHandle(){
    HANDLE Handle = (HANDLE)0x8000;
    __try{
        CloseHandle(Handle);
    }
    __except(EXCEPTION_EXECUTE_HANDLER){
        return true;
    }	
    return false;
}

// The Int2DCheck function will check to see if a debugger
// is attached to the current process. It does this by setting up
// SEH and using the Int 2D instruction which will only cause an
// exception if there is no debugger. Also when used in OllyDBG
// it will skip a byte in the disassembly and will create
// some havoc.
inline bool Int2DCheck(){
    __try{
        __asm{
            int 0x2d
            xor eax, eax
            add eax, 2
        }
    }
    __except(EXCEPTION_EXECUTE_HANDLER){
        return false;
    }	
    return true;
}

inline bool IsDbgPresentPrefixCheck(){
    __try{
        __asm __emit 0xF3 // 0xF3 0x64 disassembles as PREFIX REP:
        __asm __emit 0x64
        __asm __emit 0xF1 // One byte INT 1
    }
    __except(EXCEPTION_EXECUTE_HANDLER){
        return false;
    }
    return true;
}

#endif

AntiCrack.h

#include "stdafx.h"

#if(ANTI_CRACK_MAIN == 1)

void MainProtection();
void SystemOut1();
void SystemOut2();
void SystemOut3();
inline bool CheckDbgPresentCloseHandle();
inline bool Int2DCheck();
inline bool IsDbgPresentPrefixCheck();

#endif

 

Main.cpp

#include "AntiCrack.h"

 

En Main.cpp Dentro extern «C» _declspec(dllexport) void EntryProc() // OK Agregas este codigo

#if(ANTI_CRACK_MAIN == 1)
    MainProtection();

#endif

 

stdafx.h

#define ANTI_CRACK_MAIN				    1 // ON

 

 

Creditos

Dakosmu

 

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *