SolvedCA crashes when I send a message

Posts 1–6 of 6 · Page 1 of 1
CA crashes when I send a message
Hey, CA crashed when I use:

Code:
if (GetAsyncKeyState(VK_F10))
	{
		if (heaD9->ValidPointer(g_LTClient))
		{
			CAutoMessage msg;

			msg.Writeuint8(135);
			g_LTClient->SendToServer(msg.Read(), MESSAGE_GUARANTEED);
		}
	}
Any ideas?
Did you try adding the right classes updating it and also did you include ltclient addie?
Quote Originally Posted by justiniscool6 View Post
Did you try adding the right classes updating it and also did you include ltclient addie?
Not pointing the class to the Address wouldn't make it crash, just not work.

If it was the wrong address, it could crash.

LTClient Class is posted.
Quote Originally Posted by Flengo View Post


Not pointing the class to the Address wouldn't make it crash, just not work.

If it was the wrong address, it could crash.

LTClient Class is posted.
Even if it it isn't the cause of the crash, its still wrong so lets fix it.

Code:
//Define this at the top of your code
typedef unsigned int( __stdcall *tSendToServer )( ILTMessage_Read *Message, unsigned int Flags );
tSendToServer pSendToServer;

if (GetAsyncKeyState(VK_F10))
	{

               //This is where you point your classes to addresses.
               pSendToServer = (tSendToServer)0x474350;  //The address in engine which the sendtoserver function is located at.
	       g_LTClient = *(CLTClient**)0x377E0C88;  //The LTCLient
	       g_CommonLT = g_LTClient->Common();  //LT Common class which is used in the CAutoMessage class.

		if (heaD9->ValidPointer(g_LTClient))
		{
			CAutoMessage msg;

			msg.Writeuint8(135);
			pSendToServer(msg.Read(), MESSAGE_GUARANTEED);  //Replaced with our engine call function
		}
	}
Quote Originally Posted by matypatty View Post


Even if it it isn't the cause of the crash, its still wrong so lets fix it.

Code:
//Define this at the top of your code
typedef unsigned int( __stdcall *tSendToServer )( ILTMessage_Read *Message, unsigned int Flags );
tSendToServer pSendToServer;

if (GetAsyncKeyState(VK_F10))
	{

               //This is where you point your classes to addresses.
               pSendToServer = (tSendToServer)0x474350;  //The address in engine which the sendtoserver function is located at.
	       g_LTClient = *(CLTClient**)0x377E0C88;  //The LTCLient
	       g_CommonLT = g_LTClient->Common();  //LT Common class which is used in the CAutoMessage class.

		if (heaD9->ValidPointer(g_LTClient))
		{
			CAutoMessage msg;

			msg.Writeuint8(135);
			pSendToServer(msg.Read(), MESSAGE_GUARANTEED);  //Replaced with our engine call function
		}
	}
Why not just do this instead

Code:
typedef unsigned int (__stdcall *tfnSendToServer)(ILTMessage_Read *pMsg, uint32 flags);
tfnSendToServer pfnSendToServer = (tfnSendToServer)0x474350;//So you don't have to add the line over and over
And you would also have to change the check for if the key is pressed.

Code:
if (GetAsyncKeyState(VK_F10) &1)
You could just declare all of the pointers to the classes globally and render them. That's what I do, its faster and saves lines.

Code:
void cHacks::InitGamePointers()
{
	g_LTClient = *(CLTClient**)ADDR_LTCLIENT;
	g_CommonLT = g_LTClient->Common();
        
        //All your other stuff in here too.
}
Whatever floats your boat
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us