Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
packet.dll for 8.31 - Page 3
Page 3 of 8 FirstFirst 12345 ... LastLast
Results 21 to 30 of 80

Thread: packet.dll for 8.31

  1. #21
    Senior Member
    Join Date
    Mar 2007
    Posts
    367

    packet.dll for 8.31

    Either use
    Code:
    ..\bin\Link /dll /export:SendPacket /export:XTEA /NOLOGO /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.reloc=.text /entry:DllEntry packet.obj
    (notice Link instead of PoLink)
    The dll has around 2.5KB in this case.

    OR

    Code:
    ..\bin\PoLink /dll /export:SendPacket /export:XTEA /NOLOGO /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.reloc=.text packet.obj
    (no /entryllEntry)
    The dll has around 2KB in this case.

  2. #22

    packet.dll for 8.31

    Azura, I think there must have an error with your packet dll code.
    Here I use borland compiler (C++ Builder).
    When I set a "Speed Code Optimization" option for the compiler and run my program, the packet.dll makes my program crash.
    It do not happens on the older versions of packet.dll.

    Thanks.

  3. #23
    Senior Member
    Join Date
    Apr 2007
    Posts
    314

    packet.dll for 8.31

    I compile mine without the compiler complaining making it 3kb. It's not like anyone will complain for 1kb anyways.

  4. #24
    Senior Member
    Join Date
    Mar 2007
    Posts
    367

    packet.dll for 8.31

    I was refering to the old packet.dll

    We should distinct those two somehow I guess...

  5. #25
    Senior Member
    Join Date
    Apr 2007
    Posts
    314

    packet.dll for 8.31

    Well, both the old packet.dll and the new packet.dll are 3kb for me so it doesn't really matter. I use the following makeit.bat to create the dll-file (8.31):
    Code:
    @echo off
    if exist packet.obj del packet.obj
    if exist packet.dll del packet.dll
    C:\masm32\bin\ml /c /coff packet.asm
    C:\masm32\bin\link /DLL /EXPORT:SendPacket /NOLOGO /ENTRY:DllEntry packet.obj 
    del packet.obj
    del packet.exp
    del packet.lib
    dir packet.*
    pause

  6. #26
    Senior Member
    Join Date
    Mar 2007
    Posts
    367

    packet.dll for 8.31

    May it be because you're not using /MERGE in the linker ?

    But You're right - 1KB is actually nothing

  7. #27
    Senior Member
    Join Date
    Sep 2007
    Posts
    230

    packet.dll for 8.31

    Quote Originally Posted by Azura
    VB:
    Private Declare Sub SendPacket Lib "packet.dll" (ByVal ProcessID As Long, ByVal Packet() As Byte)

    As some might notice the Packet parameter in VB have changed to ByVal instead of the old ByRef, did this so the SafeArray parameter should not be needed to use. I have not tried this at all but if I got VB correct this should work.
    This won't work, array parameters can only be passed by reference which will pass the address of the array varible which itself is a pointer to the arrays SAFEARRAY structure. Even if you could pass an array by value it would either simply create a copy of the array varible or a copy of the entire array (ie: SA pointer, SA structure and array data), in either case you would still have to deal with the SA structure.

    You can get around all this SAFEARRAY mess by simply passing the address of the first byte in the actual array. This can easily be done by adjusting the 'Packet()' parameter to pass the address of a single byte instead of an array, effectively changing the function definition to the following:

    Code:
    Private\Public Declare Sub SendPacket Lib "packet.dll" (ByVal ProcessID As Long, ByRef Packet As Byte)

    Now when you call the function instead of passing the array as a whole you simply pass the first byte in the array where the packet starts at, like so:

    Code:
    'Define a byte array to store the packet data in
    Dim SomePacket(0 To 255) As Byte
    
    'Send the packet, PacketStartOffset is the index of the array where the packet data (ie: first 2 bytes which specify the size of the encrypted packet + 4 for checksum)
    SendPacket TibiaProcessID, SomePacket(PacketStartOffset)

  8. #28

    packet.dll for 8.31

    Quote Originally Posted by Lucas
    Azura, I think there must have an error with your packet dll code.
    Here I use borland compiler (C++ Builder).
    When I set a "Speed Code Optimization" option for the compiler and run my program, the packet.dll makes my program crash.
    It do not happens on the older versions of packet.dll.

    Thanks.
    Okey, might be some error with my code.
    When it crashes, do it make any error report, crash dump or similiar?
    Would help also if you could post the code you know makes it crash, might be an error with it.

    Quote Originally Posted by Sketchy
    This won't work, array parameters can only be passed by reference which will pass the address of the array varible which itself is a pointer to the arrays SAFEARRAY structure. Even if you could pass an array by value it would either simply create a copy of the array varible or a copy of the entire array (ie: SA pointer, SA structure and array data), in either case you would still have to deal with the SA structure.

    You can get around all this SAFEARRAY mess by simply passing the address of the first byte in the actual array. This can easily be done by adjusting the 'Packet()' parameter to pass the address of a single byte instead of an array, effectively changing the function definition to the following:

    Code:
    Private\Public Declare Sub SendPacket Lib "packet.dll" (ByVal ProcessID As Long, ByRef Packet As Byte)

    Now when you call the function instead of passing the array as a whole you simply pass the first byte in the array where the packet starts at, like so:

    Code:
    'Define a byte array to store the packet data in
    Dim SomePacket(0 To 255) As Byte
    
    'Send the packet, PacketStartOffset is the index of the array where the packet data (ie: first 2 bytes which specify the size of the encrypted packet + 4 for checksum)
    SendPacket TibiaProcessID, SomePacket(PacketStartOffset)
    Noted it didnt work with passing the array with ByVal, alltho I saw an example doing this so I hoped it should work, guess they were wrong. I dont got VB to test it out but the solution you posted seems to be a good one. Thanks

  9. #29

    packet.dll for 8.31

    Azura, I get this error:



    On the declaration of the Packet, now there is only two params, right?

    Code:
    typedef int (WINAPI *SENDPACKET)(DWORD, char*);
    The olders packet.dlls worked fine. I didn't changed my program code, only the sendpacket code above. :icon10:

  10. #30

    packet.dll for 8.31

    The image I posted is not there. I cannot edit my post too.

    http://img355.imageshack.us/my.php?image=errornd0.jpg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •