WhatsApp Discord
Anti hack MuOnline 2024 - Source Mu - Mu Server Files
 

Noticias:

SMF - Just Installed!

Menú principal

Anti hack MuOnline 2024

Publicado por Dakosmu, Mar 24, 2024, 04:15 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Dakosmu

Anti hack MuOnline 2024


Regístrate para ver el enlace

CitarEn este constructor, se inicializa el miembro de datos DakosmuCache de la clase con el valor 0. El uso de this-> se refiere al objeto actual de la clase en la que se está trabajando, y se utiliza para acceder a los miembros de datos y funciones de la clase. En este caso, se está inicializando DakosmuCache del objeto actual con el valor 0.

CitarEsta función AttackSkill_1 recibe tres parámetros: a4, a5 y a6. En la primera línea de la función, se declara una variable local FameSpeed que se inicializa con el valor obtenido de la dirección de memoria apuntada por la expresión *(float*)(BGetModelPlaySpeed(BMDthisa(), gObjUser.lpViewPlayer->m_Model.AnimationID) + 4).

Luego, se llama al método DakosmuSkill del objeto gDakosmuhack pasando como argumentos el resultado de la función gObjUser.GetActiveSkill() y el valor de FameSpeed.

Finalmente, se llama a la función sub_5AB0B0 pasando como argumentos a4, a5 y a6.

CitarCalculan la variable FameSpeed obteniendo un valor de velocidad de reproducción de un modelo.
Llaman al método DakosmuSkill del objeto gDakosmuhack, pasando como argumentos el resultado de la función gObjUser.GetActiveSkill() y el valor de FameSpeed.

Llaman a diferentes funciones sub_XXXXXX pasando los parámetros a4, a5 y posiblemente a6, dependiendo de la función.

Cada una de las funciones AttackSkill_X parece estar asociada con un tipo específico de habilidad de ataque, como AttackSkill_1, AttackSkill_2, AttackSkill_3, etc. Cada una realiza acciones específicas relacionadas con esa habilidad de ataque en particular, pero comparten la lógica común de obtener la velocidad de reproducción del modelo y llamar al método DakosmuSkill.

CitarAbre un handle al proceso identificado por processID con los permisos PROCESS_QUERY_INFORMATION y PROCESS_VM_READ.

Obtiene una lista de todos los módulos cargados en ese proceso.
Itera a través de la lista de módulos, obteniendo el nombre completo del archivo del módulo.
Verifica si el nombre del módulo coincide con ciertos criterios utilizando la función DakosmuName de la clase gDakosmuhack.

Si el nombre del módulo cumple con los criterios, realiza ciertas acciones como establecer DKDetect en 1, agregar el nombre del módulo a DakosmuLogSendGS, y aumentar el contador Count.
Finalmente, libera el handle al proceso.

Algunas partes del código están comentadas y parecen ser funcionalidades adicionales que podrían haber sido utilizadas en el pasado o que podrían ser parte de un desarrollo futuro, como la limpieza de DakosmuLogSendGS, la asignación de un valor específico a esta variable y la llamada a SearchProcess de gBProtect.


stdafx.h

#define DK_ANTIHACK            1

Main.cpp

#if(DK_ANTIHACK)
#include "Dakosmuihack2.h"
#endif

#endif
    #if(DK_ANTIHACK)
    gDakosmuhack.DKLoadBB();
#endif


Protocol.cpp

#if(DK_ANTIHACK)
#include "Dakosmuihack2.h"
#endif

        #if(DK_ANTIHACK)
        case 0xD4:
        switch (((lpMsg[0] == 0xC1) ? lpMsg[3] : lpMsg[4]))
        {
            case 0xAA: //
            {
                gDakosmuhack.DKGSInfo((DK_GUARD_REQ_CHECK*) lpMsg);
            }
            break;
            case 0xAC: //
            {
                gDakosmuhack.DKDataInfo((DK_DK_MODULE_DATA_SEND*)lpMsg);
            }
            break;               
        }
        #endif



Dakosmuihack2.cpp

#include "stdafx.h"
#include "Dakosmuihack2.h"
#include "Import.h"
#include "User.h"
#include "PrintPlayer.h"
#include "Offset.h"
#include "Defines.h"
#include "Extras.h"
#include "Util.h"
Dakosmuihack gDakosmuhack;

Dakosmuihack::Dakosmuihack()
{
    this->DakosmuCache = 0;
}
#define BGetModelPlaySpeed                        ((int(__thiscall*)(int thisa, int Action)) 0x0051A220)
#define sub_5B0170            (( void(__cdecl*)(int a4, int a5, float a6)) 0x5B0170)
#define sub_5AB0B0            (( void(__cdecl*)(int a4, int a5, float a6)) 0x5AB0B0)
#define sub_5AD040            (( void(__cdecl*)(int a4, int a5, float a6)) 0x5AD040)
#define sub_59FCA0            (( void(__cdecl*)(int a4, int a5, float a6)) 0x59FCA0)
#define sub_5B3310            (( void(__cdecl*)(int a4, int a5, float a6)) 0x5B3310)
#define sub_59B580            (( char(__cdecl*)(int a4, int a5)) 0x59B580)
#define sub_5A0A30            (( char(__cdecl*)(int a4, int a5)) 0x5A0A30)
#define sub_59E590            (( void(__cdecl*)(int a4, int a5)) 0x0059E590)
#define sub_59C260            (( void(__cdecl*)(int a4, int a5)) 0x0059C260)
#define sub_X404D70            ((int(__thiscall*)(unsigned __int16* This, int a2, int a3)) 0x00404D70)
DWORD CalcTimeSkill[6] = { 0 };

void AttackSkill_1(int a4, int a5, float a6)     
{

    float FameSpeed = *(float*)(BGetModelPlaySpeed(BMDthisa(), gObjUser.lpViewPlayer->m_Model.AnimationID) + 4);
    gDakosmuhack.DakosmuSkill(gObjUser.GetActiveSkill(), FameSpeed);
    sub_5AB0B0(a4, a5, a6);
}

char AttackSkill_6(int a4, int a5)     
{
    float FameSpeed = *(float*)(BGetModelPlaySpeed(BMDthisa(), gObjUser.lpViewPlayer->m_Model.AnimationID) + 4);
    gDakosmuhack.DakosmuSkill(gObjUser.GetActiveSkill(), FameSpeed);
    return sub_5A0A30(a4, a5);
}
void AttackSkillPhep(int a4, int a5, float a6)       
{
    float FameSpeed = *(float*)(BGetModelPlaySpeed(BMDthisa(), gObjUser.lpViewPlayer->m_Model.AnimationID) + 4);
    gDakosmuhack.DakosmuSkill(gObjUser.GetActiveSkill(), FameSpeed);
    sub_5B0170(a4, a5, a6);
}
void AttackSkill_2(int a4, int a5, float a6)       
{
    float FameSpeed = *(float*)(BGetModelPlaySpeed(BMDthisa(), gObjUser.lpViewPlayer->m_Model.AnimationID) + 4);
    gDakosmuhack.DakosmuSkill(gObjUser.GetActiveSkill(), FameSpeed);
    sub_5AD040(a4, a5, a6);
}

void AttackSkill_3(int a4, int a5, float a6)       
{
    float FameSpeed = *(float*)(BGetModelPlaySpeed(BMDthisa(), gObjUser.lpViewPlayer->m_Model.AnimationID) + 4);
    gDakosmuhack.DakosmuSkill(gObjUser.GetActiveSkill(), FameSpeed);
    sub_59FCA0(a4, a5, a6);

}
void AttackSkillRF(int a4, int a5)       
{
    float FameSpeed = *(float*)(BGetModelPlaySpeed(BMDthisa(), gObjUser.lpViewPlayer->m_Model.AnimationID) + 4);
    gDakosmuhack.DakosmuSkill(gObjUser.GetActiveSkill(), FameSpeed);
    sub_59E590(a4, a5);

}

int __thiscall Dakosmuihack::DakosmuAttack(unsigned __int16* This, int a2, int a3)
{
    float FameSpeed = *(float*)(BGetModelPlaySpeed(BMDthisa(), gObjUser.lpViewPlayer->m_Model.AnimationID) + 4);
    gDakosmuhack.DakosmuSkill(0, FameSpeed);
    return sub_X404D70(This, a2, a3);
}

void __cdecl BUseSkillWarrior(int a1, int a2)     
{
    float FameSpeed = *(float*)(BGetModelPlaySpeed(BMDthisa(), gObjUser.lpViewPlayer->m_Model.AnimationID) + 4);
    gDakosmuhack.DakosmuSkill(gObjUser.GetActiveSkill(), FameSpeed);
    return sub_59C260(a1, a2);
}
#include "Interface.h"
DWORD TimeSendSkill = 0;
WORD SkillIDSend = -1;
void Dakosmuihack::DakosmuSkill(WORD mSkillID, float mFameSpeed)
{
    if ((GetTickCount() - TimeSendSkill) < 500 && SkillIDSend == mSkillID) return;

    DK_USESKILL_LOG pMsg;
    pMsg.header.set(0xD4, 0xAC, sizeof(pMsg)); //==Packet Cuong Beo
    pMsg.SkillID = mSkillID; //
    pMsg.FameSpeed = mFameSpeed; //
    DataSend((LPBYTE)& pMsg, pMsg.header.size);
    //gInterface.DrawMessage(1, "mSkillID %d", mSkillID);
    TimeSendSkill = GetTickCount();
    SkillIDSend = mSkillID;

}
void __cdecl sub_59CC40(float* a1, float* a2)        //v26 == >=67 <= 72
{
    float FameSpeed = *(float*)(BGetModelPlaySpeed(BMDthisa(), gObjUser.lpViewPlayer->m_Model.AnimationID) + 4);
    gDakosmuhack.DakosmuSkill(gObjUser.GetActiveSkill(), FameSpeed);

    return ((void(__cdecl*)(float* a1, float* a2))0x0059CC40)(a1, a2);
}
void __cdecl AttackCommon(float* a1, float* a2)        //v26 == >=67 <= 72
{
    float FameSpeed = *(float*)(BGetModelPlaySpeed(BMDthisa(), gObjUser.lpViewPlayer->m_Model.AnimationID) + 4);
    gDakosmuhack.DakosmuSkill(gObjUser.GetActiveSkill(), FameSpeed);

    return ((void(__cdecl*)(float* a1, float* a2))0x005B3310)(a1, a2);
}


BOOL Dakosmuihack::DakosmuName(char* NameModule) // OK
{
    auto pos = std::find(DKModuleItem.begin(), DKModuleItem.end(), NameModule);

    if (pos != DKModuleItem.end())
    {

        return 1;
    }

    return 0;
}

