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 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 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
Tibia Packet Reader
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Tibia Packet Reader

  1. #1
    Senior Member Lolrapa's Avatar
    Join Date
    Mar 2014
    Posts
    125

    Cool Tibia Packet Reader

    Hello!

    Today I bring you a packet reader to get packets the client send to the server. This is done by hooking send packet function.
    It's functional for Tibia 10.78 and can be easily updated to any version. This addresses are in 0x400000 base, so if you have aslr you'll have to do the math.



    The zip file contains two folders, the loader and the injected dll. Both are visual studio projects (2013). The loader is a c# project and the dll is a c++ project.
    https://github.com/lolrapa/Tibia-Server-Packet-Reader
    http://www.4shared.com/rar/qDgKy5Qbce/PacketReader.html

    Its my first open source project so dont be harsh on me
    Thanks to darkstar for the help in this!

    Note: Altough the project works it may make tibia crash form time to time, I'm aware of that and I'm working on it.

    I hope this project helps you!!!
    Good luck!
    Last edited by Lolrapa; 06-25-2015 at 03:35 PM.

  2. #2

  3. #3
    You are replacing the first few bytes of the send function without re-implementing them elsewhere, which ends up skipping part of the function prologue. You should be logging the operations that are there and adding them to the end of your code cave.

    Better yet, you should grab Microsoft's Detours library and use that, as it will do everything for you.

  4. #4
    Senior Member Lolrapa's Avatar
    Join Date
    Mar 2014
    Posts
    125
    I acctualy tried that but I didn't figure how to add asm at the very end of my function if I use __asm{} im myFunction() the compiler will add asm code between my asm code and the ret statment and won't work

    I mean:
    Code:
    void __stdcall myFunction()
    {
    		// This function will be called when tibia calls sendpacket I deliver the packet info to the loader via file mapping
    
    		*(DWORD*)((LPVOID)(&((CHAR*)filePointer)[1])) = *SendStreamLength; //write the data len in 2nd byte (four bytes)
    		memcpy((LPVOID)(&((CHAR*)filePointer)[5]), SendStreamData, *SendStreamLength); //write the data buffer in 5th byte (sendStreamLenght bytes)
    		*(BYTE*)filePointer = 1; //inticates to the loader there's been an update, loader must set this byte to 0 after reading
                    
                    __asm
                    {
                                    //asm code to put back the replace asm
                    }
    }
    Last edited by Lolrapa; 06-25-2015 at 06:31 PM.

  5. #5
    Senior Member Lolrapa's Avatar
    Join Date
    Mar 2014
    Posts
    125
    Or copy the first 5 bytes form the original function and paste them somewhere at the end of my function
    I could reserve space by doing
    Code:
    __asm
    {
        nop
        nop
        nop
        nop
        nop
    {
    Last edited by Lolrapa; 06-25-2015 at 06:37 PM.

  6. #6
    you need to use declspec(naked)

  7. #7
    Quote Originally Posted by DarkstaR View Post
    you need to use declspec(naked)
    Or use attribute:

    Code:
    __attribute__ ((naked)) void myFunction() { }
    If you're using GCC.

  8. #8
    Code:
    #ifdef __GNUC__
    #define SHOW_ME_YOUR_TITS __attribute__ ((naked))
    #elif _MSC_VER
    #define SHOW_ME_YOUR_TITS__declspec(naked)
    #endif
    
    SHOW_ME_YOUR_TITS void myFunction() {}

  9. #9
    Senior Member Lolrapa's Avatar
    Join Date
    Mar 2014
    Posts
    125
    Quote Originally Posted by DarkstaR View Post
    Code:
    #ifdef __GNUC__
    #define SHOW_ME_YOUR_TITS __attribute__ ((naked))
    #elif _MSC_VER
    #define SHOW_ME_YOUR_TITS__declspec(naked)
    #endif
    
    SHOW_ME_YOUR_TITS void myFunction() {}

    Haha, thanks both! I'll try it when I have some time

  10. #10
    How to use it?

Posting Permissions

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