Jump to content

[FIX] Flooding CPU Attack - Ikarus Offlineshop System


Recommended Posts

Hi guys, 

There's a guy that is blackmailing all servers that are using my offlineshop.

Not just my clients, but also those who downloaded it from some idiot's leak.

I'm sharing the fix here as 60/70% of the servers currently open use my shop.

 

Fix:

Spoiler

//FILE : new_offlineshop_manager.cpp
//SEARCH FOR
	bool CShopManager::RecvShopCreateOfferClientPacket(LPCHARACTER ch, TOfferInfo& offer)
	{
		if(!ch)
			return false;

		//offlineshop-updated 03/08/19
		if(ch->GetPlayerID() == offer.dwOwnerID)
			return false;

//ADD UNDER
		// fix flooding offers
		if (!CheckOfferCooldown(ch->GetPlayerID()))
			return false;
      

      
      
//SEARCH FOR:  
    void CShopManager::ClearSearchTimeMap()
	{
		m_searchTimeMap.clear();

//ADD UNDER
		// fix flooding offers
		m_offerCooldownMap.clear();
      
      
      
      
      
      
//SEARCH FOR      
	void CShopManager::ClearSearchTimeMap()
	{
		m_searchTimeMap.clear();
	}

      
//ADD UNDER
	// fix flooding offers
	bool CShopManager::CheckOfferCooldown(DWORD dwPID) {
		DWORD now = get_dword_time();
		const DWORD cooldown_seconds = 15;

		itertype(m_offerCooldownMap) it = m_offerCooldownMap.find(dwPID);
		if (it == m_offerCooldownMap.end()) {
			m_offerCooldownMap[dwPID] = now + cooldown_seconds *1000;
			return true;
		}

		if (it->second > now)
			return false;

		it->second = now + cooldown_seconds * 1000;
		return true;
	}
     
      
      
      
      
      
//FILE : new_offlineshop_manager.h
//SEARCH FOR:
        //search time map (checking to avoid search abouse)
		void		ClearSearchTimeMap();
		bool		CheckSearchTime(DWORD dwPID);

//ADD UNDER:
		// fix flooding offers
		bool		CheckOfferCooldown(DWORD dwPID);
 
      
      
      
//SEARCH FOR:
        AUCTIONMAP		m_mapAuctions;
//ADD UNDER:
		// fix flooding offers
		SEARCHTIMEMAP	m_offerCooldownMap;
      
      

      
      
//SEARCH FOR
int OfflineshopPacketCreateNewShop(LPCHARACTER ch, const char* data, int iBufferLeft)
{
	offlineshop::TSubPacketCGShopCreate* pack = nullptr;
	if(!CanDecode(pack, iBufferLeft))
		return -1;

	int iExtra=0;
	data = Decode(pack, data, &iExtra, &iBufferLeft);

	offlineshop::TShopInfo& rShopInfo = pack->shop;

  
 
//ADD UNDER
	//fix flooding
	if (rShopInfo.dwCount > 500 || rShopInfo.dwCount == 0) {
		sys_err("tried to open a shop with 500+ items.");
		return -1;
	}
      
      
      
      
      
      
      
//FILE : ClientManagerOfflineshop.cpp
//SEARCH FOR:

bool CClientManager::RecvOfflineShopOfferAccepted(const char* data)
{
	offlineshop::TSubPacketGDOfferAccept* subpack;
	data = Decode(subpack, data);

	offlineshop::COfferCache::TOfferCacheInfo* pOffer=nullptr;
	m_offlineshopOfferCache.Get(subpack->dwOfferID,&pOffer);
  
//ADD UNDER:
    if(!pOffer)
    	return true;

 

 

 

Random User :
Why are u sharing it using metin2dev?

Answer:
I m bored to see this guy make money by blackmailing.

 

 

Random User part2:
Is it right to share this fix even with those who are not your customer?

 

 

Answer:
I honestly think that anyone who uses the shop without permission, taking it from sources different from me, is not worthy of help from me, however I can't even allow so many people to be fooled by this idiot boy.

 

 

Random User part3:
Do you know who is blackmailing the p.server founders?

 

Answer:
Yes, i know his discord account Mădălin#2332

I recommend to don't pay him at all. I would like to know other accounts of this guy, if anyone know some please report to me.

I also have the proofs about what i m talking.

 

 

 

BIG DISCLAIMER:
Test the code on a test-sever before to move it on a live-server.

Thanks to @VegaS™ for the tip about cooldown

Edited by Ikarus_
  • Love 14

My youtube channel  on which you can see my works here

Link to post
  • Moderator

Typical for romanians, they're so hungry for money..

 

@MadalinAlaska - Banned

You should know that with those things what you did, you won't be happy in a long term.

Have careful with karma, you'll have a server online in one day, those guys will revenge themselves somehow.

  • Love 1
  • Good 3
Link to post
  • VIP

and he still saying that to me if i have more money to pay he will tell me more fixes 

  • Angry 1

" Don`t pretend things change if you always do the same thing"

"Don`t give up on a dream for how long it will take, time will pass the same"

Link to post
4 minutes ago, ALF said:

and he still saying that to me if i have more money to pay he will tell me more fixes 

I m available on discord for who want help 
IkarusDeveloper#3677

 

 

Edited by Ikarus_
  • Love 1

My youtube channel  on which you can see my works here

Link to post
On 1/12/2021 at 11:54 PM, MrQuin said:

Random User part4:
Can you share the base so we can use the fix?

Answer:
Yes

Can you share 200€?

 

 

Edited by AKUROS
Link to post

My server didn't working after this

 

https://gyazo.com/96d79688759b093f045bd17129656189

https://gyazo.com/ce5f8cea0ea002cb28d72dbfec4858f6

 

SYSERR: Jan 15 03:30:35 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Jan 15 03:30:37 :: Process: FDWATCH: peer null in event: ident 21

 

 

Link to post
  • VIP
34 minutes ago, CaNNab1S said:

My server didn't working after this

 

https://gyazo.com/96d79688759b093f045bd17129656189

https://gyazo.com/ce5f8cea0ea002cb28d72dbfec4858f6

 

SYSERR: Jan 15 03:30:35 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Jan 15 03:30:37 :: Process: FDWATCH: peer null in event: ident 21

 

 

https://gyazo.com/ce5f8cea0ea002cb28d72dbfec4858f6

 

the problem is not the fix check ur sysser better because i used the fix and in 1st time it work

" Don`t pretend things change if you always do the same thing"

"Don`t give up on a dream for how long it will take, time will pass the same"

Link to post
  • VIP
8 minutes ago, CaNNab1S said:

All the server it works after this fix.

 so re check what u did wrong 

" Don`t pretend things change if you always do the same thing"

"Don`t give up on a dream for how long it will take, time will pass the same"

Link to post
5 hours ago, CaNNab1S said:

My server didn't working after this

 

https://gyazo.com/96d79688759b093f045bd17129656189

https://gyazo.com/ce5f8cea0ea002cb28d72dbfec4858f6

 

SYSERR: Jan 15 03:30:35 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Jan 15 03:30:37 :: Process: FDWATCH: peer null in event: ident 21

 

 

Then buy that offlineshop from Ikarus and don't cry.

  • Lmao 1
  • Vomit 1
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



Shoutbox

Shoutbox

Chatroom Rules

 

Join our Discord

A request for help = Shoutbox Ban

Be respectful & Respect the rules

 

×
×
  • 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.