lets talk about HandlePlayerLoginOpcode that handles CMSG_PLAYER_LOGIN opcode the handle just take the guid of player from packet structure of the opcode and then adds player to world and continues... this handle works on TC 4.3.4 :
Code:
playerGuid[2] = recvData.ReadBit();
playerGuid[3] = recvData.ReadBit();
playerGuid[0] = recvData.ReadBit();
playerGuid[6] = recvData.ReadBit();
playerGuid[4] = recvData.ReadBit();
playerGuid[5] = recvData.ReadBit();
playerGuid[1] = recvData.ReadBit();
playerGuid[7] = recvData.ReadBit();
recvData.ReadByteSeq(playerGuid[2]);
recvData.ReadByteSeq(playerGuid[7]);
recvData.ReadByteSeq(playerGuid[0]);
recvData.ReadByteSeq(playerGuid[3]);
recvData.ReadByteSeq(playerGuid[5]);
recvData.ReadByteSeq(playerGuid[6]);
recvData.ReadByteSeq(playerGuid[1]);
recvData.ReadByteSeq(playerGuid[4]);
I searched for that function in IDA and i found sub_625150 function and then i pseudocode the asemmbly code to C code and this is our code now :
Code:
int __stdcall ClientConnection__SendPlayerLoginOpcode(int a1, int a2, int a3)
{
int result;
char v4
int v5;
int v6;
int v7;
int v8;
int v9;
int v10;
v6 = 0;
v7 = 0;
v8 = 0;
v9 = 0;
v5 = (int)off_B898C4;
v10 = -1;
sub_66D6F0((int)&v4, a1, a2);
NetClient__Send(&v4, 2);
result = sub_66BC20(&v4);
v5 = (int)off_B898C4;
if ( v8 != -1 )
result = off_B898C8(&v5, &v6, &v7, &v8);
return result;
}
so the problem is how can i find that packet structure when this function sends it?
thanks for your helping