int PrintModules(DWORD processID)
{

    HMODULE hMods[1024];
    HANDLE hProcess;
    DWORD cbNeeded;
    unsigned int i;
    // Print the process identifier.

    // Get a handle to the process.

    hProcess = OpenProcess(PROCESS_QUERY_INFORMATION |
        PROCESS_VM_READ,
        FALSE, processID);
    if (NULL == hProcess)
        return 1;

    // Get a list of all the modules in this process.
    int Count = 1;
    gDakosmuhack.DakosmuLogSendGS.clear();
    //gBProtect.DakosmuLogSendGS = "LOG: ";
    if (EnumProcessModules(hProcess, hMods, sizeof(hMods), &cbNeeded))
    {
        for (i = 0; i < (cbNeeded / sizeof(HMODULE)); i++)
        {
            TCHAR szModName[MAX_PATH];

            // Get the full path to the module's file.

            if (GetModuleFileNameEx(hProcess, hMods[i], szModName,
                sizeof(szModName) / sizeof(TCHAR)))
            {
                // Print the module name and handle value.

                //_tprintf(TEXT("\t%s (0x%08X)\n"), szModName, hMods[i]);
                //g_Console.AddMessage(2, TEXT("%d %s (0x%08X)"), Count, PathFindFileName(szModName), hMods[i]);
                if (gDakosmuhack.DakosmuName(PathFindFileName(szModName)))
                {
                    gDakosmuhack.DKDetect = 1;
                    gDakosmuhack.DakosmuLogSendGS += PathFindFileName(szModName);
                    gDakosmuhack.DakosmuLogSendGS += ",";
                    //gInterface.DrawMessage(1, TEXT("%d %s (0x%08X) 111"), Count, PathFindFileName(szModName), hMods[i]);
                }
               
                Count++;
            }
        }
    }

    // Release the handle to the process.

    CloseHandle(hProcess);
   
    //gDakosmuhack.DakosmuLogSendGS.clear();
    //gDakosmuhack.DakosmuLogSendGS = "[Inject Module ###]";
    //gBProtect.SearchProcess();
    return 1;
}

void Dakosmuihack::DakosmuInject()
{
    if (gDakosmuhack.DKDetect != 0) { return; }

    if (PrintModules(GetCurrentProcessId()) == 1)
    {
        DK_RECV_MODULE pMsg;
        pMsg.header.set(0xD4, 0xAB, sizeof(pMsg));
        pMsg.TypeRecv = gDakosmuhack.DKDetect; //
        memcpy(pMsg.LogRecv, strdup(gDakosmuhack.DakosmuLogSendGS.c_str()), sizeof(pMsg.LogRecv));
        DataSend((LPBYTE)& pMsg, pMsg.header.size);
        gDakosmuhack.DKDetect = 0;
    }
}
void Dakosmuihack::DKDataInfo(DK_DK_MODULE_DATA_SEND* lpMsg)
{
   
    DKModuleItem.clear();
    //gInterface.DrawMessage(1, "DKDataInfo %d", lpMsg->count);
    for (int i = 0; i < lpMsg->count; i++)
    {
        DK_MODULE_DATA* lpInfo = (DK_MODULE_DATA*)(((BYTE*)lpMsg) + sizeof(DK_DK_MODULE_DATA_SEND) + (sizeof(DK_MODULE_DATA) * i));
        DKModuleItem.push_back(lpInfo->NameModule);
        //gInterface.DrawMessage(1, "Aa %s",lpInfo->NameModule);
    }
    //===Scan
    if (lpMsg->count > 0)
    {
        gDakosmuhack.DakosmuInject();
    }
}

void Dakosmuihack::DKLoadBB()
{
    this->DKModuleItem.clear();
    this->DKDetect = 0;
    //====Get Skill Attack
    SetCompleteHook(0xE8, 0x005B5662, &AttackCommon);
    SetCompleteHook(0xE8, 0x005A1ACB, &sub_59CC40);
    SetCompleteHook(0xE8, 0x005B14A2, &sub_59CC40);
   
    SetCompleteHook(0xE8, 0x005B563F, &AttackSkillPhep);
    SetCompleteHook(0xE8, 0x005B55D0, &AttackSkill_1);
    SetCompleteHook(0xE8, 0x005A1E60, &AttackSkill_2);
    SetCompleteHook(0xE8, 0x005B55F9, &AttackSkill_2);
    SetCompleteHook(0xE8, 0x005A01A5, &AttackSkillRF); //RF
    SetCompleteHook(0xE8, 0x005A021D, &AttackSkillRF); //RF
    SetCompleteHook(0xE8, 0x005A0232, &AttackSkillRF); //RF
    SetCompleteHook(0xE8, 0x005A02DC, &AttackSkillRF); //RF
    SetCompleteHook(0xE8, 0x005A1F8E, &AttackSkillRF); //RF
    SetCompleteHook(0xE8, 0x005B557B, &AttackSkill_6);
    SetCompleteHook(0xE8, 0x0059B4FB, &BUseSkillWarrior);
    SetCompleteHook(0xE8, 0x005A199A, &BUseSkillWarrior);
    SetCompleteHook(0xE8, 0x005A179C, &Dakosmuihack::DakosmuAttack); //Attack Meele
}
Dakosmuihack::~Dakosmuihack()
{

}

int Dakosmuihack::GetLargerFrame()
{
    if (pFrameValue1 > DK_MAX_FRAME_VALUE)
    {
        return pFrameValue1;
    }
    else if (pFrameValue2 > DK_MAX_FRAME_VALUE)
    {
        return pFrameValue2;
    }
    else if (pFrameValue3 > DK_MAX_FRAME_VALUE)
    {
        return pFrameValue3;
    }
    else if (pFrameValue4 > DK_MAX_FRAME_VALUE)
    {
        return pFrameValue4;
    }

    return 0;
}
void Dakosmuihack::DKGSInfo(DK_GUARD_REQ_CHECK* pRequest)
{

    gObjUser.Refresh();
    int DakosmuCache = *(WORD*)(*(DWORD*)(MAIN_CHARACTER_STRUCT)+0x0E);
    //pDrawMessage("gBProtect DK_GUARD_REQ_CHECK", 0);
    DK_BGUARD_ANS_CHECK pResult;
    pResult.header.set(0xD4, 0xAA, sizeof(pResult)); //Up Level

    ZeroMemory(pResult.Data, sizeof(pResult.Data));

    for (int i = 0; i < emMaxCheckVars; i++)
    {
        pResult.Data[i].Status = true;
    }
    //char DebugText[255];
    //sprintf(DebugText, " Str %d~%d", pRequest->LevelPoint, ViewPoint);
    //pDrawMessage (DebugText, 0 );   

    if (gObjUser.lpPlayer->Level != this->DakosmuCache && this->DakosmuCache != 0 && gObjUser.lpPlayer->Level > pRequest->Level + DK_MAX_LEVEL_VALUE)
    {
        pResult.Data[emLevel].Status = false;
        pResult.Data[emLevel].Value = gObjUser.lpPlayer->Level;
    }

    if (ViewPoint != pRequest->LevelPoint)
    {
        pResult.Data[emLevelPoint].Status = false;
        pResult.Data[emLevelPoint].Value = ViewPoint;
    }

    if (pRequest->Strength < 65535)
    {
        if ((ViewStrength+ ViewAddStrength) > pRequest->Strength + DK_MAX_STAT_LIMIT || pRequest->Strength > (ViewStrength + ViewAddStrength) + DK_MAX_STAT_LIMIT)
        {
            pResult.Data[emStrength].Status = false;
            pResult.Data[emStrength].Value = (ViewStrength + ViewAddStrength);
        }
    }

    if (pRequest->Dexterity < 65535)
    {
        if ((ViewDexterity+ ViewAddDexterity) > pRequest->Dexterity + DK_MAX_STAT_LIMIT || pRequest->Dexterity > (ViewDexterity + ViewAddDexterity) + DK_MAX_STAT_LIMIT)
        {
            pResult.Data[emDexterity].Status = false;
            pResult.Data[emDexterity].Value = (ViewDexterity + ViewAddDexterity);
        }
    }

    if (pRequest->Vitality < 65535)
    {
        if ((ViewVitality+ ViewAddVitality) > pRequest->Vitality + DK_MAX_STAT_LIMIT || pRequest->Vitality > (ViewVitality + ViewAddVitality) + DK_MAX_STAT_LIMIT)
        {
            pResult.Data[emVitality].Status = false;
            pResult.Data[emVitality].Value = (ViewVitality + ViewAddVitality);
        }
    }

    if (pRequest->Energy < 65535)
    {
        if ((ViewEnergy+ ViewAddEnergy) > pRequest->Energy + DK_MAX_STAT_LIMIT || pRequest->Energy > (ViewEnergy + ViewAddEnergy) + DK_MAX_STAT_LIMIT)
        {
            pResult.Data[emEnergy].Status = false;
            pResult.Data[emEnergy].Value = (ViewEnergy + ViewAddEnergy);
        }
    }

    if (pRequest->Leadership < 65535)
    {
        if ((ViewLeadership+ ViewAddLeadership) > pRequest->Leadership + DK_MAX_STAT_LIMIT || pRequest->Leadership > (ViewLeadership + ViewAddLeadership) + DK_MAX_STAT_LIMIT)
        {
            pResult.Data[emLeadership].Status = false;
            pResult.Data[emLeadership].Value = (ViewLeadership + ViewAddLeadership);
        }
    }

    int MaxSpeedCountCheck = DK_MAX_SPEED_LIMIT;

    if (gObjUser.lpViewPlayer->WeaponFirstExcellent || gObjUser.lpViewPlayer->WeaponSecondExcellent)
    {
        MaxSpeedCountCheck = (DK_MAX_SPEED_LIMIT * 1.5);
    }

    if ((gObjUser.lpPlayer->AttackSpeed > (pRequest->AttackSpeed + MaxSpeedCountCheck))
        || (gObjUser.lpPlayer->MagicSpeed > (pRequest->MagicSpeed + MaxSpeedCountCheck)))
    {
        //if(pRequest->AttackSpeed < 1400 &&    pRequest->MagicSpeed < 1400) {
        pResult.Data[emAttackSpeed].Status = false;
        pResult.Data[emAttackSpeed].Value = gObjUser.lpPlayer->AttackSpeed;
        pResult.Data[emMagicSpeed].Value = gObjUser.lpPlayer->MagicSpeed;
        //}
    }

    if (gObjUser.lpViewPlayer->PetSlot != -1)
    {
        if ((gObjUser.lpViewPlayer->PetSlot - 1171) != pRequest->CharSetItem[8])
        {
            pResult.Data[emPetSlot].Status = false;
            pResult.Data[emPetSlot].Value = (gObjUser.lpViewPlayer->PetSlot - 1171);
            gObjUser.lpViewPlayer->PetSlot = pRequest->CharSetItem[8] + 1171;
        }
    }

    if (gObjUser.lpViewPlayer->WeaponFirstSlot != -1 && !InChaosCastle(pMapNumber)) {

        if ((gObjUser.lpViewPlayer->WeaponFirstSlot - 1171) != pRequest->CharSetItem[0])
        {
            pResult.Data[emWeaponFirstSlot].Status = false;
            pResult.Data[emWeaponFirstSlot].Value = (gObjUser.lpViewPlayer->WeaponFirstSlot - 1171);
            gObjUser.lpViewPlayer->WeaponFirstSlot = pRequest->CharSetItem[0] + 1171;
        }
    }

    if (gObjUser.lpViewPlayer->WeaponSecondSlot != -1 && !InChaosCastle(pMapNumber)) {

        if ((gObjUser.lpViewPlayer->WeaponSecondSlot - 1171) != pRequest->CharSetItem[1])
        {
            pResult.Data[emWeaponSecondSlot].Status = false;
            pResult.Data[emWeaponSecondSlot].Value = (gObjUser.lpViewPlayer->WeaponSecondSlot - 1171);
            gObjUser.lpViewPlayer->WeaponSecondSlot = pRequest->CharSetItem[1] + 1171;
        }
    }

    if (gObjUser.lpViewPlayer->HelmSlot >= ITEM2(7, 0) && gObjUser.lpViewPlayer->HelmSlot < ITEM2(7, 512)) {

        if ((gObjUser.lpViewPlayer->HelmSlot - 1171) != pRequest->CharSetItem[2])
        {
            pResult.Data[emHelmSlot].Status = false;
            pResult.Data[emHelmSlot].Value = (gObjUser.lpViewPlayer->HelmSlot - 1171);
            //gObjUser.lpViewPlayer->HelmSlot =  pRequest->CharSetItem[2]+1171;
        }
    }

    if (gObjUser.lpViewPlayer->ArmorSlot >= ITEM2(8, 0) && gObjUser.lpViewPlayer->ArmorSlot < ITEM2(8, 512)) {



        if ((gObjUser.lpViewPlayer->ArmorSlot - 1171) != pRequest->CharSetItem[3])
        {
            pResult.Data[emArmorSlot].Status = false;
            pResult.Data[emArmorSlot].Value = (gObjUser.lpViewPlayer->ArmorSlot - 1171);
            //gObjUser.lpViewPlayer->ArmorSlot =  pRequest->CharSetItem[3]+1171;
        }
    }


    if (gObjUser.lpViewPlayer->PantsSlot >= ITEM2(9, 0) && gObjUser.lpViewPlayer->PantsSlot < ITEM2(9, 512)) {

        if ((gObjUser.lpViewPlayer->PantsSlot - 1171) != pRequest->CharSetItem[4])
        {
            pResult.Data[emPantsSlot].Status = false;
            pResult.Data[emPantsSlot].Value = (gObjUser.lpViewPlayer->PantsSlot - 1171);
            //gObjUser.lpViewPlayer->PantsSlot =  pRequest->CharSetItem[4]+1171;
        }
    }

    if (gObjUser.lpViewPlayer->GlovesSlot >= ITEM2(10, 0) && gObjUser.lpViewPlayer->GlovesSlot < ITEM2(10, 512)) {

        if ((gObjUser.lpViewPlayer->GlovesSlot - 1171) != pRequest->CharSetItem[5])
        {
            pResult.Data[emGlovesSlot].Status = false;
            pResult.Data[emGlovesSlot].Value = (gObjUser.lpViewPlayer->GlovesSlot - 1171);
            //gObjUser.lpViewPlayer->GlovesSlot =  pRequest->CharSetItem[5]+1171;
        }
    }

    if (gObjUser.lpViewPlayer->BootsSlot >= ITEM2(11, 0) && gObjUser.lpViewPlayer->BootsSlot < ITEM2(11, 512)) {

        if ((gObjUser.lpViewPlayer->BootsSlot - 1171) != pRequest->CharSetItem[6])
        {
            pResult.Data[emBootsSlot].Status = false;
            pResult.Data[emBootsSlot].Value = (gObjUser.lpViewPlayer->BootsSlot - 1171);
            //gObjUser.lpViewPlayer->BootsSlot =  pRequest->CharSetItem[6]+1171;
        }
    }

    if (gObjUser.lpViewPlayer->WingsSlot != -1) {

        if ((gObjUser.lpViewPlayer->WingsSlot - 1171) != pRequest->CharSetItem[7] && (gObjUser.lpViewPlayer->WingsSlot - 1171) != 6279 && pRequest->CharSetItem[7] != 6193)
        {
            pResult.Data[emWingsSlot].Status = false;
            pResult.Data[emWingsSlot].Value = (gObjUser.lpViewPlayer->WingsSlot - 1171);
            gObjUser.lpViewPlayer->WingsSlot = pRequest->CharSetItem[7] + 1171;
        }
    }

    DataSend((BYTE*)& pResult, pResult.header.size);


}


