• Welcome to Valhalla Legends Archive.
 

[C#] Gobbling up D2GS packets

Started by Insolence, December 27, 2007, 07:47 PM

Previous topic - Next topic

Insolence

http://pastebin.com/m55fd37e4

With a little help from Shadow, I think I'm off to a good start, but the 0x01 packet seems to be throwing me off.

I receive {0xAF, 0x01} just fine, but when I get 0x01... it seems to be compressed?--I thought packets weren't compressed until I was actually in game?  So I commented out the 0x00, 0x01, and 0x02 special cases I had before entering the game, and it still doesn't produce the 0x01 packet.

Am I doing anything blatantly wrong in my decompressing?  If it looks like my logic is right, I'll pastebin the decompression class I'm using.

Thanks for reading :)

l2k-Shadow

if you don't decompress the packets before entering game, the first bytes of the relevant packets should be 0xAF, 0x02, and 0x07 in that order.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Insolence

Quote from: l2k-Shadow on December 27, 2007, 08:20 PM
if you don't decompress the packets before entering game, the first bytes of the relevant packets should be 0xAF, 0x02, and 0x07 in that order.
Well, I don't want to skip any packets--this is what I get:
RC: 0x04 JoinGameRequest; RequestID: 2; Name: GMWACHWYBWBQ; Password: GMW
RC: 20   04 02 00 47 4d 57 41 43 48 57 59 42 57 42 51 00 47 4d 57 00
RS: 0x04 JoinGameResponse; RequestID: 2; GameToken: 984; GameServerIP: 63.240.202.37; GameHash: 608503059; Result: Success; Unknown: 0
RS: 19   04 02 00 d8 03 00 00 3f f0 ca 25 13 05 45 24 00 00 00 00
GS: 0xAF RequestLogonInfo; ProtocolVersion: 1
GS: 2    af 01
GC: 0x68 GameLogonRequest; Version: 11; Class: Sorceress; Name: TehMferzz; D2GShash: 608503059; D2GSToken: 984; Unknown12: 50 cc 5d ed b6 19 a5 91 00
GC: 37   68 13 05 45 24 d8 03 01 0b 00 00 00 50 cc 5d ed b6 19 a5 91 00 54 65 68 4d 66 65 72 7a 7a 00 6f 4b 00 00 00 00
GS: 0x01 GameLogonReceipt; Difficulty: Normal; Hardcore: False; Expansion: True; Ladder: True; Unknown2: 4
GS: 8    01 00 04 00 30 00 01 01
GS: 0x00 GameLoading;
GS: 1    00
GS: 0x02 GameLogonSuccess;
GS: 1    02


I get AF 01 just fine, but 0x01 just isn't going through--how would I even go about skipping it?  When I receive AF 01, just skip the next 8 bytes--if it's even 8?

l2k-Shadow

what are you talking about? you don't need to parse that packet... don't even put it inside your debuffer lol.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Insolence

Quote from: l2k-Shadow on December 27, 2007, 09:26 PM
what are you talking about? you don't need to parse that packet... don't even put it inside your debuffer lol.
I do need to parse it, because it's coming out like this (Right now):
(in base 10)
5, 122, 9, 46, 239, 2, 92

Not sure what's missing in that, or if that's multiple packets--but after 0xAF that's what I get.

Insolence

Some tweaking and it magically works, thanks for the replies shadow :)