sailorv5
Member
- Joined
- Oct 31, 2009
- Messages
- 82
- Reaction score
- 17
i created a Qt network project (using network-chat exemple)
and set its server to listen on port 7171
when i try to connect to it using tibia Client (username:1/password:1) i get the following anwser (from the tibia client, also may change)
by doing buffer.mid() i can get/cut any part of that buffer ex.
my question is how can i decode this login request ?
and if possible how to send back a FakeList of character with one character.
i would love if the anwser ( looks like this format )
1HEX = 4bits, 8bits = 1Byte, 1Byte = 2HEX
using HEX to make it easy to be undestand by me final result will use only bytes without any conversion.
and set its server to listen on port 7171
when i try to connect to it using tibia Client (username:1/password:1) i get the following anwser (from the tibia client, also may change)
Code:
buffer.size() -> 166
buffer.toHex() -> "5a01248d7c18010200420442040000263f000071e15e560ca730560047fc19d77bf2480763d6904155b1e61375bbc54a9d2991d8a5f7601f1630cec778ffb195a21776a9af3262f9eab34c64093cfdd17fcf6ce7c80457ea2b8fa61d4b2dac48115b54a26cab2d82e05711eb57aaf6a129c23efa822612fde0195cbd092c9d14fc9bcf29d75b777ab1e83f95439cac52721887d5adb4f65853eff97b01011f00496e74656c20"
by doing buffer.mid() i can get/cut any part of that buffer ex.
Code:
QByteArray x("Five pineapples");
QByteArray y = x.mid(5, 4); // y == "pine"
my question is how can i decode this login request ?
and if possible how to send back a FakeList of character with one character.
i would love if the anwser ( looks like this format )
Code:
// "5a01
// 248d 7c18
// 0102 0042
// 0442 0400
// 0026 3f00
// 00
// 71e15e560ca730560047fc19d77bf2480763d6904155b1e61375bbc54a9d2991d8a5f7601f1630cec778ffb195a21776a9af3262f9eab34c64093cfdd17fcf6ce7c80457ea2b8fa61d4b2dac48115b54a26cab2d82e05711eb57aaf6a129c23efa822612fde0195cbd092c9d14fc9bcf29d75b777ab1e83f95439cac52721887d5adb4f65853eff97b01011f00496e74656c20"
QByteArray os = x.mid(0, 4); // [5a01] 2bytes client OS
QByteArray protocolVersion = x.mid(4, 8); // [248d 7c18] 4bytes protocolVersion
QByteArray dat = x.mid(12, 8); // [0102 0042] 4bytes client dat
QByteArray spr = x.mid(20, 8); // [0442 0400] 4bytes client spr
QByteArray pic = x.mid(28, 8); // [0026 3f00] 4bytes client pic
QByteArray unknow = x.mid(36, 2); // [00] 1byte suposed to be zero?
// buffer = QByteArray::fromHex( x) ;
using HEX to make it easy to be undestand by me final result will use only bytes without any conversion.
Last edited: