 |
 |
 |
 |
| Author |
Message |
Aidis
Joined: 11 Mar 2007 Posts: 6
|
Posted: Sun Mar 11, 2007 9:50 pm Post subject: UO Protocol Help! |
|
|
Hello ^_^,
I am a student playing around with making an Open Source UO Server Emulator in C++, everything went well, until i reached the packet after the client sends the second authentication (after it reconnects to the game server) i think thats 0x91, the server should reply with (optionaly) the feature packet 0xB9 and the character list 0xA9, but instead i get this:
| Code: | unsigned char PackA9[429] =
{ 0xb3, 0x32, 0x8d, 0xc6, 0x80, 0x81, 0x5a, 0x3c, 0x7e, 0xd1, 0x3d, 0x30, 0x60, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x11, 0xbe, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x5e, 0x40, 0xf3, 0x6a, 0x3f, 0x06, 0xc7, 0xa6, 0x64, 0x0b, 0x65, 0xb3, 0xf9, 0xff, 0x2c,
0xe0, 0x00, 0x00, 0x00, 0x3e, 0x8c, 0x83, 0xc7, 0xc4, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x2f, 0x20, 0x79, 0xb6, 0x73, 0xa4, 0x3e, 0x3d, 0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00, 0x00, 0x01, 0x79, 0x03, 0xcd, 0xb8, 0xfe, 0x8d, 0x51, 0xbe, 0x38, 0xf9,
0x86, 0xe0, 0x3b, 0x5a, 0xc6, 0xe3, 0xc4, 0x00, 0x00, 0x00, 0xe0, 0x95, 0xf9, 0x76, 0xb1, 0xf3,
0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5e, 0x40, 0xf3, 0x6b, 0x1a, 0x1f, 0x8e, 0x37, 0xf8,
0xf1, 0xc9, 0x6b, 0x1b, 0x8f, 0x10, 0x00, 0x00, 0x00, 0x18, 0x90, 0xfd, 0x11, 0x5e, 0x78, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x93, 0xe6, 0x1f, 0x4e, 0x9c, 0x5c, 0x07, 0x6b, 0x51,
0x9d, 0x38, 0xbb, 0x41, 0xf1, 0xc4, 0x00, 0x00, 0x00, 0x03, 0xf3, 0xbe, 0x80 }; |
I read somewhere the server employs compression, i also saw some Zlib dlls in some source, but when i tried inflating it with Zlib i go "Z_DATA_ERROR" (meaning it couldnt find the header) even when i did inflateSync();. So uhh, my question is, whats going on? lol |
|
 |
|
|
 |
 |
|
 |
 |
| Author |
Message |
tekproxy Distro Developer
Joined: 06 Apr 2006 Posts: 350 Location: Nederland, Texas
|
|
 |
|
|
 |
 |
| Author |
Message |
Aidis
Joined: 11 Mar 2007 Posts: 6
|
Posted: Mon Mar 12, 2007 6:34 pm Post subject: |
|
|
When i tried using the offical client to connect to my test emu, if i sent the correctly formatted (0xA9 - Character List) it wouldnt accept it, but if i sent the weird one that i got from an existing emu, it displayed the character list normally in the client, and the client then responded with a normal NON compressed NON encrypted packet, it was driving me nuts for days Ill try the packet logger to see whats up ...
Edit: Ok i read through you perl file and you seem to compress the packet 0xA9 i was reffering too, what kind of compression is this? lol
$client->send(compress($packet),0);
is there an uncompression algorithm?
Edit2: I rewrote the compression algorithm in the perl file to C, ill try it when i get home and see if it works
Here it is :
| Code: |
int UOCompress(char *in, char *out, int len) {
char outP = 0;
int outI = 0;
int offset = 0;
int bit;
int bits;
int byte;
int value;
while (len--) {
byte = in[offset];
offset++;
bits = bitTable[byte*2];
value = bitTable[(byte*2)+1];
while (bits--){
outP <<= 1;
outP |= (value>>bits)&1;
bit=(bit+1)&7;
if (!bit) { out[outI] = outP; outI++; outP=0; }
}
}
bits = bitTable[256*2];
value = bitTable[(256*2)+1];
while (bits--) {
outP <<= 1;
outP |= (value>>bits)&1;
bit=(bit+1)&7;
if (!bit) { out[outI] = outP; outI++; outP=0; }
}
if (bit) {
while (bit < 8) {
outP <<= 1;
bit++;
}
out[outI] = outP; outI++;
}
return outI;
}
|
|
|
 |
|
|
 |
 |
|