McGod Posted May 23, 2007 Share Posted May 23, 2007 Ok, I have a Dll that exports some functions which I need, I have no clue how to do this, and a critcally need these functions. 'http://forum.valhallalegends.com/phpbbs/index.php?topic=11497.0 'http://forum.valhallalegends.com/index.php?topic=13890.0 Declare Sub GamePacketSize Lib "D2GS.dll" (ByVal Data$, ByRef Size&, ByRef OffSet&) Declare Function GamePacketDecode& Lib "D2GS.dll" (ByVal InData$, ByVal InSize&, ByVal OutData$, ByVal OutMax&, ByRef OutSize&) Declare Function GamePacketEncode& Lib "D2GS.dll" (ByVal InData$, ByVal InSize&, ByVal OutData$) Declare Function GamePacketHeader& Lib "D2GS.dll" (ByVal Size&, ByVal Out$) Public Sub MakePacketHeader(Data As String) Dim tmpData$, tmpHdl&, InSize& tmpData = String(2, 0) InSize = Len(Data) intHdl = GamePacketHeader(InSize, tmpData) Data = Left(tmpData, intHdl) & Data End Sub Public Sub EncodePacket(Data As String) Dim OutData$, tmpData$, InSize&, tmpLng& OutData = String(1024, 0) tmpData = Data InSize = Len(tmpData) tmpLng = GamePacketEncode(tmpData, InSize, OutData) 'add header from this function Data = Left(OutData, tmpLng) End Sub Public Function GetPacketSize(Data As String) As Long Dim tmpData$, RetSize&, OffSet& tmpData = Data Call GamePacketSize(tmpData, RetSize, OffSet) Data = Mid(Data, 1 + OffSet)'Remove Lengh header GetPacketSize = RetSize End Function Public Function DecodePacket(Data As String, ByVal pSize As Long, OutData As String) As Long Dim SizeReturn&, OutBuf$, tmpData$ OutBuf = String(pSize * 3 + 250, 0) tmpData = Left(Data, pSize) DecodePacket = GamePacketDecode(tmpData, Len(tmpData), OutBuf, Len(OutBuf), SizeReturn) OutData = Left(OutBuf, SizeReturn) End Function D2GS.dll.zip I seriously need this, I have no idea how to do with with structs and pointers and ughh. [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
McGod Posted May 23, 2007 Author Share Posted May 23, 2007 Func Decompress($str) $dll = DllOpen("d2gs.dll") Local $OutSize, $OutData $result = DllCall($dll, "int", "GamePacketDecode", "str", $str, "int", StringLen($str), "int", 0, "str", 0) MsgBox(1, "", $result) _ArrayDisplay($result) DllClose($dll) Return $OutData EndFunc This is what I tried. It just crashes now. [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now