Jump to content

Recommended Posts

I am not going to make this longer than needed, some hacks are using the bouquet to deal insta damage to mobs/stones and bypass every anticheat there is, not a single one will stop it, so here is how you can fix it.

In UserInterface/InstanceBase.cpp under BOOL CInstanceBase::IsHoldingPickAxe() add this ->
 

Spoiler
BOOL CInstanceBase::IsWearingBouquet()
{
	const int c_iBouqetteStart = 50201;
	const int c_iBouqetteEnd = 50204;
	return m_awPart[CRaceData::PART_WEAPON] >= c_iBouqetteStart && m_awPart[CRaceData::PART_WEAPON] <= c_iBouqetteEnd;
}

Inside the bool CInstanceBase::CanAttack() function in the same file add this ->


 

Spoiler
	if (IsWearingBouquet())
		return false;


In the InstanceBase.h file under BOOL IsHoldingPickAxe(); add this ->
 

Spoiler
BOOL IsWearingBouquet();


If your client is running 64bit then you should not worry, you can't waithack on 64bit clients, if you aren't, then you might wanna have a look. Please do not try to tell me that this does not work as i've took half an hour to recreate the same exploit myself and it simply works, tested on CShield and other turkish anticheats on the market.

  • Metin2 Dev 6
  • Good 5
  • Love 1
  • Love 1

Software Engineer @ CNH Industrial (NAFTA/EMEA)

Link to comment
https://metin2.dev/topic/33395-patch-for-bouquet-sync-damage-exploit/
Share on other sites

37 minutes ago, Lufbert said:

Its clientside, it will not fix anything.
I mean, it will fix it maybe temporary but for cheat creators to bypass it it will be like 10 extra minutes of work.

Please have a look what the CanAttack function does. If you tell the client not to send attack packets with that certain item, it won't and you won't be able to do anything about it unless someone bytepatches the code, which is going to be useless as proper servers will constantly verify the checksum of the client upon launching.

Software Engineer @ CNH Industrial (NAFTA/EMEA)

  • Forum Moderator

Thank you for the release, but as a rule of thumb, it is always better to also (and mainly) enforce that on the server, which can be done easily in ::Attack(). Only doing that on the client side can still leave you open to spoofed attack packets, even if it is a deterrent. I was not aware of this issue, the share is really appreciated! 

  • Metin2 Dev 3

Gurgarath
coming soon
My Services

  • Premium
56 minutes ago, Gurgarath said:

Thank you for the release, but as a rule of thumb, it is always better to also (and mainly) enforce that on the server, which can be done easily in ::Attack(). Only doing that on the client side can still leave you open to spoofed attack packets, even if it is a deterrent. I was not aware of this issue, the share is really appreciated! 

Following this message, enforcing on the server would be something like this:

bool CHARACTER::Attack(LPCHARACTER pkVictim, uint8_t bType)
{
	....
	
	if (IsPC())
	{
		if (IS_SPEED_HACK(this, pkVictim, dwCurrentTime))
			return false;

		if (bType == 0 && dwCurrentTime < GetSkipComboAttackByTime())
			return false;

		const uint16_t part_weapon = GetPart(PART_WEAPON);
		if (part_weapon >= 50201 && part_weapon <= 50204)
			return false;
	}
}

 

  • Metin2 Dev 4
  • Flame 1
  • Premium
1 hour ago, FrenchForeignLegion said:

Please have a look what the CanAttack function does. If you tell the client not to send attack packets with that certain item, it won't and you won't be able to do anything about it unless someone bytepatches the code, which is going to be useless as proper servers will constantly verify the checksum of the client upon launching.

Most cheats dont even use that CanAttack function, just sent plain attack packet to specific vid

  • Good 1
  • Honorable Member

The bouquet is using the subtype 10, and it's not in the ESubWeaponTypes enum.

In the CHARACTER::Damage you can do this:

bool CHARACTER::Damage(LPCHARACTER pAttacker, int dam, EDamageType type) // returns true if dead
{
    if (pAttacker && pAttacker->IsPC() && pAttacker->GetWear(WEAR_WEAPON) && pAttacker->GetWear(WEAR_WEAPON)->GetSubType() >= WEAPON_NUM_TYPES)
    {
        SendDamagePacket(pAttacker, 0, DAMAGE_BLOCK);
        return false;
    }

Otherwise you create WEAPON_BOUQUET = 10, and edit it with

bool CHARACTER::Damage(LPCHARACTER pAttacker, int dam, EDamageType type) // returns true if dead
{
    if (pAttacker && pAttacker->IsPC() && pAttacker->GetWear(WEAR_WEAPON) && pAttacker->GetWear(WEAR_WEAPON)->GetSubType() == WEAPON_BOUQUET)
    {
        SendDamagePacket(pAttacker, 0, DAMAGE_BLOCK);
        return false;
    }

Or a mix of both:

	if (pAttacker && pAttacker->IsPC())
	{
		const auto weapon = pAttacker->GetWear(WEAR_WEAPON);
		if (weapon && (weapon->GetSubType() >= WEAPON_NUM_TYPES || weapon->GetSubType() == WEAPON_BOUQUET))
		{
			SendDamagePacket(pAttacker, 0, DAMAGE_BLOCK);
			return false;
		}
	}

 

Edited by martysama0134
  • Metin2 Dev 3
  • Love 6
  • 1 month later...
  • Active+ Member

Hello, first of all, thank you for revealing this problem. I wrote a serverside check for the solution to this problem and more, it is quite detailed, i am sharing it in case it may be useful to someone;

 

char.cpp

This is the hidden content, please

Best regards, MT2Dev.

  • Metin2 Dev 65
  • Flame 1
  • Good 8
  • Love 20

spacer.png

©

  • 10 months later...

I have this error. I already checked for DAMAGE_BLOCK inside of enum DamageFlag from char_battle.cpp. What's missing or what i did wrong? Thank you.

UoiSG0d.png

Edited by Metin2 Dev International
Core X - External 2 Internal

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



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.