Fix that Anti-Lead

Results 1 to 7 of 7
  1. #1

    Fix that Anti-Lead

    Here is the source(AntiLead.h):
    Code:
    CDetour ZGameClient__OnCommandDet;
    CDetour ZCharacter__OnDamagedDetour;
    CDetour ZMyCharacter__OnDamagedDetour;
    const int PacketResponses[] = { 0x12F, 0x51B, 0x516, 0x517,  0x3F9, 0x5A2};
    
    
    CDetour MAddSharedCommandTableDet;
    void MAddSharedCommandTableHook (MCommandManager* pCommandManager, int nSharedType)
    {
    	auto shotPacket = new MCommandDesc(0x3F9, "", "", 1);
    
    	shotPacket->AddParamDesc(new MCommandParameterDesc(MPT_INT, ""));
    	shotPacket->AddParamDesc(new MCommandParameterDesc(MPT_FLOAT, ""));
    	shotPacket->AddParamDesc(new MCommandParameterDesc(MPT_FLOAT, ""));
    	shotPacket->AddParamDesc(new MCommandParameterDesc(MPT_FLOAT, ""));
    	shotPacket->AddParamDesc(new MCommandParameterDesc(MPT_INT, ""));
    	shotPacket->AddParamDesc(new MCommandParameterDesc(MPT_INT, ""));
    	shotPacket->AddParamDesc(new MCommandParameterDesc(MPT_FLOAT, ""));
    	shotPacket->AddParamDesc(new MCommandParameterDesc(MPT_FLOAT, ""));
    	shotPacket->AddParamDesc(new MCommandParameterDesc(MPT_INT, ""));
    	shotPacket->AddParamDesc(new MCommandParameterDesc(MPT_INT, ""));
    
    	pCommandManager->AddCommandDesc(shotPacket);
    
    	//! Ban Request
    	{
    		MCommandDesc* pBanDesc = new MCommandDesc(0x1337, "", "", 1);
    		pBanDesc->AddParamDesc(new MCommandParameterDesc(MPT_STRING, ""));
    		pBanDesc->AddParamDesc(new MCommandParameterDesc(MPT_STRING, ""));
    		pCommandManager->AddCommandDesc(pBanDesc);
    	}
    
    	//! DC Request
    	{
    		MCommandDesc* pDCDesc = new MCommandDesc(0x1338, "", "", 1);
    		pDCDesc->AddParamDesc(new MCommandParameterDesc(MPT_STRING, ""));
    		pDCDesc->AddParamDesc(new MCommandParameterDesc(MPT_STRING, ""));
    		pCommandManager->AddCommandDesc(pDCDesc);
    	}
    
    	//! Mute Request
    	{
    		MCommandDesc* pMuteDesc = new MCommandDesc(0x1339, "", "", 1);
    		pMuteDesc->AddParamDesc(new MCommandParameterDesc(MPT_STRING, ""));
    		pMuteDesc->AddParamDesc(new MCommandParameterDesc(MPT_STRING, ""));
    		pCommandManager->AddCommandDesc(pMuteDesc);
    	}
    
    	{
    		MCommandDesc* pAutoBanDesc = new MCommandDesc(0x133B, "", "", 1);
    		pCommandManager->AddCommandDesc(pAutoBanDesc);
    	}
    
    	auto gameInterface = ((DWORD* (__cdecl*)())ZGetGameInterfaceAddress)();
        auto chat = ((gameInterface)+(0x380/sizeof(DWORD)));
        auto cmdManager = (DWORD*)((chat)+(0x4/sizeof(DWORD)));
    
        ZChatCmdManager__AddCommand(cmdManager, 0, "fps", UpdateFps, 0xf, 0, 0, false, "/fps 500", "Fps Updater");
    	ZChatCmdManager__AddCommand(cmdManager, 0, "listfps", ListFps, 0xf, 0, 0, false, "/listfps", "listfps");
    	ZChatCmdManager__AddCommand(cmdManager, 0, "texture", UpdateTextures, 0xf, 0, 0, false, "/texture", "textures");
    
    }
    
    
    bool __stdcall ZGameClient__OnCommandHook(MCommand* pCommand)
    {
    	Log::GetInstance()->info((boost::format("Got packet: [%1%]") % pCommand->m_pCommandDesc->m_szName).str().c_str());
    	for (int i = 0; i < 7; ++i)
    	{
    		if(pCommand->m_pCommandDesc->m_nCommandId == PacketResponses[i] && pCommand->m_uidSender.uidHigh != 2)
    		{
    			ZGameClient__OnCommandDet.Ret(FALSE);
    			Log::GetInstance()->error((boost::format("Invalid packet response: [%1%] recieved from %2%") % pCommand->m_pCommandDesc->m_szName % pCommand->m_uidSender.uidHigh).str().c_str());
    			return true;
    		}
    	}
    
    	if (pCommand->m_pCommandDesc->m_nCommandId == 0x2744)
    	{
    		int nId = 0;
    		char szMsg[512];
    
    		pCommand->GetParameter(szMsg, 1, MPT_STRING, 512);
    
    		if(strlen(szMsg) > 200)
    		{
    			ZGameClient__OnCommandDet.Ret(false);
    			return false;
    		}
    	}
    	if (pCommand->m_pCommandDesc->m_nCommandId == 0x3F9)
    	{
    		ZGameClient__OnCommandDet.Ret(false);
    		MUID uidPlayer;
    		float x,y,z,damage,ratio;
    		int ztype,wtype,mtype;
    
    		uidPlayer.uidLow = 0;
    		pCommand->GetParameter(&uidPlayer.uidHigh, 0, MPT_INT, -1);
    
    
    		if (pCommand->m_uidSender.uidHigh != GetMe().uidHigh)
    		{
    			MUID uidFrom;
    			uidFrom.uidLow = 0;
    
    			pCommand->GetParameter(&x, 1, MPT_FLOAT, -1);
    			pCommand->GetParameter(&y, 2, MPT_FLOAT, -1);
    			pCommand->GetParameter(&z, 3, MPT_FLOAT, -1);
    			pCommand->GetParameter(&ztype, 4, MPT_INT, -1);
    			pCommand->GetParameter(&wtype, 5, MPT_INT, -1);
    			pCommand->GetParameter(&damage, 6, MPT_FLOAT, -1);
    			pCommand->GetParameter(&ratio, 7, MPT_FLOAT, -1);
    			pCommand->GetParameter(&mtype, 8, MPT_INT, -1);
    			pCommand->GetParameter(&uidFrom.uidHigh, 9, MPT_INT, -1);
    	
    			D3DXVector3 pos;
    			pos.x = x;
    			pos.y = y;
    			pos.z = z;
    
    
    			if (damage > 150 || ratio > 2)
    			{
    				Log::GetInstance()->warning((boost::format("Player: [%2%] attempted to hack the anti-lead [%2% dmg]") % Find(pCommand->m_uidSender)->Name % damage).str().c_str());
    				ZPrint("Player: %s is attempting to hack the anti-lead!", Find(pCommand->m_uidSender)->Name);
    				damage = 0;
    			}
    
    			//ZCharacter__OnDamagedDetour.Remove();
    			if (Find(GetMe()) != NULL)
    			{
    				if (uidPlayer.uidHigh == GetMe().uidHigh)
    				{
    					MSTAGE_SETTING_NODE& pNode = ZGetGameClient()->GetStageSetting()->GetStageSettingNode();
    				
    					if ((pNode.nGameType == 0 || pNode.nGameType == 2 || pNode.nGameType == 5 || pNode.nGameType == 6 || pNode.nGameType == 10) || (Find(GetMe())->IsTeam(Find(pCommand->m_uidSender)) && pNode.bTeamKillEnabled) || !Find(GetMe())->IsTeam(Find(pCommand->m_uidSender)))
    					{
    						Find(GetMe())->OnDamaged(Find(uidFrom), pos, ztype, wtype, damage, ratio, mtype);
    					}
    				}
    			}
    		}
    	}
    
    	return true;
    }
    
    void __stdcall ZMyCharacter__OnDamagedHook(ZCharacter* pAttacker,D3DXVECTOR3 srcPos,int ZDAMAGETYPE, int WeaponType,float fDamage,float fPiercingRation,int nMeleeType)
    {
    	if(!strstr(ZGetGameClient()->CurrentChannel, "[LEAD]"))
    	{
    		MSTAGE_SETTING_NODE& pNode = ZGetGameClient()->GetStageSetting()->GetStageSettingNode();
    		if ((ZDAMAGETYPE == 5 && nMeleeType == -1) || pNode.nGameType == 8)
    		{
    			//! Massives.
    			ZMyCharacter__OnDamagedDetour.Ret(true);
    			return;
    		}
    
    
    		if(ZDAMAGETYPE != 1 && ZDAMAGETYPE != 2 && pNode.nGameType != 7 && pAttacker->GetUID().uidHigh != GetMe().uidHigh)
    		{
    			ZMyCharacter__OnDamagedDetour.Ret(false);
    			ZMyCharacter__OnDamagedDetour.Org(pAttacker, srcPos, ZDAMAGETYPE, WeaponType, 0, 0, nMeleeType);
    		}
    		else
    		{
    			ZMyCharacter__OnDamagedDetour.Ret(true);
    		}
    	}
    	else
    	{
    		ZMyCharacter__OnDamagedDetour.Ret(true);
    	}
    }
    void __stdcall ZCharacter__OnDamagedHook(ZCharacter* pAttacker,D3DXVECTOR3 srcPos,int ZDAMAGETYPE, int WeaponType,float fDamage,float fPiercingRation,int nMeleeType)
    {	
    	if(!strstr(ZGetGameClient()->CurrentChannel, "[LEAD]"))
    	{
    		auto pVictim = (ZCharacter*)ZCharacter__OnDamagedDetour.GetThisPtr();
    
    		if (ZDAMAGETYPE == 1)
    		{
    			//Don't lead melee.
    			return;
    		}
    
    		if (pAttacker == Find(GetMe()) && pVictim != Find(GetMe()))
    		{
    			MCommand* pCmd = MCommand::Create(0x3F9);
    			//pCmd->m_uidReceiver = pVictim->GetUID();
    			pCmd->AddParameter(new MCommandParameterInt(pVictim->GetUID().uidHigh));
    			pCmd->AddParameter(new MCommandParameterFloat(srcPos.x));
    			pCmd->AddParameter(new MCommandParameterFloat(srcPos.y));
    			pCmd->AddParameter(new MCommandParameterFloat(srcPos.z));
    			pCmd->AddParameter(new MCommandParameterInt(ZDAMAGETYPE));
    			pCmd->AddParameter(new MCommandParameterInt(WeaponType));
    			pCmd->AddParameter(new MCommandParameterFloat(fDamage));
    			pCmd->AddParameter(new MCommandParameterFloat(fPiercingRation));
    			pCmd->AddParameter(new MCommandParameterInt(nMeleeType));
    			pCmd->AddParameter(new MCommandParameterInt(0));
    			MCommand::Post(pCmd);
    
    			fDamage = 0;
    		}
    	}
    }
    Well,I guess you know which source this.
    Getting disconnect when I hit some one.(same with the others)
    We can hit only with swords.. I am trying to fix it about 6 hours but still same problem,I did something that it blocks the disconnect but we can't hit,I mean >> 0 dmg.

    Version : Jun 13 2007

    Any help will be appreciated.


  2. #2
    igunz.net Dawson is offline
    LegendRank
    Feb 2010 Join Date
    ::1 (Canada BC)Location
    2,581Posts

    Re: Fix that Anti-Lead

    XD The WTT no-lead sucks dick anyway, it's non responsive, laggy, and generally looses packets.

  3. #3

    Re: Fix that Anti-Lead

    AntiHack + Anti Lead,same source(GunzProtect)..
    There is way to remove it?

  4. #4
    Doggie And Rice. Military is offline
    MemberRank
    Jun 2009 Join Date
    Here and AboutLocation
    3,302Posts

    Re: Fix that Anti-Lead

    Quote Originally Posted by alish1558 View Post
    AntiHack + Anti Lead,same source(GunzProtect)..
    There is way to remove it?
    GunzProtect was made for Pijji and I don't think that Pijji was 2007.

  5. #5

    Re: Fix that Anti-Lead

    Quote Originally Posted by Military View Post
    GunzProtect was made for Pijji and I don't think that Pijji was 2007.
    It works fine.. just the anti lead have problem.

  6. #6
    Doggie And Rice. Military is offline
    MemberRank
    Jun 2009 Join Date
    Here and AboutLocation
    3,302Posts

    Re: Fix that Anti-Lead

    Quote Originally Posted by alish1558 View Post
    It works fine.. just the anti lead have problem.
    It's probably the packets.

  7. #7

    Re: Fix that Anti-Lead

    Quote Originally Posted by Military View Post
    It's probably the packets.
    So how do I fix this ? Or can it be removed from the Anti Hack ?



Advertisement