Jump to content
  • We need you!

    You must register to discover all the features of our community!

One method for block prodamage from lalaker1


Recommended Posts

EN:
In developing my antihack protection, I discovered the simplest method of blocking Prodamage de la lalaker1 :ymapplause: 

Spoiler

 


in: src client/userinferface/PythonPlayerEventHandler.h Search:
virtual void OnHit
Replace line with:
virtual void OnHit(UINT uSkill, CActorInstance& rkActorVictim, BOOL isSendPacket, bool fakedata);
in: src client/userinferface/PythonPlayerEventHandler.cpp Search:
CPythonPlayerEventHandler::OnHit
Replace all function with:

void CPythonPlayerEventHandler::OnHit(UINT uSkill, CActorInstance& rkActorVictim, BOOL isSendPacket, bool fakedata = false)
{
    //block lalaker1prodmg
    if (fakedata == false){
        TraceError("HACK GASIT FMM");
        return;
    }
    
    DWORD dwVIDVictim=rkActorVictim.GetVirtualID();

    // Update Target
    CPythonPlayer::Instance().SetTarget(dwVIDVictim, FALSE);
    // Update Target

    if (isSendPacket)
    {
//#define ATTACK_TIME_LOG
#ifdef ATTACK_TIME_LOG
        static std::map<DWORD, float> s_prevTimed;
        float curTime = timeGetTime() / 1000.0f;
        bool isFirst = false;
        if (s_prevTimed.end() == s_prevTimed.find(dwVIDVictim))
        {
            s_prevTimed[dwVIDVictim] = curTime;
            isFirst = true;
        }
        float diffTime = curTime-s_prevTimed[dwVIDVictim];
        if (diffTime < 0.1f && !isFirst)
        {
            TraceError("ATTACK(SPEED_HACK): %.4f(%.4f) %d", curTime, diffTime, dwVIDVictim);
        }
        else
        {
            TraceError("ATTACK: %.4f(%.4f) %d", curTime, diffTime, dwVIDVictim);
        }
        
        s_prevTimed[dwVIDVictim] = curTime;
#endif
        CPythonNetworkStream& rkStream=CPythonNetworkStream::Instance();
        rkStream.SendAttackPacket(uSkill, dwVIDVictim);
    }

    if (!rkActorVictim.IsPushing())
        return;

    // °Ĺ´ë ¸ó˝şĹÍ ąĐ¸˛ Á¦żÜ
    extern bool IS_HUGE_RACE(unsigned int vnum);
    if (IS_HUGE_RACE(rkActorVictim.GetRace()))
        return;


    CPythonCharacterManager::Instance().AdjustCollisionWithOtherObjects(&rkActorVictim);

    const TPixelPosition& kPPosLast=rkActorVictim.NEW_GetLastPixelPositionRef();

    SVictim kVictim;
    kVictim.m_dwVID=dwVIDVictim;
    kVictim.m_lPixelX=long(kPPosLast.x);
    kVictim.m_lPixelY=long(kPPosLast.y);

    rkActorVictim.TEMP_Push(kVictim.m_lPixelX, kVictim.m_lPixelY);

    m_kVctkVictim.push_back(kVictim);
}

in: src client/gamelib/ActorInstaceEvent.cpp Search:
virtual void OnHit
Replace all line with:
virtual void OnHit(UINT uMotAttack, CActorInstance& rkActorVictim, BOOL isSendPacket, bool fakedata) {}

in: src client/gamelib/ActorInstaceEvent.cpp Search:
CActorInstance::__OnHit
Replace the line like this:
rkEventHandler.OnHit(uSkill, rkActorVictm, isSendPacket, true);

in: src client/gamelib/ActorInstace.h Search:
virtual void OnHit(UINT uSkill, CActorInstance& rkActorVictim, BOOL isSendPacket) = 0;
Replace with:
virtual void OnHit(UINT uSkill, CActorInstance& rkActorVictim, BOOL isSendPacket, bool fakedata) = 0;

 

 

Special thanks to smon.

Edited by Catalin2o14
only english (see edit history)
  • Poop 5
Link to post
  • 2 weeks later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.