Dakosmuihack2.h


#pragma once
#include <psapi.h>
#pragma comment(lib,"Psapi.lib")
#include <shlwapi.h>
#include <string>
#include "Protocol.h"
#define DK_MAX_FRAME_VALUE        400
#define DK_MAX_LEVEL_VALUE        10
#define DK_MAX_SPEED_LIMIT        100
#define DK_MAX_STAT_LIMIT        1000
enum TypeHack
{
    eHackPlayerEditor,
    eHackSpeedMove,
    eHackSpeedCheck,
    eHackFrameSpeedCheck,
    eHackCheckInject,
};
enum eCheckStatMember
{
    emLevel = 0,
    emLevelPoint = 1,
    emStrength = 2,
    emDexterity = 3,
    emVitality = 4,
    emEnergy = 5,
    emLeadership = 6,
    emAttackSpeed = 7,
    emMagicSpeed = 8,
    emFrameValue = 9,
    emAnimation = 10,
    //====
    emPetSlot = 11,
    emHelmSlot = 12,
    emArmorSlot = 13,
    emPantsSlot = 14,
    emGlovesSlot = 15,
    emBootsSlot = 16,
    emWeaponFirstSlot = 17,
    emWeaponSecondSlot = 18,
    emWingsSlot = 19,
    //====
    emEditGame = 20,
    emMaxCheckVars,
};
#pragma pack(push, 1)
struct DK_GUARD_REQ_CHECK
{
    PSWMSG_HEAD header;

    short        Level;
    int            LevelPoint;
    int          Strength;
    int          Dexterity;
    int          Vitality;
    int          Energy;
    int          Leadership;
    int            AttackSpeed;
    int            MagicSpeed;
    short        CharSetItem[10];
};
#pragma pack(pop)
#pragma pack(push, 1)
struct DK_GUARD_ANS_DATA
{
    bool        Status;
    int            Value;
};
#pragma pack(pop)
#pragma pack(push, 1)
struct DK_BGUARD_ANS_CHECK
{
    PSBMSG_HEAD header; // C3:F3:03

    DK_GUARD_ANS_DATA Data[emMaxCheckVars];
};
//====Moudule Inject
struct DK_MODULE_DATA
{
    int Index;
    char NameModule[60];
};

struct DK_DK_MODULE_DATA_SEND
{
    PSWMSG_HEAD header;
    int count;
};
struct DK_RECV_MODULE
{
    PSBMSG_HEAD header; // C3:F3:03
    WORD TypeRecv;
    char LogRecv[128];
};
#pragma pack(pop)
#pragma pack(push, 1)
struct DK_USESKILL_LOG
{
    PSBMSG_HEAD header; // C3:F3:03
    WORD SkillID;
    float FameSpeed;

};
#pragma pack(pop)

class Dakosmuihack
{
public:
    Dakosmuihack();
    virtual ~Dakosmuihack();
    void Dakosmuihack::DKLoadBB();
    int Dakosmuihack::GetLargerFrame();
    void Dakosmuihack::DKGSInfo(DK_GUARD_REQ_CHECK* pRequest);
    int DakosmuCache;
    void Dakosmuihack::DakosmuSkill(WORD mSkillID, float mFameSpeed);
    static int __thiscall DakosmuAttack(unsigned __int16* This, int a2, int a3);
    void Dakosmuihack::DakosmuInject();
    std::string DakosmuLogSendGS;
    BOOL Dakosmuihack::DakosmuName(char* NameModule);
    std::vector<std::string> DKModuleItem;
    void Dakosmuihack::DKDataInfo(DK_DK_MODULE_DATA_SEND* lpMsg);
    int DKDetect;
private:
   
};

extern Dakosmuihack gDakosmuhack;





Bon Dia

Dakosmu

////////////////////// GAMESERVER /////////////////////////////

Colocar #include "Dakosmuihack2GS.h"

en los siguientes CPP


Protocol.cpp
ServerInfo.cpp
User.cpp



Protocol.cpp

if (gDakosmuGShack.DakosmuGShackPacketRecv(head, lpMsg, size, aIndex, encrypt, serial) == false)
{
return;
}


ServerInfo.cpp

gDakosmuGShack.LoadFileXML(gPath.GetFullPath("Hack\\Dakosmu_AntiGS.xml"));

User.cpp

for (int n = OBJECT_START_USER; n < MAX_OBJECT; n++)
{
gDakosmuGShack.ViewportProc(n);
}


Dakosmuihack2GS.h

#pragma once
#include "DefaultClassInfo.h"
#include "User.h"
#include "Protocol.h"



enum TypeHack
{
eHackPlayerEditor,
eHackSpeedMove,
eHackSpeedCheck,
eHackFrameSpeedCheck,
eHackCheckInject,
};
enum eCheckStatMember
{
emLevel = 0,
emLevelPoint = 1,
emStrength = 2,
emDexterity = 3,
emVitality = 4,
emEnergy = 5,
emLeadership = 6,
emAttackSpeed = 7,
emMagicSpeed = 8,
emFrameValue = 9,
emAnimation = 10,
//====
emPetSlot = 11,
emHelmSlot = 12,
emArmorSlot = 13,
emPantsSlot = 14,
emGlovesSlot = 15,
emBootsSlot = 16,
emWeaponFirstSlot = 17,
emWeaponSecondSlot = 18,
emWingsSlot = 19,
//====
emEditGame = 20,
emMaxCheckVars,
};
#pragma pack(push, 1)
struct DK_GUARD_REQ_CHECK
{
PSWMSG_HEAD header;

short Level;
int LevelPoint;
int  Strength;
int  Dexterity;
int  Vitality;
int  Energy;
int  Leadership;
int AttackSpeed;
int MagicSpeed;
short CharSetItem[10];
};
#pragma pack(pop)
#pragma pack(push, 1)
struct DK_BGUARD_ANS_DATA
{
bool Status;
int Value;
};
#pragma pack(pop)
#pragma pack(push, 1)
struct DK_GUARD_ANS_CHECK
{
PSBMSG_HEAD header; // C3:F3:03

DK_BGUARD_ANS_DATA Data[emMaxCheckVars];
};

