Game::Tibia::Packet - Session layer support for the MMORPG Tibia
use Game::Tibia::Packet; # decrypt Tibia packet my $read; my $ret = $sock->recv($read, 1024); my $res = Game::Tibia::Packet->new(packet => $read, xtea => $xtea_key); $packet_type = unpack('C', $res->payload); # encrypt a Tibia speech packet my $p = Game::Tibia::Packet->new; $p->payload .= pack("C S S S/A S C SSC S/A", 0xAA, 0x1, 0x0, "Perl", 0, 1, 1, 1, 8, "Game::Tibia::Packet says Hi!\n:-)"); $sock->send($p->finalize($xtea_key}))
Methods for constructing Tibia Gameserver (XTEA) packets. Handles checksum calculation and symmetric encryption depending on the requested Tibia version.
Should work with all Tibia versions less than 9.80.
Constructs a new Game::Tibia::Packet instance of version $version. If payload and XTEA are given, the payload will be decrypted and trimmed to correct size.
$version
Checks if packet's adler32 digest matches (A totally unnecessary thing on Cipsoft's part, as we already have TCP checksum. Why hash again?)
returns the payload as lvalue (so you can concat on it)
Finalizes the packet. XTEA encrypts, prepends checksum and length.
Returns a hash reference with protocol traits. For example for 840, it returns:
{ gmbyte => 1, outfit_addons => 1, adler32 => 1, acc_name => 1, stamina => 1, xtea => 1, VERSION => 840, rsa => 1, lvl_on_msg => 1 };
http://github.com/athreef/Game-Tibia-Packet
The protocol was reverse engineered as part of writing my Tibia Wireshark Plugin.
Game::Tibia::Cam
Game::Tibia::Packet::Login
Game::Tibia::Packet::Charlist
http://tpforums.org/forum/forum.php http://tibia.com
Ahmad Fatoum <athreef@cpan.org>, http://a3f.at
<athreef@cpan.org>
Tibia is copyrighted by Cipsoft GmbH.
Copyright (C) 2016 Ahmad Fatoum
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Game::Tibia::Packet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Game::Tibia::Packet
CPAN shell
perl -MCPAN -e shell install Game::Tibia::Packet
For more information on module installation, please visit the detailed CPAN module installation guide.