• Welcome to Valhalla Legends Archive.
 

d2 help

Started by Killa, December 04, 2003, 07:05 PM

Previous topic - Next topic

Killa

wondering if anyone could give me the tables for d2 ingame decompression or atleast give me some information that could get me started

iago

Check the Java forum.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Killa

wonderin if anyone can help me get the functions posted here

http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=display;threadid=3357

working for the .dll packet decompression

Kp

Quote from: Killa on December 05, 2003, 08:34 PM
wonderin if anyone can help me get the functions posted here

http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=display;threadid=3357
working for the .dll packet decompression

What specifically is not working for you?
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Killa

#4
well more specificly i need more information on how to put the function to use. ie:do i need to do anything to the packet i receive from bnet befor passing it along to the function

or perhaps an example of the packetsize/packet decode function being put to use or even better the code posted by brand.x in ported to vb6

Killa

what would i put for this when using the function as a .dll in vb?
// outmax: [in] size of output buffer

Killa

#6
im using


Public Declare Function GamePacketSize Lib "D2GSClient.dll" (ByRef Data As String, ByRef Size As Integer, ByRef Offset As Integer) As String

and

Public Declare Function GamePacketDecode Lib "D2GSClient.dll" (ByRef inData As String, ByVal inSize As Integer, ByRef outData As String, ByVal outMax As Integer, ByRef outSize As Integer) As Integer


and the gamepacketdecode is returing 1(1 being successful decode) yet im getting nothing in the outdata string and the outdata size string anyone know a reason for this?

also when puting the data into the decode function can i put the data into it right when i recieve it from the server or do i need to convert the data into some other format or change it in some way first?

Killa

you sure about the ByVal because now when i try to use it i get a error msg that vb caused a error in the .dll

Killa

// indata: [in] compressed packet (without size byte)
// insize: [in] length of indata
// outdata: [out] output buffer
// outmax: [in] size of output buffer
// outsize: [out] location to store size of decoded data
// returns: 1 on successf decode, 0 if not enough room

insize=result from gamepacketsize?
outmax=?

Kp

outmax = maximum number of characters which can be written to the output buffer
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Killa

#10
whats the max length of a string then?

also back to one of my original questions can i pass the compressed packet to the functions right as i recieve them or do i need to change them to another format first?

Soul Taker

This is what I used for testing, although it would return cut-off data:

Public Declare Function GamePacketDecode Lib "kablam.dll" (ByVal indata As String, ByVal insize As Long, ByVal outdata As String, ByVal outmax As Long, ByRef outsize As Long) As Integer
Public Declare Function GamePacketSize Lib "kablam.dll" (ByVal Data As String, ByRef Size As Long, ByRef Offset As Long) As String
(thanks to K for kablam.dll!)

Dim Offset As Long, Size As Long, GPS As String, GPD As Integer
Dim Outbuff As String, maxsize As Long, outsize As Long
On Error Resume Next 'I know, I know, only used this for quick and dirty testing
           GPS = GamePacketSize(strD2GSIn, Size, Offset)
           Outbuff = String(Size, vbNullChar)
           GPD = GamePacketDecode(Mid(strD2GSIn, Offset), Size, Outbuff, Len(Outbuff), outsize)
           Debug.Print DebugOutput(Outbuff) 'GPD & " " & outsize & " " & Len(Outbuff)

Should give you the idea, but it will give you slightly mangled data.

Killa

#12
curious as to if anyone has gotten these functions to work correctly with 1.10,anyone?
when i attempt to use it the function doesn't seem to return anything,and if it does its only a character or two long.