//====Moudule Inject
struct MODULE_DATA
{
int Index;
char NameModule[60];
};

struct DK_MODULE_DATA_SEND
{
PSWMSG_HEAD header;
int count;
};
struct RECV_MODULE
{
PSBMSG_HEAD header; // C3:F3:03
WORD TypeRecv;
char LogRecv[128];

};

#pragma pack(pop)



struct DakosmuGS_INFO_ANTIHACK
{
int Index;
char Message[256];
};
struct DakosmuGS2_DATA_CONFIG
{
int DebugLog;
int Enabled;
int NoticeMess;
int DetectCount;
int TypeCheck;
int BlockSkillDelay;
void Clear()
{
DebugLog = 0;
Enabled = 0;
NoticeMess = 0;
DetectCount = 0;
TypeCheck = 0;
BlockSkillDelay = 0;
}
};
struct DK_CONFIG_SPEEDMOVE
{
int DebugLog;
int Enabled;
int NoticeMess;
int DetectCount;
int GateMove;
float SpeedNormal;
float SpeedPet;
float SpeedWing;
void Clear()
{
DebugLog = 0;
Enabled = 0;
NoticeMess = 0;
DetectCount = 0;
GateMove = 0;
SpeedNormal = 0;
SpeedPet = 0;
SpeedWing = 0;
}
};

//===================Check Auto Skill
#pragma pack(push, 1)
struct USESKILL_LOG
{
PSBMSG_HEAD header; // C3:F3:03
WORD SkillID;
float FameSpeed;

};
#pragma pack(pop)
//======================

struct DakosmuGS_HACKSPEED_DATA
{
int m_SkillID;
int m_SkillType;
int m_HitDetect;
int m_DelayCountMin;
int m_DelayMinMs;
int m_DelayType;
int m_DelayValue;
int m_DelayGroup;
int m_XDmgAI;
};
struct DK_XDAMEHACK_DATA
{
int Group;
int MinSpeed;
int MaxSpeed;
int MaxCount;
};

class CDakosmuGShack
{
public:
CDakosmuGShack();
virtual ~CDakosmuGShack();
//==
DakosmuGS2_DATA_CONFIG* HackPlayerEditor;
void CDakosmuGShack::SendPlayerEditor(int aIndex);
void CDakosmuGShack::GetResultPlayerEditor(DK_GUARD_ANS_CHECK* pResult, int aIndex);

DK_CONFIG_SPEEDMOVE* HackSpeedMove;
DakosmuGS2_DATA_CONFIG* HackSpeedCheck;
DakosmuGS2_DATA_CONFIG* HackCheckInject;

int RandomSend;
int GhiLogHack;
int DelayScan;
int DelayClear;
void LoadFileXML(char* FilePath);

void ViewportProc(int aIndex);
void CDakosmuGShack::SetUserZeroCache(int aIndex);
BOOL CDakosmuGShack::DakosmuGShackPacketRecv(BYTE head, BYTE* recvlpMsg, int size, int aIndex, int encrypt, int serial);
BOOL CDakosmuGShack::CheckAttackBlock(int aIndex);

private:
void CDakosmuGShack::BPModuleDataSend(int Index);
void CDakosmuGShack::RecvClientModule(RECV_MODULE* pResult, int aIndex);
//===Mess
std::map m_MessageInfoBP;
char* GetMessage(int index);
void CDakosmuGShack::ClearDetectCount(int aIndex);

void CDakosmuGShack::LoadDDakosmuGShack();
std::map m_HackSpeedCheckDB;
std::vector m_XDameData;
std::map m_HackCheckInjectDB;
int CDakosmuGShack::GetCountXDmgInSpeed(LPOBJ lpObj, int Group);
DakosmuGS_HACKSPEED_DATA* GetDataHackSpeed(int SkillID, int SkillType);
void CDakosmuGShack::CalculateSkillFloat(int aIndex);
BOOL CDakosmuGShack::bpSpeedHackCheck(int aIndex, int bIndex, WORD functionID, WORD mskill);
};

extern CDakosmuGShack gDakosmuGShack;

Dakosmuihack2GS.cpp


#include "stdafx.h"
#include "Dakosmuihack2GS.h"
#include "DSProtocol.h"
#include "EffectManager.h"
#include "Map.h"
#include "MemScript.h"
#include "Notice.h"
#include "Util.h"
#include "ItemOptionRate.h"
#include "ObjectManager.h"
#include "Log.h"
#include "User.h"
#include "Trade.h"
#include "Party.h"
#include "Path.h"
#include "Skill.h"
#include "SkillManager.h"
#include "EffectManager.h"
#include "DSProtocol.h"
#include "Attack.h"

CDakosmuGShack gDakosmuGShack;

CDakosmuGShack::CDakosmuGShack()
{
this->HackPlayerEditor = new DakosmuGS2_DATA_CONFIG;
this->HackSpeedMove = new DK_CONFIG_SPEEDMOVE;
this->HackSpeedCheck = new DakosmuGS2_DATA_CONFIG;
this->HackCheckInject = new DakosmuGS2_DATA_CONFIG;
}

CDakosmuGShack::~CDakosmuGShack()
{

}
void CDakosmuGShack::ClearDetectCount(int aIndex)
{
for (int n = 0; n < 5; n++)
{
gObj[aIndex].BHackDetectCount[n] = 0;
}
}
void CDakosmuGShack::SetUserZeroCache(int aIndex)
{
//BProtect
ClearDetectCount(aIndex);
gObj[aIndex].BHackTimeClearDetectCount = 0;
gObj[aIndex].BHackBlockSkillTime = 0;
gObj[aIndex].BHackTimeSendClient = 0;
gObj[aIndex].BHackWaitRecv = 0;
gObj[aIndex].BProtectBlockAttack = 0;
//==CheckSpamRequest
FillMemory(gObj[aIndex].BTargetIndex,sizeof(gObj[aIndex].BTargetIndex),0);
FillMemory(gObj[aIndex].BTargetTime,sizeof(gObj[aIndex].BTargetTime),0);
//---Cache Move XY
gObj[aIndex].BProtect_X = 0;
gObj[aIndex].BProtect_Y = 0;
gObj[aIndex].BProtect_MAP = -1;
gObj[aIndex].BProtect_PV = 0;
gObj[aIndex].BProtectMove_Time = 0;
//=== Float Speed Animation
FillMemory(gObj[aIndex].GroupSkill,sizeof(gObj[aIndex].GroupSkill),0);
//===AutoSkill
gObj[aIndex].UseSkillTime = 0;
gObj[aIndex].UseFameSpeed = 0.0f;
gObj[aIndex].UseSkillSkillId = 0xFFFF;

}

void CDakosmuGShack::LoadFileXML(char* FilePath)
{
this->GhiLogHack = 0;
this->DelayScan = 1;
this->DelayClear = 1;
this->HackPlayerEditor->Clear();
this->HackSpeedMove->Clear();
this->HackSpeedCheck->Clear();
this->HackCheckInject->Clear();
this->RandomSend = 0;
//====================

pugi::xml_document file;
pugi::xml_parse_result res = file.load_file(FilePath);
if (res.status != pugi::status_ok) {
ErrorMessageBox("File %s load fail. Error: %s", FilePath, res.description());
return;
}
//--
pugi::xml_node oAntihackSystem = file.child("AntihackSystem");
this->GhiLogHack = oAntihackSystem.attribute("GhiLogHack").as_int();
this->DelayScan = oAntihackSystem.attribute("DelayScan").as_int();
this->DelayClear = oAntihackSystem.attribute("DelayClear").as_int();
//= Mess Load
pugi::xml_node Message = oAntihackSystem.child("Message");
for (pugi::xml_node msg = Message.child("Msg"); msg; msg = msg.next_sibling())
{
DakosmuGS_INFO_ANTIHACK info;

info.Index = msg.attribute("Index").as_int();

strcpy_s(info.Message, msg.attribute("Text").as_string());

this->m_MessageInfoBP.insert(std::pair(info.Index, info));
}
//= HackPlayerEditor
pugi::xml_node oHackPlayerEditor = oAntihackSystem.child("HackPlayerEditor");
this->HackPlayerEditor->DebugLog = oHackPlayerEditor.attribute("DebugLog").as_int();
this->HackPlayerEditor->Enabled = oHackPlayerEditor.attribute("Enabled").as_int();
this->HackPlayerEditor->NoticeMess = oHackPlayerEditor.attribute("NoticeMess").as_int();
this->HackPlayerEditor->DetectCount = oHackPlayerEditor.attribute("DetectCount").as_int();
this->HackPlayerEditor->TypeCheck = oHackPlayerEditor.attribute("TypeCheck").as_int();
this->HackPlayerEditor->BlockSkillDelay = oHackPlayerEditor.attribute("BlockSkillDelay").as_int();
//= HackSpeedMove
pugi::xml_node oHackSpeedMove = oAntihackSystem.child("HackSpeedMove");
this->HackSpeedMove->DebugLog = oHackSpeedMove.attribute("DebugLog").as_int();
this->HackSpeedMove->Enabled = oHackSpeedMove.attribute("Enabled").as_int();
this->HackSpeedMove->NoticeMess = oHackSpeedMove.attribute("NoticeMess").as_int();
this->HackSpeedMove->DetectCount = oHackSpeedMove.attribute("DetectCount").as_int();
this->HackSpeedMove->GateMove = oHackSpeedMove.attribute("GateMove").as_int();
this->HackSpeedMove->SpeedNormal = oHackSpeedMove.attribute("SpeedNormal").as_float();
this->HackSpeedMove->SpeedPet = oHackSpeedMove.attribute("SpeedPet").as_float();
this->HackSpeedMove->SpeedWing = oHackSpeedMove.attribute("SpeedWing").as_float();
//= HackSpeedCheck
pugi::xml_node oHackSpeedCheck = oAntihackSystem.child("HackSpeedCheck");
this->HackSpeedCheck->DebugLog = oHackSpeedCheck.attribute("DebugLog").as_int();
this->HackSpeedCheck->Enabled = oHackSpeedCheck.attribute("Enabled").as_int();
this->HackSpeedCheck->NoticeMess = oHackSpeedCheck.attribute("NoticeMess").as_int();
this->HackSpeedCheck->DetectCount = oHackSpeedCheck.attribute("DetectCount").as_int();
this->HackSpeedCheck->TypeCheck = oHackSpeedCheck.attribute("TypeCheck").as_int();
this->HackSpeedCheck->BlockSkillDelay = oHackSpeedCheck.attribute("BlockSkillDelay").as_int();
//= HackCheckInject
pugi::xml_node oHackCheckInject = oAntihackSystem.child("HackCheckInject");
this->HackCheckInject->DebugLog         = oHackCheckInject.attribute("DebugLog").as_int();
this->HackCheckInject->Enabled          = oHackCheckInject.attribute("Enabled").as_int();
this->HackCheckInject->NoticeMess = oHackCheckInject.attribute("NoticeMess").as_int();
this->HackCheckInject->DetectCount = oHackCheckInject.attribute("DetectCount").as_int();
this->HackCheckInject->TypeCheck = oHackCheckInject.attribute("TypeCheck").as_int();
this->HackCheckInject->BlockSkillDelay  = oHackCheckInject.attribute("BlockSkillDelay").as_int();
LogAdd(LOG_BLUE, "[AntihackSystem] HPE (%d), HSM (%d), HSC (%d), HCJ (%d)",
this->HackPlayerEditor->Enabled,
this->HackSpeedMove->Enabled,
this->HackSpeedCheck->Enabled,
this->HackCheckInject->Enabled);
this->LoadDDakosmuGShack();
if (this->HackPlayerEditor->Enabled) this->RandomSend++;
if (this->HackCheckInject->Enabled) this->RandomSend++;
}

