I was trying to do a software with Visual Basic and studiing the UO protocol i've seen it uses the Huffman Compression Metod.
Yoko do you have a Visual Basic port for the Compressor/Decompressor functions in Injection DLL, or maybe a dll usable with vb?
[X YOKO] Huffman Compression
Moderators: Murderator+, Murderator
i tried it a lot, but the class which decompress has a little bug. I've contacted the author, but no answer.
The problem is that it doesn't decompress well certain strings, and it is for sure, because i tried to compress a string, decompress the result, and the obtainer string wasn't equal to the first.
Any other help? It's very important for me..
The problem is that it doesn't decompress well certain strings, and it is for sure, because i tried to compress a string, decompress the result, and the obtainer string wasn't equal to the first.
Any other help? It's very important for me..
OR
-
- Expert!
- Posts: 74
- Joined: 2004-05-30 00:31:54
dl this:
http://uo.elitecoder.net/phpBB/viewtopic.php?t=281
use the exported functions... since you are using VB, set the struct pointer to NULL
http://uo.elitecoder.net/phpBB/viewtopic.php?t=281
use the exported functions... since you are using VB, set the struct pointer to NULL
i'm working on a client which is able to change the packets sent by the server. It's something like a proxy, it receive, modify packets, and send them to the real client. The compression i really important. In the injection.dll there is a compressor, it's written in c++. Unfortunately i'm not skilled enough to convert it in Visual Basic, and also a lot of things used in the code is natively unportable.. The best way is to use in VB a dll compiled in c++, using the Yoko Code. Only Yoko can do something like this, i hope he'll answer..
OR
This is the code i've written. Is there any error?
Private Declare Sub Compress Lib "UOEncryption.dll" (Dest() As Byte, Source() As Byte, DestSize As Integer, SrcSize As Integer)
Private Sub Form_Load()
Dim src() As Byte, dst() As Byte
String2Array "hello", src()
Compress dst, src, 1000, 5
End Sub
Private Function String2Array(Text, ByRef ar() As Byte) As Long
On Error Resume Next
ReDim ar(Len(Text) - 1)
For i = 0 To Len(Text) - 1
ar(i) = Asc(Mid(Text, i + 1, 1))
Next i
End Function
When I run the program, VB Crashes. Any help?
Private Declare Sub Compress Lib "UOEncryption.dll" (Dest() As Byte, Source() As Byte, DestSize As Integer, SrcSize As Integer)
Private Sub Form_Load()
Dim src() As Byte, dst() As Byte
String2Array "hello", src()
Compress dst, src, 1000, 5
End Sub
Private Function String2Array(Text, ByRef ar() As Byte) As Long
On Error Resume Next
ReDim ar(Len(Text) - 1)
For i = 0 To Len(Text) - 1
ar(i) = Asc(Mid(Text, i + 1, 1))
Next i
End Function
When I run the program, VB Crashes. Any help?
OR
ok, new things i've done, but still not working. There's something wrong with memory:
'IN A MODULE
Public Declare Sub Compress Lib "UOEncryption.dll" (ByRef Dest() As Byte, ByRef Source() As Byte, ByRef DestSize As Integer, ByRef SrcSize As Integer)
Public Src() As Byte
Public Dst() As Byte
Public SrcLength As Integer
Public DestLength As Integer
'IN MAIN FORM
Private Sub Form_Load()
String2Array "ciao", Src()
SrcLength = 4
DestLength = 1000
Compress Dst, Src, DestLength, SrcLength
End Sub
Private Function String2Array(Text, ByRef ar() As Byte) As Long
On Error Resume Next
ReDim ar(Len(Text) - 1)
For i = 0 To Len(Text) - 1
ar(i) = Asc(Mid(Text, i + 1, 1))
Next i
End Function
When i run it says Error 49: Bad DLL calling convention. If i debug Src, DestLength and SrclLength, everything works, if I debug Dst it crashes saying memory could not be read. Someone can help?
'IN A MODULE
Public Declare Sub Compress Lib "UOEncryption.dll" (ByRef Dest() As Byte, ByRef Source() As Byte, ByRef DestSize As Integer, ByRef SrcSize As Integer)
Public Src() As Byte
Public Dst() As Byte
Public SrcLength As Integer
Public DestLength As Integer
'IN MAIN FORM
Private Sub Form_Load()
String2Array "ciao", Src()
SrcLength = 4
DestLength = 1000
Compress Dst, Src, DestLength, SrcLength
End Sub
Private Function String2Array(Text, ByRef ar() As Byte) As Long
On Error Resume Next
ReDim ar(Len(Text) - 1)
For i = 0 To Len(Text) - 1
ar(i) = Asc(Mid(Text, i + 1, 1))
Next i
End Function
When i run it says Error 49: Bad DLL calling convention. If i debug Src, DestLength and SrclLength, everything works, if I debug Dst it crashes saying memory could not be read. Someone can help?
OR