Jump to content

Recommended Posts

  • Premium

Hello. I have a really easy fix for the default CBanwordManager::CheckString implementation. So the issue is: lets say we have a word "bitch" defined in banword. If we pass string "Bitch" through the CheckString it will return false which is not a proper behaviour. Players can remove insult.txt content from the client and name their characters with profane words avoiding the proper check. Lets get into it.
 

diff --git a/game/src/banword.cpp b/game/src/banword.cpp
--- a/game/src/banword.cpp
+++ b/game/src/banword.cpp
@@ -39,8 +39,11 @@
 	__typeof(m_hashmap_words.begin()) it = m_hashmap_words.begin();
 
+	std::string input(c_pszString, _len);
+	std::transform(input.begin(), input.end(), input.begin(), ::tolower);
+
 	while (it != m_hashmap_words.end())
 	{
 		const std::string & r = it->first;
-		const char * tmp = c_pszString;
+		const char * tmp = input.c_str();
 		ssize_t len = _len;
 

 

  • Metin2 Dev 2
  • Love 1
Link to comment
https://metin2.dev/topic/32852-banword-can-be-fooled-with-character-case/
Share on other sites

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.