I've been experimenting with moving my toon with packets. While some people seem to do this by hooking and modifying legitimate packets as they are sent, I have been trying for a slightly less kludged approach. I am building my own packets and sending them. This "works" in the sense that the packets are well-formed, and a second toon watching can see the movement.
My issue is this: sending the packets alone is not enough. The client must also be made aware of the new position somehow or nothing will happen on the screen. Moreover, the client still thinks it is located in the old position, so the next time it sends a movement packet, we will be disconnected for sending a position so far away from what the server has for us (assuming we've moved more than a few steps away).
Now, I've been trying to figure out a way to deal with this problem. So far the most successful approach has been to simultaneously update the static locations for our x, y and z values:
This renders the change on the screen, which means movement packets sent out after the code has finished its move do not cause an automatic disconnect. However, this method is now causing WoW to crash. The crash is located in the function at 0x007AC100, which seems to be a member function of some class having to do with the encryption key for the connection. I have no idea what it does, and see nothing in my code that should be having any affect on it what-so-ever (other than whatever affect any other packet would have).Code:DWORD p1; p1 = *(DWORD *)(0x010BD5F4); p1 = *(DWORD *)(p1 + 0x34); p1 = *(DWORD *)(p1 + 0x24); x = (float *)(p1 + 0x798); y = x + sizeof(float); z = y + sizeof(float); // *x = ..., *y = ..., *z = ...
Is this what other people do, and I just have to bite the bullet and solve this crash, or is there another method to leave my automated movement in the right place?
An interesting piece of information I noticed about this crash. My code accomplishes the movement by sending a MSG_MOVE_START_FORWARD packet, followed by a MSG_MOVE_HEARTBEAT packet twice a second for some amount of time (say 20 seconds for this example). Now, the crash ALWAYS happens after half (yes -- exactly half, I think) of the total expected amount of MSG_MOVE_HEARTBEAT packets get sent out. This is extremely odd. I do not even at the moment use a variable to store this time delta value. It is a magic number inserted in the code in one position (prior to generating the MSG_MOVE_START_FORWARD packet). The code is there to send a MSG_MOVE_STOP packet, but it never gets that far.
Thanks!