char* CDakosmuGShack::GetMessage(int index) // OK
{
std::map::iterator it = this->m_MessageInfoBP.find(index);

if (it == this->m_MessageInfoBP.end())
{
char Error[256];
wsprintf(Error, "Could not find message %d!", index);
return Error;
}
else
{
return it->second.Message;
}
}

int CDakosmuGShack::GetCountXDmgInSpeed(LPOBJ lpObj, int Group) // OK
{
if (Group == 0)
{
return 0;
}
for (std::vector::iterator it = this->m_XDameData.begin(); it != this->m_XDameData.end(); it++)
{
if (it->Group == Group && lpObj->PhysiSpeed >= it->MinSpeed && (lpObj->PhysiSpeed <= it->MaxSpeed || it->MaxSpeed == -1))
{
return  it->MaxCount;
}
}

return -1;
}
DakosmuGS_HACKSPEED_DATA* CDakosmuGShack::GetDataHackSpeed(int SkillID, int SkillType) // OK
{

for (std::map::iterator it = this->m_HackSpeedCheckDB.begin(); it != this->m_HackSpeedCheckDB.end(); it++)
{
if (it == this->m_HackSpeedCheckDB.end())
{
return 0;
}
if (SkillID == it->second.m_SkillID)
{
if (SkillType == it->second.m_SkillType || it->second.m_SkillType == -1)
{
return &it->second;
}
}
}

return 0;
}

void CDakosmuGShack::LoadDDakosmuGShack()
{

LPSTR path = gPath.GetFullPath("Hack\\DB_DakosmuHAck.xml");
pugi::xml_document file;
pugi::xml_parse_result res = file.load_file(path);

if (res.status != pugi::status_ok) {
ErrorMessageBox("File %s load fail. Error: %s", path, res.description());
return;
}
this->m_HackSpeedCheckDB.clear();
pugi::xml_node eHackSpeedCheckDB = file.child("HackSpeedCheckDB");

int HackSpeedDBCount = 0;
for (pugi::xml_node rHackSpeedCheckDB = eHackSpeedCheckDB.child("Config"); rHackSpeedCheckDB; rHackSpeedCheckDB = rHackSpeedCheckDB.next_sibling())
{
DakosmuGS_HACKSPEED_DATA info;

info.m_SkillID = rHackSpeedCheckDB.attribute("Skill").as_int(0);
info.m_SkillType = rHackSpeedCheckDB.attribute("SkillType").as_int(0);
info.m_HitDetect = rHackSpeedCheckDB.attribute("HitDectect").as_int(-1);
info.m_DelayCountMin = rHackSpeedCheckDB.attribute("CountMaxInSec").as_int(0);
info.m_DelayMinMs = rHackSpeedCheckDB.attribute("DelayMinMs").as_int(0);
info.m_DelayType = rHackSpeedCheckDB.attribute("DelayType").as_int(0);
info.m_DelayValue = rHackSpeedCheckDB.attribute("DelayValue").as_int(0);
info.m_DelayGroup = rHackSpeedCheckDB.attribute("DelayGroup").as_int(0);
info.m_XDmgAI = rHackSpeedCheckDB.attribute("XDmgAIGroup").as_int(0);
this->m_HackSpeedCheckDB.insert(std::pair(HackSpeedDBCount, info));
HackSpeedDBCount++;
}
this->m_XDameData.clear();
pugi::xml_node oHackXdameCheckDB = file.child("HackXdameCheckDB");
for (pugi::xml_node rXDmgAI = oHackXdameCheckDB.child("XDmgAI"); rXDmgAI; rXDmgAI = rXDmgAI.next_sibling())
{
int Group = rXDmgAI.attribute("Group").as_int();
for (pugi::xml_node rCheck = rXDmgAI.child("Check"); rCheck; rCheck = rCheck.next_sibling())
{
DK_XDAMEHACK_DATA infoXDmg;
infoXDmg.Group = Group;
infoXDmg.MinSpeed = rCheck.attribute("MinSpeed").as_int(0);
infoXDmg.MaxSpeed = rCheck.attribute("MaxSpeed").as_int(0);
infoXDmg.MaxCount = rCheck.attribute("MaxCount").as_int(0);
this->m_XDameData.push_back(infoXDmg);
}
}

this->m_HackCheckInjectDB.clear();
pugi::xml_node eHackCheckInjectDB = file.child("HackCheckInjectDB");

int HackCheckInjectDBCount = 0;
for (pugi::xml_node rHackCheckInjectDB = eHackCheckInjectDB.child("BlackList"); rHackCheckInjectDB; rHackCheckInjectDB = rHackCheckInjectDB.next_sibling())
{
MODULE_DATA infoModule;

infoModule.Index = HackCheckInjectDBCount;
//strcpy_s(infoModule.NameModule, rHackCheckInjectDB.attribute("Name").as_string());
memcpy(infoModule.NameModule, rHackCheckInjectDB.attribute("Name").as_string(), sizeof(infoModule.NameModule));

this->m_HackCheckInjectDB.insert(std::pair(HackCheckInjectDBCount, infoModule));
HackCheckInjectDBCount++;
}

LogAdd(LOG_BLUE, "[AntihackSystem]Load DB -> HackSpeedDBCount [%d] XDmgData [%d] InjectDB[%d]", HackSpeedDBCount, this->m_XDameData.size(), this->m_HackCheckInjectDB.size());

}
void CDakosmuGShack::CalculateSkillFloat(int aIndex)
{
LPOBJ lpUser = &gObj[aIndex];
float nAttack1 = lpUser->PhysiSpeed * 0.004000000189989805; //dword ptr [ebp-0x10]
float nAttack2 = lpUser->PhysiSpeed * 0.002000000094994903; //dword ptr [ebp-0x8]
float nMagic1 = lpUser->MagicSpeed * 0.004000000189989805; //dword ptr [ebp-0xC]
float nMagic2 = lpUser->MagicSpeed * 0.002000000094994903; //dword ptr [ebp-0x4]

for (int n = 0; n < 256; n++)
{
lpUser->GroupSkill[n] = 0;
}

lpUser->GroupSkill[51] = nAttack1 + 0.300000011920929;
lpUser->GroupSkill[60] = nAttack1 + 0.300000011920929;
lpUser->GroupSkill[61] = nAttack1 + 0.300000011920929;
lpUser->GroupSkill[62] = nAttack1 + 0.2700000107288361;
lpUser->GroupSkill[63] = nAttack1 + 0.300000011920929;
lpUser->GroupSkill[64] = nAttack1 + 0.239999994635582;
lpUser->GroupSkill[65] = nAttack1 + 0.239999994635582;
lpUser->GroupSkill[66] = 0.3799999952316284;
lpUser->GroupSkill[67] = 0.3400000035762787;
lpUser->GroupSkill[71] = nAttack1 + 0.25;
lpUser->GroupSkill[80] = nAttack1 + 0.25;
lpUser->GroupSkill[131] = nAttack1 + 0.300000011920929;
lpUser->GroupSkill[136] = nAttack1 + 0.4000000059604645;
lpUser->GroupSkill[137] = nAttack1 + 0.300000011920929;
lpUser->GroupSkill[138] = nAttack1 + 0.2000000029802322;
lpUser->GroupSkill[145] = nAttack1 + 0.25;
lpUser->GroupSkill[146] = nMagic2 + 0.2899999916553497;
lpUser->GroupSkill[147] = nMagic2 + 0.2899999916553497;
lpUser->GroupSkill[150] = nMagic1 + 0.25;
lpUser->GroupSkill[152] = nMagic2 + 0.4000000059604645;
lpUser->GroupSkill[153] = nMagic2 + 0.6000000238418579;
lpUser->GroupSkill[154] = nMagic2 + 0.5;
lpUser->GroupSkill[156] = nMagic2 + 0.300000011920929;
lpUser->GroupSkill[160] = nMagic2 + 0.25;
lpUser->GroupSkill[168] = nMagic2 + 0.25;
lpUser->GroupSkill[176] = 0.300000011920929;
lpUser->GroupSkill[183] = nMagic1 + 0.550000011920929;
lpUser->GroupSkill[184] = nMagic2 + 0.6899999976158142;
lpUser->GroupSkill[185] = nMagic2 + 0.3499999940395355;
lpUser->GroupSkill[247] = nAttack2 + 0.4000000059604645;
lpUser->GroupSkill[248] = nAttack2 + 0.4000000059604645;
lpUser->GroupSkill[249] = nAttack2 + 0.4000000059604645;
lpUser->GroupSkill[250] = nAttack2 + 0.300000011920929;
lpUser->GroupSkill[253] = nAttack2 + 0.300000011920929;
lpUser->GroupSkill[255] = 0.3499999940395355;
}
#include "Protect.h"


