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 85

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 85

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 85

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 85

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 85

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 85

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
Tibiasock.dll - The new Packet.dll - Page 2
Page 2 of 19 FirstFirst 123412 ... LastLast
Results 11 to 20 of 188

Thread: Tibiasock.dll - The new Packet.dll

  1. #11

    RE: Tibiasock.dll - The new Packet.dll

    Did you try using intptr and addressof as I previously stated?

  2. #12
    Administrator
    Join Date
    Mar 2007
    Location
    Melbourne, Australia
    Posts
    1,274

    RE: Tibiasock.dll - The new Packet.dll

    Yeah.. but could that be the problem?

  3. #13
    Super Moderator klusbert's Avatar
    Join Date
    Dec 2007
    Posts
    1,201

    RE: Tibiasock.dll - The new Packet.dll

    Quote Originally Posted by DarkstaR
    Did you try using intptr and addressof as I previously stated?
    I am sry but I do not really understand that part. :S

  4. #14

    RE: Tibiasock.dll - The new Packet.dll

    Quote Originally Posted by Dark Pallys
    Yeah.. but could that be the problem?
    Well, in C++ arrays are simply pointers. This means a BYTE* (BYTE[]) is actually an address to a buffer in memory when referenced with no indexer. All the indexer does is increase that address by SizeOf(Type) * Index and read from that address. So, since the DLL is loaded into memory when called, it has access to the memory of Klusberts program. This means that by passing the address of his buffer using AddressOf, he is simulating passing it as a native BYTE*.


    @Klusbert: Do both of the following things
    Public Declare Sub SendPacketToServer Lib "Tibiasock.dll" (ByVal handle As Integer, ByRef bytes As IntPtr, ByVal lenght As Integer)

    SendPacketToServer(Tibia, AddressOf(packet.Data(0)), packet.Length)
    SendPacketToServer(Tibia, AddressOf(packet.Data), packet.Length)

    One of them should work.

  5. #15
    Super Moderator klusbert's Avatar
    Join Date
    Dec 2007
    Posts
    1,201

    RE: Tibiasock.dll - The new Packet.dll

    sry they dont, Im trying more tomorow I dead :P

  6. #16

    RE: Tibiasock.dll - The new Packet.dll

    Oh, I may have forgot to mention that you do not begin your packet with the 2-BYTE length. Everything is done for you. You provide a literally RAW packet.

    EDIT:
    I am also unable to get this working with VB. Tomorrow I will try to update the library and see if I can get it working. I believe it has something to do with the differences in the way memory is managed using the .NET CLR as apposed to native code.

  7. #17
    Administrator
    Join Date
    Mar 2007
    Location
    Melbourne, Australia
    Posts
    1,274

    RE: Tibiasock.dll - The new Packet.dll

    I doubt this is the problem.. but it may have something to do with Safe Arrays, I know they are used in vb6, not sure about vb.net though

  8. #18
    Administrator
    Join Date
    Mar 2007
    Location
    Melbourne, Australia
    Posts
    1,274

    RE: Tibiasock.dll - The new Packet.dll

    [code=vb]Public Declare Sub SendPacketToServer Lib "Tibiasock.dll" (ByVal handle As IntPtr, ByRef bytes As Byte, ByVal lenght As Integer)[/code]
    or
    [code=vb]Public Declare Sub SendPacketToServer Lib "Tibiasock.dll" (ByVal handle As IntPtr, ByRef bytes As Byte(), ByVal lenght As Integer)[/code]
    or
    [code=vb]Public Declare Sub SendPacketToServer Lib "Tibiasock.dll" (ByVal handle As IntPtr, ByRef bytes() As Byte, ByVal lenght As Integer)[/code]
    I can't remember where the bracket goes lol

    [code=vb]
    dim phandle as IntPtr= openprocess(.....)
    dim bpacket(2) as byte
    dim plength as integer

    bpacket(0) = &H1
    bpacket(1) = &H96
    bpacket(2) = &H1

    plength = bpacket.length - 1


    SendPacketToServer(phandle, bpacket(0), pLength)
    'or
    SendPacketToServer(phandle, bpacket, pLength)
    [/code]

    AddressOf is only used for functions.. unlike in vb6.. the other option would be to use Marshall GHAlloc.. etc

    I'm not sure if this code will work.. it *should* work.. but yeah..
    I was using a similar code and it kept freezing tibia.. so who knows wtf is going on :/

    it's 6am here, and I'm a weeeee bit tired :P can't be bothered thinking about this anymore


  9. #19

    RE: Tibiasock.dll - The new Packet.dll

    Yeah like I said any misuse can go quite bad. I may add valid read checks etc.

    Ah yeah, in VB.net I tried marshaling raw data and copying the buffer over and passing that intptr, still didn't work. I have a lot to get done by the end of the day so I might not get a fixed version today, but I will soon.

  10. #20

    RE: Tibiasock.dll - The new Packet.dll

    Cool Library Darkstar.I've done a library similar to yours in delphi, using yaboomaster method to send Packets to Server(like you) and RecvStream method(stepler).But i've get some trouble injecting procedures, i really don't remember.

    Anyway,i really like this. It was a long time we are needing a library to send packets to client, even if its is implemented in c++(i really don't like it, personal opinion).

Posting Permissions

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