• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Fix/Patch Player Protection against debuging client with ElfBot NG

Status
Not open for further replies.

Dulin

Member
Joined
Mar 16, 2008
Messages
284
Reaction score
8
Location
Nie wiem?
How to work:
Elfbot NG cheaters sending to servers messages length > 256 characters, server send this message to your client and you got debug ;x (buffer overflow)
Example:
Code:
auto 100 say "dsahjdnsjadhasujh238d23h783hcsjdchsdjklshavhdfjkvfhfjdhklhdjvkhfjkdhsljdhjahldjkdhfjsdklhfasdjklfhdjkshfsdjkfhdslfashfdjklshfsdjklfhskflhsczxcdsahjdnsjadhasujh238d23h783hcsjdchsdjklshavhdfjkvfhfjdhklhdjvkhfjkdhsljdhjahldjkdhfjsdklhfasdjklfhdjkshfsdjkfhdslfashfdjklshfsdjklfhskflhsczxcdsahjdnsjadhasujh238d23h783hcsjdchsdjklshavhdfjkvfhfjdhklhdjvkhfjkdhsljdhjahldjkdhfjsdklhfasdjklfhdjkshfsdjkfhdslfashfdjklshfsdjklfhskflhsczxcdsahjdnsjadhasujh238d23h783hcsjdchsdjklshavhdfjkvfhfjdhklhdjvkhfjkdhslj"

How to protect:
open game.cpp
and find:
Code:
return g_chat.talkToChannel(player, type, text, channelId);
replace with:
Code:
if(text.length() > 256)
   return g_chat.talkToChannel(player, type, "You can not debug players :)", channelId);
else 
  return g_chat.talkToChannel(player, type, text, channelId);
find:
Code:
tmpPlayer->sendCreatureSay(creature, type, text, &destPos);
replace with:
Code:
if(text.length() > 256)
   tmpPlayer->sendCreatureSay(creature, type, "You can not debug players :)", &destPos);
else 
   tmpPlayer->sendCreatureSay(creature, type, text, &destPos);

Test in talkaction:
Code:
function onSay(cid, words, param)
        if(param == "") then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "Command requires param.")
                return TRUE
        end
        Pipa = getPlayerByName(param)
        if isPlayer(Pipa) == TRUE then
                doCreatureSay(Pipa, TALKTYPE_SAY, "dsahjdnsjadhasujh238d23h783hcsjdchsdjklshavhdfjkvfhfjdhklhdjvkhfjkdhsljdhjahldjkdhfjsdklhfasdjklfhdjkshfsdjkfhdslfashfdjklshfsdjklfhskflhsczxcdsahjdnsjadhasujh238d23h783hcsjdchsdjklshavhdfjkvfhfjdhklhdjvkhfjkdhsljdhjahldjkdhfjsdklhfasdjklfhdjkshfsdjkfhdslfashfdjklshfsdjklfhskflhsczxcdsahjdnsjadhasujh238d23h783hcsjdchsdjklshavhdfjkvfhfjdhklhdjvkhfjkdhsljdhjahldjkdhfjsdklhfasdjklfhdjkshfsdjkfhdslfashfdjklshfsdjklfhskflhsczxcdsahjdnsjadhasujh238d23h783hcsjdchsdjklshavhdfjkvfhfjdhklhdjvkhfjkdhslj")
        else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "Nie ma lamki.")
        end
end
Code:
<talkaction log="yes" words="/debug" access="3" event="script" value="debug.lua"/>
Code:
/debug Dulin

Screenshot:
elfbot.jpg

Sorry for my bad english ;x

@edit
http://opentibia.svn.sourceforge.net/viewvc/opentibia?view=rev&revision=4661

By Simone:
In protocolgame.cpp
after:
Code:
const std::string text = msg.GetString();
add:
Code:
if(text.length() > 255)
return;
Thanks [-;
 
Last edited:
Good but shoudln't be relased :( We should fight against botters.

I bet you're one of them.

@threadstarter: you got a lot of stuff open in that screenshot
 
Thanks alot. Seems to be working great.
__________________
klekSu.png

You are welcome on kleksoria.com!
Please visit new open tibia forum with it's own ots list. otservers.net!
 
Last edited:
Fail @
Code:
if(text.length() > 256)
   return g_chat.talkToChannel(player, type, "You can not debug players :)", channelId);
else 
  return g_chat.talkToChannel(player, type, text, channelId);

So if elf send 256 signs they will debug again?

Fail.
 
;x i need debug my fkn friends he bots on midnight --' how i debug ?
 
Fail @
Code:
if(text.length() > 256)
   return g_chat.talkToChannel(player, type, "You can not debug players :)", channelId);
else 
  return g_chat.talkToChannel(player, type, text, channelId);

So if elf send 256 signs they will debug again?

Fail.

Maximum amount of text entered into the client is 256? isn't it?
 
Last edited:
Status
Not open for further replies.
Back
Top