I can't figure out what the problem is. Currently, I am able to create a custom packet,
add parameters and send it to the server. However, if one of those parameters is a string, my client will crash. Very few times will my client actually send it without crashing
As an example, if I send the packet Channel.Request.Chat, my client goes "lol no" and dies.
MCommandParameterString:
The part to send the packet:Code:typedef MCommandParameterString*( __thiscall* MCommandParameterStringType )( MCommandParameterString*, char* szValue ); MCommandParameterStringType MCommandParameterStringConstructor = reinterpret_cast<MCommandParameterStringType>( MCommandParameterStringAddress ); // // class MCommandParameterString : public MCommandParameter { public: char* m_szValue; MCommandParameterString( char* szValue ); }; // // MCommandParameterString::MCommandParameterString( char* szValue ) { MCommandParameterStringConstructor( this, szValue ); }
(I will post what the actual error shows in Gunz in a few;)Code:MCommand* pCmd = MCommand::Create( 0x4C9 ); pCmd->AddParameter( new MCommandParameterMUID( &pCmd->m_pCommandDesc->m_uidSender ) ); pCmd->AddParameter( new MCommandParameterMUID( ( uidChannel ) ); pCmd->AddParameter( new MCommandParameterString( "Lol?" ) ); MCommand::Post( pCmd );
Edit-
I hooked MMatchServer::OnCommand, and the server does get the chat string.
Here's what the dump says;
Dump Summary
------------
Dump File: Gunz.dmp : C:\Users\admin\Desktop\Gunz\TG Developments\Client\Gunz.dmp
Last Write Time: 12/20/2010 6:35:38 PM
Process Name: thedueldll.exe : C:\Users\adminDesktop\Gunz\TG Developments\Client\thedueldll.exe
Process Architecture: x86
Exception Code: 0xC0000005
Exception Information: The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
Heap Information: Not Present


Reply With Quote