BOOL CDakosmuGShack::bpSpeedHackCheck(int aIndex, int bIndex, WORD functionID, WORD mskill)
{
LPOBJ lpObj = &gObj[aIndex];

int Number = aIndex - OBJECT_START_USER;

if (bIndex > MAX_OBJECT && bIndex != 0xFFFF)
{
return false;
}



if (gObjIsConnected(aIndex) == 0)
{
return false;
}


if (!this->HackSpeedCheck->Enabled || lpObj->Type != OBJECT_USER || lpObj->m_OfflineMode != 0 || lpObj->IsFakeOnline != 0)
{
return true;
}



if (mskill != lpObj->UseSkillSkillId)
{
if (this->HackSpeedCheck->DebugLog >= 1)
{
LogAdd(LOG_RED, "[Antihack] Check AutoSkill 1");
}
gObj[aIndex].BHackDetectCount[eHackSpeedCheck]++;
return false;
}
else if ((GetTickCount() - lpObj->UseSkillTime) > 5000)
{
if (this->HackSpeedCheck->DebugLog >= 1)
{
LogAdd(LOG_RED, "[Antihack] Check AutoSkill 2");
}
gObj[aIndex].BHackDetectCount[eHackSpeedCheck]++;
return false;
}
else if ((lpObj->UseFameSpeed > 35.0f))
{
if (this->HackSpeedCheck->DebugLog >= 1)
{
LogAdd(LOG_RED, "[Antihack] Check AutoSkill 3");
}
gObj[aIndex].BHackDetectCount[eHackSpeedCheck]++;
return false;
}

if (gObj[aIndex].BHackDetectCount[eHackSpeedCheck] >= this->HackSpeedCheck->DetectCount && this->HackSpeedCheck->DetectCount > 0)
{
if (this->HackSpeedCheck->TypeCheck == 1 && gObj[aIndex].BHackBlockSkillTime < GetTickCount())
{
gObj[aIndex].BHackBlockSkillTime = GetTickCount() + (this->HackSpeedCheck->BlockSkillDelay * 1000);
}
if (this->HackSpeedCheck->NoticeMess != -1)
{
gNotice.GCNoticeSend(aIndex, 1, 0, 0, 0, 0, 0, this->GetMessage(this->HackSpeedCheck->NoticeMess));
}
if (this->GhiLogHack)
{
gLog.Output(LOG_HACK, "[HackSpeedCheck][%s][%s] HackSpeedCheck Detect! ", gObj[aIndex].Account, gObj[aIndex].Name);

}
return false;
}
int iSkillType = -1;
int iType = 0;
int iValue = 0;
int iGroup = 0;
int iCountMaxInSec = 50;
int iskill = mskill;
int iHitDetect = -1;
int iXDmgAI = -1;
int iDelayMinInSec = 30;

if (functionID == 0 || iskill == 0) //Attack by Hand
{
//147 Phep
iGroup = 80;
iValue = 6;
iType = 1;
}

if (iskill > MAX_SKILL)
{
iGroup = 0;
iType = 0;
return false;
}

DakosmuGS_HACKSPEED_DATA* mInfoSpeedChar = this->GetDataHackSpeed(iskill, functionID);

if (mInfoSpeedChar != 0)
{
iSkillType = mInfoSpeedChar->m_SkillType;
iType = mInfoSpeedChar->m_DelayType;//this->m_DelayType[iskill];
iValue = mInfoSpeedChar->m_DelayValue;
iGroup = mInfoSpeedChar->m_DelayGroup;
iCountMaxInSec = mInfoSpeedChar->m_DelayCountMin;
iHitDetect = mInfoSpeedChar->m_HitDetect;
iXDmgAI = this->GetCountXDmgInSpeed(lpObj, mInfoSpeedChar->m_XDmgAI);
iDelayMinInSec = mInfoSpeedChar->m_DelayMinMs;
}
char sBuff[255] = { 0 };
DWORD nTimeCalc = GetTickCount() - lpObj->BUserAttack[iskill].BPLastAttackTime[functionID];
int nHitInSec = 0;
lpObj->BUserAttack[iskill].BPLastAttackTime[functionID] = GetTickCount();


//if (lpObj->mLastAttackSkillID != iskill)
//{
// lpObj->mLastAttackSkillID = iskill;
// return true;
//}

if (lpObj->BUserAttack[iskill].mSkillFloatHit[functionID] > iCountMaxInSec && iCountMaxInSec > -1 && (functionID == iSkillType || iSkillType == -1))
{
if (this->HackSpeedCheck->DebugLog >= 1)
{
LogAdd(LOG_RED, "[iCountMaxInSec][%d]Type %d Skill [%d] Calc [%d] Min (%d)  Detect [%d] MaxInSec [%d]", functionID, iType, iskill, nTimeCalc, iDelayMinInSec, lpObj->BUserAttack[iskill].BPDetectCount[functionID], iCountMaxInSec);
}
lpObj->BProtectBlockAttack = 1;
gObj[aIndex].BHackDetectCount[eHackSpeedCheck]++;
return false;
}

//===Lon hon HitDetect thi chan hoan toan
if (iHitDetect != -1 && lpObj->BUserAttack[iskill].BPDetectCount[functionID] > iHitDetect)
{
lpObj->BProtectBlockAttack = 1;
gObj[aIndex].BHackDetectCount[eHackSpeedCheck]++;
return false;
}

if (iXDmgAI != -1)
{

if (lpObj->BUserAttack[iskill].xDmgCache[functionID] > iXDmgAI)
{
if (this->HackSpeedCheck->DebugLog >=1)
{
LogAdd(LOG_RED, "[iXDmgAI] [%d]Skill %d (%d/%d)", functionID, iskill, lpObj->BUserAttack[iskill].xDmgCache[functionID], iXDmgAI);
}
lpObj->BProtectBlockAttack = 1;
gObj[aIndex].BHackDetectCount[eHackSpeedCheck]++;
return false;
}
}

if (iGroup != 0 && iType == 1 && (functionID == iSkillType || iSkillType == -1))
{
this->CalculateSkillFloat(aIndex);
int i;
float k = lpObj->GroupSkill[iGroup];
if (k != 0)
{

//LogAdd(LOG_BLUE, "Hack:(%d,%d,%d) %f", iType, iValue, iGroup, k);
for (i = 0; k <= iValue; i++)
{
k = k + lpObj->GroupSkill[iGroup];
}

int itimeskill = i * 30; // 30ms is time of a loop in client

if (itimeskill > 0)
{
nHitInSec = (1000 / itimeskill) + 1;
}
else if (iDelayMinInSec > 0 && itimeskill == 0)
{
nHitInSec = (1000 / iDelayMinInSec) + 1;
}
if (nHitInSec > iCountMaxInSec && iCountMaxInSec != -1)
{
nHitInSec = iCountMaxInSec;
}

if (this->HackSpeedCheck->DebugLog >= 1)
{
//gNotice.GCNoticeSend(aIndex, 1, 0, 0, 0, 0, 0, "[%d][%d/%d]Skill [%d] Calc [%d~%d] Min (%d) Sp (%f/%d) i= %d, Dec %d/%d xDmg %d/%d", functionID, this->mSkillFloatHit[Number], nHitInSec, iskill, nTimeCalc, itimeskill, iDelayMinInSec, k, iValue, i, lpObj->bp_DetectCount, iHitDetect, this->xDmgCache[Number], iXDmgAI);
LogAdd(LOG_RED, "(%d)[%d][%d/%d]Skill [%d] Calc [%d~%d] Min (%d) Sp (%f/%d) i= %d, HDec %d/%d xDmg %d/%d", bIndex, functionID, lpObj->BUserAttack[iskill].mSkillFloatHit[functionID], nHitInSec, iskill, nTimeCalc, itimeskill, iDelayMinInSec, k, iValue, i, lpObj->BUserAttack[iskill].BPDetectCount[functionID], iHitDetect, lpObj->BUserAttack[iskill].xDmgCache[functionID], iXDmgAI);
}

if (nTimeCalc > 0)
{
//=== Nho Hon MS Calc && != X
if ((nTimeCalc < iDelayMinInSec))
{
lpObj->BUserAttack[iskill].BPDetectCount[functionID]++;
return false;
}
//=== Nho Hon MS Calc && != X
if ((nTimeCalc < itimeskill) && i > 0)
{
lpObj->BUserAttack[iskill].BPDetectCount[functionID]++;
return false;
}
//===== Vuot Chi So Hit /Sec
if (lpObj->BUserAttack[iskill].mSkillFloatHit[functionID] > nHitInSec && nHitInSec > 0)
{
lpObj->BProtectBlockAttack = 1;
gObj[aIndex].BHackDetectCount[eHackSpeedCheck]++;
return false;
}
}
else
{
lpObj->BUserAttack[iskill].xDmgCache[functionID]++;

//if (iXDmgAI > 0)
//{
// lpObj->BPDetectCount[functionID]++;
// return false;
//}
}
}
}
else if (iType == 2)
{
if (this->HackSpeedCheck->DebugLog >= 1)
{
LogAdd(LOG_RED, "[%d]Type %d  Skill [%d]  , Delay %d / %d, Detect = %d", functionID, iType, iskill, nTimeCalc, iValue, lpObj->BUserAttack[iskill].BPDetectCount);
}
if (nTimeCalc < iValue)
{
return false;
}
}
else
{

if (this->HackSpeedCheck->DebugLog == 2)
{
LogAdd(LOG_RED, "[OK][%d]Type %d Skill [%d]  , Delay %d / %d, Detect = %d", functionID, iType, iskill, nTimeCalc, iValue, lpObj->BUserAttack[iskill].BPDetectCount);
}
}

lpObj->BUserAttack[iskill].mSkillFloatHit[functionID]++;
return true;
}
void CDakosmuGShack::ViewportProc(int aIndex)
{
if (OBJECT_RANGE(aIndex) == 0)
{
return;
}

if (gObj[aIndex].Type != OBJECT_USER || gObj[aIndex].m_OfflineMode == 1 || gObj[aIndex].IsFakeOnline == 1)
{
goto Exit;
}

if (gObj[aIndex].Connected < OBJECT_ONLINE || gObj[aIndex].Live == 0 || gObj[aIndex].State != OBJECT_PLAYING || gObj[aIndex].Teleport != 0)
{
goto Exit;
}

//==Check Move Speed s
if (this->HackSpeedMove->Enabled)
{
if ((GetTickCount() - gObj[aIndex].BProtectMove_Time) < 3000 || gObj[aIndex].BProtect_X == 0 && gObj[aIndex].BProtect_Y == 0)
{
goto Exit;
}
if (gObj[aIndex].RegenOk > 0 || gObj[aIndex].Teleport != 0 )
{
goto Exit;
}
float PhamViChoPhep = 0.0f;

if (gObj[aIndex].Map >= 18 && (gObj[aIndex].Map <= 23 || gObj[aIndex].Map == 53))
{
goto Exit;
}
else
{
if (gObj[aIndex].BProtect_MAP == gObj[aIndex].Map)
{

gObj[aIndex].BProtect_PV = (float)sqrt(pow(((float)gObj[aIndex].X - (float)gObj[aIndex].BProtect_X), (float)2) + pow(((float)gObj[aIndex].Y - (float)gObj[aIndex].BProtect_Y), (float)2));


//=== Check Item
if (gObj[aIndex].Inventory[7].IsItem())
{
PhamViChoPhep = this->HackSpeedMove->SpeedWing;
}
else if (gObj[aIndex].Inventory[8].m_Index == 6660 || gObj[aIndex].Inventory[8].m_Index == 6693) //Chien Ma, Soi TInh
{
PhamViChoPhep = this->HackSpeedMove->SpeedPet;
}
else
{
PhamViChoPhep = this->HackSpeedMove->SpeedNormal;
}



if (this->HackSpeedMove->DebugLog != 0)
{
gNotice.GCNoticeSend(aIndex, 1, 0, 0, 0, 0, 0, "[DebugMove][%d] Move (%f) || MaxMove (%f)", gObj[aIndex].BHackDetectCount[eHackSpeedMove], gObj[aIndex].BProtect_PV, PhamViChoPhep);
}

if (gObj[aIndex].BProtect_PV > PhamViChoPhep && PhamViChoPhep > 0)
{

if (this->HackSpeedMove->NoticeMess != -1)
{
gNotice.GCNoticeSend(aIndex, 1, 0, 0, 0, 0, 0, this->GetMessage(this->HackSpeedMove->NoticeMess));
}
gObj[aIndex].BHackDetectCount[eHackSpeedMove]++;

if (gObj[aIndex].BHackDetectCount[eHackSpeedMove] >= this->HackSpeedMove->DetectCount && this->HackSpeedMove->DetectCount >0
&& this->HackSpeedMove->GateMove > 0)
{
gObjMoveGate(aIndex, this->HackSpeedMove->GateMove);
}
else
{
gObjTeleport(aIndex, gObj[aIndex].Map, (BYTE)gObj[aIndex].BProtect_X, (BYTE)gObj[aIndex].BProtect_Y);
}
if (this->GhiLogHack)
{
gLog.Output(LOG_HACK, "[HackSpeedMove][%s][%s]Move : [%f > %f] ToaDoCu: (%d/%d) ToaDoMoi: (%d/%d)", gObj[aIndex].Account, gObj[aIndex].Name, gObj[aIndex].BProtect_PV, PhamViChoPhep, gObj[aIndex].BProtect_X, gObj[aIndex].BProtect_Y, gObj[aIndex].X, gObj[aIndex].Y);

}//gNotice.GCNoticeSend(aIndex, 0, 0, 0, 0, 0, 0, "[DetectMove] %d > %d", gObj[aIndex].BProtect_PV, PhamViChoPhep);
}
}
}

}

Exit:
gObj[aIndex].BProtect_X = gObj[aIndex].X;
gObj[aIndex].BProtect_Y = gObj[aIndex].Y;
gObj[aIndex].BProtect_MAP = gObj[aIndex].Map;

if (gObj[aIndex].Type == OBJECT_USER && gObj[aIndex].m_OfflineMode == 0 && gObj[aIndex].IsFakeOnline == 0)
{
//==Clear In Sec
for (int n = 0; n < MAX_SKILL; n++)
{
gObj[aIndex].BUserAttack[n].Clear();
}

if (gObj[aIndex].BProtectBlockAttack == 1)
{
gObj[aIndex].BProtectBlockAttack = 0;
}
if (GetTickCount() > gObj[aIndex].BHackTimeSendClient && gObj[aIndex].Connected >= OBJECT_ONLINE)
{
if (this->RandomSend > 0)
{
srand(static_cast(time(NULL)));
int Random = (rand() % this->RandomSend) + 1;
//LogAdd(LOG_RED, "Send Random %d Check (%d)", Random, this->RandomSend);

switch (Random)
{
case 1:
{
//LogAdd(LOG_BLUE, "[Scan] SendPlayerEditor ");
this->SendPlayerEditor(aIndex);
}
break;
case 2:
{
//LogAdd(LOG_BLUE, "[Scan] BPModuleDataSend ");
this->BPModuleDataSend(aIndex);
}
break;
default:
break;
}

}
//BPModuleDataSend
gObj[aIndex].BHackTimeSendClient = GetTickCount() + (this->DelayScan * 1000);
}
if (GetTickCount() > gObj[aIndex].BHackTimeClearDetectCount)
{
this->ClearDetectCount(aIndex);

gObj[aIndex].BHackTimeClearDetectCount = GetTickCount() + (this->DelayClear * 1000);
}
}

return;
}

