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 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
Proxy - Modify or delete a packet
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Proxy - Modify or delete a packet

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    5

    Proxy - Modify or delete a packet

    Hi,

    I just started this week to use the tibia api and programming otserv.

    I did a custom packet on the ots, and I want to send it to the proxy and then delete it, so the client would not crash, but i'm lost!

    I got this function:

    Code:
    cliente.IO.Proxy.SplitPacketFromServer += delegate(byte type, byte[] data)
    {
    System.Windows.Forms.RichTextBox.CheckForIllegalCrossThreadCalls = false; // Ignore cross thread warning 
    if(type == 0xEE){ //Custom Packet
       //Lost Here....
       IncomingPacket p = new IncomingPacket(cliente);
       p.Destination = Tibia.Constants.PacketDestination.None
       p.Send();
    }
    }
    It returns me that ToNetworkMessage its not implemented. Also tried some workarounds, but i'm really lost here.

    Can someone give me a hint? I want to delete the packet 0xEE contents(summon information, health, level, pos and etc) or block it, so it wouldnt crash the cliente (since the client doesnt know that packet).

    Thanks in advance

  2. #2
    Senior Member
    Join Date
    Mar 2009
    Location
    Brazil
    Posts
    266

    RE: Proxy - Modify or delete a packet

    don't call p.Send? xD

  3. #3
    Junior Member
    Join Date
    Sep 2011
    Posts
    5

    RE: Proxy - Modify or delete a packet



    How do I block it? I'm without ideas....

    Thanks in advance.

  4. #4
    Senior Member
    Join Date
    Mar 2009
    Location
    Brazil
    Posts
    266

    RE: Proxy - Modify or delete a packet

    Check this Thread:

    http://tpforums.org/forum/thread-7351.html?highlight=block+packet

    Quote Originally Posted by Ian
    2. HookProxy cannot block packets, so this should be a con

    Which kind are you using?

  5. #5
    Junior Member
    Join Date
    Sep 2011
    Posts
    5

    RE: Proxy - Modify or delete a packet

    Quote Originally Posted by Ash Katchup
    Check this Thread:

    http://tpforums.org/forum/thread-7351.html?highlight=block+packet

    Quote Originally Posted by Ian
    2. HookProxy cannot block packets, so this should be a con

    Which kind are you using?
    I'm using Proxy.

    Code:
    private void Form1_Load(object sender, EventArgs e)
            {
                cliente = ClientChooser.ShowBox();
    
                cliente.Login.SetOT("localhost", 7171);
    
                cliente.IO.StartProxy(true);
                richTextBox1.AppendText(cliente.Version);
                cliente.IO.Proxy.AllowIncomingModification = true;
                
                cliente.IO.Proxy.SplitPacketFromServer += (ProxyBase.SplitPacket)PacketListener;
                cliente.IO.Proxy.SplitPacketFromClient += delegate(byte type, byte[] data)
                {
                    System.Windows.Forms.RichTextBox.CheckForIllegalCrossThreadCalls = false;
                    richTextBox1.AppendText("\nClient: " + data.ToHexString()); 
                };
            }
            public void PacketListener(byte type, byte[] data)
            {
                System.Windows.Forms.RichTextBox.CheckForIllegalCrossThreadCalls = false;
                richTextBox1.AppendText("\nServer: " + data.ToHexString()); 
                if (type == 0xEE)
                {
                    IncomingPacket p = new IncomingPacket(cliente);
                    
                    p.Destination = Tibia.Constants.PacketDestination.None;
                    return;
                }
            }
    I just want to block the packet 0xEE, so it'll not reach the client and crash him.

    Quote Originally Posted by Client Crash
    Control.cpp 1367: unknow packet type during game (Type=238)
    Is that possible?

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

    RE: Proxy - Modify or delete a packet

    You could perhaps edit the client to ignore these packets?

  7. #7
    Junior Member
    Join Date
    Sep 2011
    Posts
    5

    RE: Proxy - Modify or delete a packet

    I didnt knew that it was possible, tought that proxy could handle it. How can I edit the client to ignore these packets?

  8. #8

    RE: Proxy - Modify or delete a packet

    If you're getting a bad packet type during game your problem is server sided. You're either sending a packet it doesn't recognize or your sending a packet which is incorrectly formatted, leading to parsing errors. If you are trying to send a customized packet to the client and handle it effectively, check out Stepler's parser hook. It can be implemented easily. Alternatively contact me if you would like to contract out the job.

  9. #9
    Junior Member
    Join Date
    Sep 2011
    Posts
    5

    RE: Proxy - Modify or delete a packet

    Thanks darkstar, but i'm not interested in hiring anyone, since its a 4fun and learning project only.

    And thanks for the stepler parser hook hint, I cant believe that the first thread that I saw here about proxys was that one and I didnt noticed the content... lol.

    I'll keep trying and also will be glad to post a tutorial later of how I did, so others with the same intention will make custom packets work too.

  10. #10

    RE: Proxy - Modify or delete a packet

    It's not hard at all. Just make sure you let Tibia parse every packet that's not yours but block yours when it comes and return -1.

Posting Permissions

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