Sari la conținut
Te plictisesti? te asteptam pe platforma noastra de jocuri online!
Robot

[FIX] PM flooder kick hack

Postări Recomandate

Hi everyone,

Maybe just in my country, but it looks so many people started using

Hidden Content

    Give reaction or reply to this topic to see the hidden content.
PM flooder which cause a buffer overflow in the target client. It can be fixed easily on server-side, so let's do it:

 

Add these functions as public to char.h:

    void ClearPMCounter(void)       { m_iPMCounter = 0;      } 
    void IncreasePMCounter(void)    { m_iPMCounter++;        }
    void SetLastPMPulse(void);
    int  GetPMCounter(void)   const { return m_iPMCounter;   }
    int  GetLastPMPulse(void) const { return m_iLastPMPulse; }
    

Add these to char.h too, but as protected:

int m_iLastPMPulse;
int m_iPMCounter;
    

Add this function to char.cpp:

void CHARACTER::SetLastPMPulse(void)
{
      m_iLastPMPulse = thecore_pulse() + 25;
}

Still in char.cpp search for the Initialize and add these to the function:

m_iLastPMPulse = 0;
m_iPMCounter = 0;

Now navigate to the Whisper function in input_main.cpp and add this after the iExtraLen variable checking at the top:

if (ch->GetLastPMPulse() < thecore_pulse())
     ch->ClearPMCounter();
     
if (ch->GetPMCounter() > 3 && ch->GetLastPMPulse() > thecore_pulse())
{
   ch->GetDesc()->SetPhase(PHASE_CLOSE);
   return -1;
} 

Search for this still in the Whisper function:

if (pkChr == ch)
    return (iExtraLen);
    

Add these after that:

ch->IncreasePMCounter();
ch->SetLastPMPulse();
    

Partajează acest post


Link spre post
Distribuie pe alte site-uri
-

Creează un cont sau autentifică-te pentru a adăuga comentariu

Trebuie să fi un membru pentru a putea lăsa un comentariu.

Creează un cont

Înregistrează-te pentru un nou cont în comunitatea nostră. Este simplu!

Înregistrează un nou cont

Autentificare

Ai deja un cont? Autentifică-te aici.

Autentifică-te acum

×