• Welcome to Valhalla Legends Archive.
 

D2GS Packets

Started by MindArchon, October 12, 2005, 10:35 PM

Previous topic - Next topic

MindArchon

I am having troubles with D2GS packets. I'd be nice if you guys could help me out here. There are two issues I am having a problem with:

Most importantly, how do you decompress the packets recieved. I've seen some source on how to do it, but I don't understand it. How are the packets compressed? And when you send packets back to the d2gs, do you have to compress them yourself? I have absolutely no idea how to start here.

When I first connect to D2GS, do I send 0x68 immediantly after connecting, or after they send data to me? Do I have to send stuff before or after it to officially get into the game?

l2k-Shadow

Quote from: MindArchon on October 12, 2005, 10:35 PM
Most importantly, how do you decompress the packets recieved. I've seen some source on how to do it, but I don't understand it. How are the packets compressed? And when you send packets back to the d2gs, do you have to compress them yourself? I have absolutely no idea how to start here.

Use Search button

Quote from: MindArchon on October 12, 2005, 10:35 PM
When I first connect to D2GS, do I send 0x68 immediantly after connecting, or after they send data to me? Do I have to send stuff before or after it to officially get into the game?.

You send 0x68 when you receive 0xAF.
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.

MindArchon

#2
Alright, I did a search and I guess I will use D2GS.dll. However, I have no idea how any of the parameters work. I found some stuff on the search, but all of it doesn't seem to work. This code that came with the zip containing D2GS doesn't work, and I cannot figure out how to use it effectively.

On Error Resume Next
Dim offset As Long
Dim Size As Long
Dim a As Integer
Dim H1 As String
Dim H2 As Integer
Dim outdata As String
Dim maxsize As Long
Dim outsize As Long

a = 5 '<-- extra packet space (only tryed it in testing to try fix bad packet returns)

'D2GS_DATA = Data from server >

H1 = GamePacketSize(D2GS_DATA, Size, offset)
outdata = String(Size + (a + 1), vbNullChar)
H2 = GamePacketDecode(Mid(D2GS_DATA, 1 + offset), Size + a, outdata, Size + a, outsize)

'outdata = decompressed data.


Also, Ive sent 0x68, and recieved 0x7A and 0x5C. I then guessed I would send 0x6B, but it says I dropped due to timeout in-game. I have been sending 0x6D every 6-7 seconds. Here is the packet log of my data being sent:

0x68
0000: 68 B9 44 67 38 62 00 01 0B 00 00 00 50 CC 5D ED  h¹Dg8b. ...PÌ]í
0010: B6 19 A5 91 00 46 69 72 65 64 41 78 65 00 81 B3  ¶¥'.FiredAxe.?³
0020: 6F 4B 00 00 00 00                                oK..............


I recieve 0x7A and 0x5C, and send out 0x6B, and I drop due to timeout, and here is 0x6D I am sending every 6 seconds.

0000: 6D 12 E8 E9 2E 00 00 00 00 00 00 00 00           mèé............




teK

The 2nd DWord in 0x6D isn't null. The first byte has a value.

MindArchon

I thought it is empty.

0000: 6D 12 E8 E9 2E 00 00 00 00 00 00 00 00           mèé............

6D is the packet ID
12 E8 E9 2E is the long I send (get tick count)
00 00 00 00 00 00 00 00 are the 2 empty dwords

LivedKrad

Quote from: MindArchon on October 13, 2005, 07:35 PM
Alright, I did a search and I guess I will use D2GS.dll. However, I have no idea how any of the parameters work. I found some stuff on the search, but all of it doesn't seem to work. This code that came with the zip containing D2GS doesn't work, and I cannot figure out how to use it effectively.

On Error Resume Next
Dim offset As Long
Dim Size As Long
Dim a As Integer
Dim H1 As String
Dim H2 As Integer
Dim outdata As String
Dim maxsize As Long
Dim outsize As Long

a = 5 '<-- extra packet space (only tryed it in testing to try fix bad packet returns)

'D2GS_DATA = Data from server >

H1 = GamePacketSize(D2GS_DATA, Size, offset)
outdata = String(Size + (a + 1), vbNullChar)
H2 = GamePacketDecode(Mid(D2GS_DATA, 1 + offset), Size + a, outdata, Size + a, outsize)

'outdata = decompressed data.


Also, Ive sent 0x68, and recieved 0x7A and 0x5C. I then guessed I would send 0x6B, but it says I dropped due to timeout in-game. I have been sending 0x6D every 6-7 seconds. Here is the packet log of my data being sent:

0x68
0000: 68 B9 44 67 38 62 00 01 0B 00 00 00 50 CC 5D ED  h¹Dg8b. ...PÌ]í
0010: B6 19 A5 91 00 46 69 72 65 64 41 78 65 00 81 B3  ¶¥'.FiredAxe.?³
0020: 6F 4B 00 00 00 00                                oK..............


I recieve 0x7A and 0x5C, and send out 0x6B, and I drop due to timeout, and here is 0x6D I am sending every 6 seconds.

0000: 6D 12 E8 E9 2E 00 00 00 00 00 00 00 00           mèé............





You're dropping out of the game for failed responses to Warden. (That it would seem you're not even receiving due to not sending 0x66 at game startup).

MindArchon

Ugh.

So I assume I send 0x66 right when I connect to the server and it replies with 0xAE? Do you have any idea where I can find the format for 0x66? Nobody seems to know for sure.

Do I have to do anything with 0xAE? (is 0xAF 0xAE compressed or something? Because I still dont have decompression down)

LivedKrad

QuoteSo I assume I send 0x66 right when I connect to the server and it replies with 0xAE? Do you have any idea where I can find the format for 0x66? Nobody seems to know for sure

No public documentation exists that I know of.

QuoteDo I have to do anything with 0xAE? (is 0xAF 0xAE compressed or something? Because I still dont have decompression down)

No, 0xAE is not 0xAF compressed. 0xAE is a packet used  to update Warden anti-hack code and helps Diablo root out unwanted libraries uses within Diablo's memory space.

teK

Try this website, it has some information on 0x66 and 0xAE.

http://realmgx.com/phpBB2/viewtopic.php?t=3898