void CDakosmuGShack::SendPlayerEditor(int aIndex)
{
if (!this->HackPlayerEditor->Enabled || gObj[aIndex].Type != OBJECT_USER || gObj[aIndex].m_OfflineMode != 0 || gObj[aIndex].IsFakeOnline != 0)
{
return;
}

if (gObj[aIndex].Connected < OBJECT_ONLINE)
{
return;
}
if (gObj[aIndex].BHackWaitRecv > 0)
{
return;
}

//=Set Time Wait
gObj[aIndex].BHackWaitRecv = GetTickCount();

BYTE send[8192];

DK_GUARD_REQ_CHECK pRequest;

pRequest.header.set(0xD4, 0xAA, 0);

int size = sizeof(pRequest);

LPOBJ lpUser = &gObj[aIndex];

pRequest.Level = lpUser->Level;
pRequest.LevelPoint = lpUser->LevelUpPoint;
pRequest.Strength = lpUser->Strength+lpUser->AddStrength;
pRequest.Dexterity = lpUser->Dexterity + lpUser->AddDexterity;
pRequest.Vitality = lpUser->Vitality + lpUser->AddVitality;
pRequest.Energy = lpUser->Energy + lpUser->AddEnergy;
pRequest.Leadership = lpUser->Leadership + lpUser->AddLeadership;
pRequest.AttackSpeed = lpUser->PhysiSpeed;
pRequest.MagicSpeed = lpUser->MagicSpeed;

pRequest.CharSetItem[0] = (lpUser->Inventory[0].IsItem()) ? lpUser->Inventory[0].m_Index : 0;   //Tay Trai
pRequest.CharSetItem[1] = (lpUser->Inventory[1].IsItem()) ? lpUser->Inventory[1].m_Index : 0;   //Tay Phai

pRequest.CharSetItem[2] = (lpUser->Inventory[2].IsItem()) ? lpUser->Inventory[2].m_Index : 0;   //Mu
pRequest.CharSetItem[3] = (lpUser->Inventory[3].IsItem()) ? lpUser->Inventory[3].m_Index : 0;   //Ao
pRequest.CharSetItem[4] = (lpUser->Inventory[4].IsItem()) ? lpUser->Inventory[4].m_Index : 0;   //Quan
pRequest.CharSetItem[5] = (lpUser->Inventory[5].IsItem()) ? lpUser->Inventory[5].m_Index : 0;   //Tay
pRequest.CharSetItem[6] = (lpUser->Inventory[6].IsItem()) ? lpUser->Inventory[6].m_Index : 0;   //Chan

pRequest.CharSetItem[7] = (lpUser->Inventory[7].IsItem()) ? lpUser->Inventory[7].m_Index : 0;   //Canh

pRequest.CharSetItem[8] = (lpUser->Inventory[8].IsItem()) ? lpUser->Inventory[8].m_Index : 0;   //Slot Pet

pRequest.header.size[0] = SET_NUMBERHB(size);
pRequest.header.size[1] = SET_NUMBERLB(size);
// ---
memcpy(send, &pRequest, sizeof(pRequest));

DataSend(aIndex, send, size);

return;
}

void CDakosmuGShack::GetResultPlayerEditor(DK_GUARD_ANS_CHECK* pResult, int aIndex)
{
//LogAdd(LOG_RED, "Debug Send BProtect GetCheckResult 2");

if (!this->HackPlayerEditor->Enabled || gObj[aIndex].Type != OBJECT_USER || gObj[aIndex].m_OfflineMode != 0 || gObj[aIndex].IsFakeOnline != 0)
{
return;
}

if (gObj[aIndex].CloseType != -1) {

return;
}
LPOBJ lpUser = &gObj[aIndex];


char* MemberType[] = { "Level", "LevelPoint", "Strength", "Dexterity", "Vitality", "Energy", "Leadership", "AttackSpeed", "MagicSpeed", "FrameValue", "Animation" , "PetSlot"
, "HelmSlot", "ArmorSlot", "PantsSlot", "GlovesSlot","BootsSlot","WeaponFirstSlot","WeaponSecondSlot","WingsSlot", "HackEditMain" };

//=Clear Time Wait
gObj[aIndex].BHackWaitRecv = 0;

bool Disconnect = false;
int OriginalValue = 0;
int IsStatusHack = 0;
for (int i = 0; i < emMaxCheckVars; i++)
{
if (!pResult->Data[i].Status)
{
IsStatusHack++;
switch (i)
{
case emLevel: {
OriginalValue = lpUser->Level;

}
  break;
case emLevelPoint: {
OriginalValue = lpUser->LevelUpPoint;
}
   break;
case emStrength: {
OriginalValue = lpUser->Strength;
}
break;
case emDexterity: {
OriginalValue = lpUser->Dexterity;
}
  break;
case emVitality: {
OriginalValue = lpUser->Vitality;
}
break;
case emEnergy: {
OriginalValue = lpUser->Energy;
}
   break;
case emLeadership: {
OriginalValue = lpUser->Leadership;
}
   break;
case emAttackSpeed: {
OriginalValue = lpUser->PhysiSpeed;
}
break;
case emMagicSpeed: {
OriginalValue = lpUser->MagicSpeed;
}
   break;

case emPetSlot: {
OriginalValue = lpUser->Inventory[8].m_Index;
}
break;
case emHelmSlot: {
OriginalValue = lpUser->Inventory[2].m_Index;
}
break;
case emArmorSlot: {
OriginalValue = lpUser->Inventory[3].m_Index;
}
  break;
case emPantsSlot: {
OriginalValue = lpUser->Inventory[4].m_Index;
}
  break;
case emGlovesSlot: {
OriginalValue = lpUser->Inventory[5].m_Index;
}
   break;
case emBootsSlot: {
OriginalValue = lpUser->Inventory[6].m_Index;
}
  break;

case emWeaponFirstSlot: { //Trai
OriginalValue = lpUser->Inventory[0].m_Index;
}
break;

case emWeaponSecondSlot: {   //Phai
OriginalValue = lpUser->Inventory[1].m_Index;
}
break;

case emWingsSlot: {   //Canh
OriginalValue = lpUser->Inventory[7].m_Index;

}
  break;

case emEditGame:
{
OriginalValue = 0;
if (pResult->Data[i].Value == 2)
{
return;
}
}
break;
}

//==Fix MiniWing
if(OriginalValue >= 6274 && OriginalValue <= 6279) break;

gObj[aIndex].BHackDetectCount[eHackPlayerEditor]++;
if (gObj[aIndex].BHackDetectCount[eHackPlayerEditor] >= this->HackPlayerEditor->DetectCount && this->HackPlayerEditor->DetectCount >0)
{
char Mes[256];

if (this->HackPlayerEditor->NoticeMess != -1)
{
gNotice.GCNoticeSend(aIndex, 1, 0, 0, 0, 0, 0, this->GetMessage(this->HackPlayerEditor->NoticeMess));
}
if (this->GhiLogHack)
{
gLog.Output(LOG_HACK, "[HackPlayerEditor][%s][%s] [%s] Ori: %d | Edit: %d", gObj[aIndex].Account, gObj[aIndex].Name, MemberType[i], OriginalValue, pResult->Data[i].Value);
}
if (this->HackPlayerEditor->TypeCheck == 1 && gObj[aIndex].BHackBlockSkillTime < GetTickCount())
{
gObj[aIndex].BHackBlockSkillTime = GetTickCount() + (this->HackPlayerEditor->BlockSkillDelay * 1000);
}
}

}
}
if (this->HackPlayerEditor->DebugLog != 0)
{
gNotice.GCNoticeSend(aIndex, 1, 0, 0, 0, 0, 0, "[HackPlayerEditor][%d] Status Hack (%d)", gObj[aIndex].BHackDetectCount[eHackPlayerEditor], IsStatusHack);
}
}
BOOL CDakosmuGShack::CheckAttackBlock(int aIndex)   //Kiem Tra Block Khi Attack
{
if (gObj[aIndex].Type != OBJECT_USER || gObj[aIndex].m_OfflineMode != 0 || gObj[aIndex].IsFakeOnline != 0)
{
return 1;
}

LPOBJ lpObj = &gObj[aIndex];

if (gObj[aIndex].CloseType != -1 || gObj[aIndex].BProtectBlockAttack)
{

return 0;
}

if (gEffectManager.CheckStunEffect(lpObj) != 0)
{
return 0;
}

if ((GetTickCount() - gObj[aIndex].BHackWaitRecv) > 3000 && gObj[aIndex].BHackWaitRecv > 0)
{
//LogAdd(LOG_RED, "[%s][%s] Mat Ket Noi Antihack", gObj[aIndex].Account, gObj[aIndex].Name);
return 0;
}
if (gObj[aIndex].BHackBlockSkillTime > GetTickCount())
{
char Mes[256];
float TimeBlock = (gObj[aIndex].BHackBlockSkillTime - GetTickCount()) / 1000;
wsprintf(Mes, "[System] %s", this->GetMessageA(0));
gNotice.GCNoticeSend(aIndex, 1, 0, 0, 0, 0, 0, Mes, (int)TimeBlock + 1);
return 0;
}
return 1;
}
void CDakosmuGShack::BPModuleDataSend(int Index)
{
if (!this->HackCheckInject->Enabled)
{
return;
}

if (gObjIsConnected(Index) == false )
{
return;
}
if (gObj[Index].BHackWaitRecv > 0)
{
return;
}
//=Set Time Wait
gObj[Index].BHackWaitRecv = GetTickCount();

BYTE send[4096];

DK_MODULE_DATA_SEND pMsg;

pMsg.header.set(0xD4, 0xAC, 0);

int size = sizeof(pMsg);

pMsg.count = 0;


for (int i = 0; i < this->m_HackCheckInjectDB.size(); i++)
{
if (size + sizeof(this->m_HackCheckInjectDB[i]) > 4096)
{
break;
}
//LogAdd(LOG_BLUE, "Send Moudule %s %d", this->m_HackCheckInjectDB[i].NameModule, pMsg.count);
memcpy(&send[size], &this->m_HackCheckInjectDB[i], sizeof(this->m_HackCheckInjectDB[i]));
size += sizeof(this->m_HackCheckInjectDB[i]);
pMsg.count++;

}

pMsg.header.size[0] = SET_NUMBERHB(size);
pMsg.header.size[1] = SET_NUMBERLB(size);
// ---
memcpy(send, &pMsg, sizeof(pMsg));

DataSend(Index, send, size);
}

