Originally Posted by
klusbert
Hello tp long time no see.
I doing some c++ programming on my free time, and I want to create a send packet function. The packets sends and works.
But after it finnished it simply crashes the client.
http://pastebin.com/syJEXTDy
Here is my code.
I really hope someone could help.
Here is my other project that creates a codecave inside tibia and this code works.
http://pastebin.com/pdHzSx5x
//Klusbert
You have synchronization with main tibia thread?
Code:
LRESULT WINAPI SubClassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
while (packetBuffer.empty() != true)
{
SendPacketToServerEx(packetBuffer.front().GetPacket(), packetBuffer.front().GetLength());
packetBuffer.erase(packetBuffer.begin());
}
return CallWindowProc(oldWndProc, hwnd, msg, wParam, lParam);
}
Code:
void SendPacketToServer(BYTE *Buffer, int position)
{
packetBuffer.push_back(NetworkBuffer(Buffer, position));
}
void SendPacketToServerEx(BYTE *Buffer, int position)
{
//...
}