Finally, thanks to Azura, I managed to write this example code in C++ showing how to send packets to the tibia client (and, of course, any other program that uses winsock sockets).
Note that this is only a fast example I wrote, its dirty coded, and the encryption routines are a there a bit messy, but it works to show off the concept.
Basically, its a dev-cpp project (esily portable to vc++ tho) which creates a DLL that hooks the send(), recv() and select() winsock functions in your tibia client, and then, as example, every time you send a packet to the server (like walking or talking) the program sends a packet to the client, doing the effect as it were comming from the real server.
First you have to login in tibia, then inject the DLL with the method you preffer (I attach the stiju's dll loader) and take a walk around the screen; you'll see a message appear in the screen.
The logic of all of this is simple: when a packet has to come to the recv()'s buffer, first the socket has to "ask for it", to do that, we have to send the message WM_SOCKET_NOTIFY to the winsock sink notification window. Then, we'll return true in the select() function, and inmediatelly we'll copy the encrypted packet inside the recv()'s buffer. I'm sure others will explain that better than me, so there it goes my code.
Have fun!! :icon10:
Credits goes to Azura.
P.D.: please note, TP is the first place over the net that has a function like that! (or, at least, I haven't find any other place).
Edit: delphi code is attached in my post a few posts down /Azura