void CDakosmuGShack::RecvClientModule(RECV_MODULE* pResult, int aIndex)
{
if (gObj[aIndex].Connected < OBJECT_ONLINE)
{
return;
}
if (gObj[aIndex].Type != OBJECT_USER || gObj[aIndex].m_OfflineMode != 0 || gObj[aIndex].IsFakeOnline != 0 || !this->HackCheckInject->Enabled)
{
return;
}
//=Clear Time Wait
gObj[aIndex].BHackWaitRecv = 0;

if (pResult->TypeRecv == 1)
{
LogAdd(LOG_RED, "[HackCheckInject]Acc [%s] Char [%s] TypeLog: %s ", gObj[aIndex].Account, gObj[aIndex].Name, pResult->LogRecv);
if (this->GhiLogHack)
{
gLog.Output(LOG_HACK, "[HackCheckInject]Acc [%s] Char [%s] Module Inject [%s] ", gObj[aIndex].Account, gObj[aIndex].Name, pResult->LogRecv);
}
if (this->HackCheckInject->NoticeMess > 0)
{
gNotice.GCNoticeSend(aIndex, 1, 0, 0, 0, 0, 0, this->GetMessage(this->HackCheckInject->NoticeMess));
}
gObj[aIndex].BProtectBlockAttack = 1;

if (this->HackCheckInject->TypeCheck == 1)
{
gObj[aIndex].BHackBlockSkillTime = GetTickCount() + (this->HackCheckInject->BlockSkillDelay * 1000);
}
//LogAdd(LOG_RED, "RECV_MODULE %d [%s]", pResult->TypeRecv, pResult->LogRecv);
}

}

BOOL CDakosmuGShack::DakosmuGShackPacketRecv(BYTE head, BYTE* recvlpMsg, int size, int aIndex, int encrypt, int serial)
{
LPOBJ lpObj = &gObj[aIndex];
WORD bIndex = 0xFFFF;
int skill = 0;

if (lpObj->Type != OBJECT_USER)
{
return true;
}
switch (head)
{
case PROTOCOL_CODE2:
{
PMSG_ATTACK_RECV* lpMsg = (PMSG_ATTACK_RECV*)recvlpMsg;
bIndex = MAKE_NUMBERW(lpMsg->index[0], lpMsg->index[1]);

//if (!this->CheckFameSpeedUseSkill(0, aIndex, skill))
//{
// return false;
//}

if (!this->bpSpeedHackCheck(aIndex, bIndex, 0, skill))
{
return false;
}
}
break;
case 0x4A:
{
PMSG_RAGE_FIGHTER_SKILL_ATTACK_RECV* lpMsg = (PMSG_RAGE_FIGHTER_SKILL_ATTACK_RECV*)recvlpMsg;
skill = MAKE_NUMBERW(lpMsg->skill[0], lpMsg->skill[1]);
bIndex = MAKE_NUMBERW(lpMsg->index[0], lpMsg->index[1]);
//if (!this->CheckFameSpeedUseSkill(1, aIndex, skill))
//{
// return false;
//}

if (!this->bpSpeedHackCheck(aIndex, bIndex, 1, skill))
{
return false;
}
}
break;
case 0x4B:
{
PMSG_SKILL_DARK_SIDE_RECV* lpMsg = (PMSG_SKILL_DARK_SIDE_RECV*)recvlpMsg;
skill = MAKE_NUMBERW(lpMsg->skill[0], lpMsg->skill[1]);
bIndex = MAKE_NUMBERW(lpMsg->index[0], lpMsg->index[1]);
//if (!this->CheckFameSpeedUseSkill(2, aIndex, skill))
//{
// return false;
//}

if (!this->bpSpeedHackCheck(aIndex, bIndex, 2, skill))
{
return false;
}
}
break;
case 0x19:
{
PMSG_SKILL_ATTACK_RECV* lpMsg = (PMSG_SKILL_ATTACK_RECV*)recvlpMsg;
skill = MAKE_NUMBERW(lpMsg->skill[0], lpMsg->skill[1]);
bIndex = MAKE_NUMBERW(lpMsg->index[0], lpMsg->index[1]);
//LogAdd(LOG_BLACK, "SKill Send %d", skill);
//if (!this->CheckFameSpeedUseSkill(3, aIndex, skill))
//{
// return false;
//}

if (!this->bpSpeedHackCheck(aIndex, bIndex, 3, skill))
{
return false;
}
}
break;
case 0x1E:
{

PMSG_DURATION_SKILL_ATTACK_RECV* lpMsg = (PMSG_DURATION_SKILL_ATTACK_RECV*)recvlpMsg;
skill = MAKE_NUMBERW(lpMsg->skill[0], lpMsg->skill[1]);
bIndex = MAKE_NUMBERW(lpMsg->index[0], lpMsg->index[1]);
//if (!this->CheckFameSpeedUseSkill(5, aIndex, skill))
//{
// return false;
//}

if (!this->bpSpeedHackCheck(aIndex, bIndex, 5, skill))
{
return false;
}
}
break;
case 0xD4:
switch (((recvlpMsg[0] == 0xC1) ? recvlpMsg[3] : recvlpMsg[4]))
{

case 0xAA:
gDakosmuGShack.GetResultPlayerEditor((DK_GUARD_ANS_CHECK*)recvlpMsg, aIndex);
break;
case 0xAB:
gDakosmuGShack.RecvClientModule((RECV_MODULE*)recvlpMsg, aIndex);
break;
case 0xAC:
{
USESKILL_LOG* lpMsg = (USESKILL_LOG*)recvlpMsg;
lpObj->UseSkillTime = GetTickCount();
lpObj->UseFameSpeed = lpMsg->FameSpeed;
lpObj->UseSkillSkillId = lpMsg->SkillID;
//LogAdd(LOG_BLUE, "D3 01 : Skill [%d] F [%f]  TIckCount (%d)", lpObj->UseSkillSkillId, lpObj->UseFameSpeed, lpObj->UseSkillTime);

return false;
}
break;
}
break;
//==Fix Spam Trade
case 0x36:
{

PMSG_TRADE_REQUEST_RECV* lpMsg = (PMSG_TRADE_REQUEST_RECV*)recvlpMsg;
bIndex = MAKE_NUMBERW(lpMsg->index[0], lpMsg->index[1]);
if (bIndex == lpObj->BTargetIndex[1] && (GetTickCount() - lpObj->BTargetTime[1]) < 1000)
{
gNotice.GCNoticeSend(aIndex, 1, 0, 0, 0, 0, 0, "[SpamCheck]Vui long thao tac cham lai!");
lpObj->BTargetTime[1] = GetTickCount();
return false;
}
else
{
lpObj->BTargetIndex[1] = bIndex;
lpObj->BTargetTime[1] = GetTickCount();
}

}
break;
//==Fix Spam Party
case 0x40:
{

PMSG_PARTY_REQUEST_RECV* lpMsg = (PMSG_PARTY_REQUEST_RECV*)recvlpMsg;
bIndex = MAKE_NUMBERW(lpMsg->index[0], lpMsg->index[1]);
if (bIndex == lpObj->BTargetIndex[0] && (GetTickCount() - lpObj->BTargetTime[0]) < 1000)
{
gNotice.GCNoticeSend(aIndex, 1, 0, 0, 0, 0, 0, "[SpamCheck]Vui long thao tac cham lai!");
lpObj->BTargetTime[0] = GetTickCount();
return false;
}
else
{
lpObj->BTargetIndex[0] = bIndex;
lpObj->BTargetTime[0] = GetTickCount();
}

}
break;
}
return true;
}














Bon Dia

Dakosmu

Dakosmu_AntiGS.xml
You require the following to view this post content:
  • You require a post count of at least 1, you need another 1 posts.
[/hide]
Bon Dia

Domedica


🡱 🡳
Real Time Web Analytics