Temp: fix auth packet dump (correct fmt + raw header bytes)
This commit is contained in:
@@ -340,6 +340,22 @@ bool WorldSocket::ReadHeaderHandler()
|
|||||||
IncomingPacketHeader* header = reinterpret_cast<IncomingPacketHeader*>(_headerBuffer.GetReadPointer());
|
IncomingPacketHeader* header = reinterpret_cast<IncomingPacketHeader*>(_headerBuffer.GetReadPointer());
|
||||||
uint32 encryptedOpcode = header->EncryptedOpcode;
|
uint32 encryptedOpcode = header->EncryptedOpcode;
|
||||||
|
|
||||||
|
if (encryptedOpcode == CMSG_AUTH_SESSION)
|
||||||
|
{
|
||||||
|
std::string hdrHex;
|
||||||
|
hdrHex.reserve(sizeof(IncomingPacketHeader) * 3);
|
||||||
|
static constexpr char hdrDigits[] = "0123456789ABCDEF";
|
||||||
|
uint8 const* hdrBytes = _headerBuffer.GetReadPointer();
|
||||||
|
for (std::size_t i = 0; i < sizeof(IncomingPacketHeader); ++i)
|
||||||
|
{
|
||||||
|
uint8 b = hdrBytes[i];
|
||||||
|
hdrHex.push_back(hdrDigits[b >> 4]);
|
||||||
|
hdrHex.push_back(hdrDigits[b & 0xF]);
|
||||||
|
hdrHex.push_back(' ');
|
||||||
|
}
|
||||||
|
TC_LOG_ERROR("network", "CMSG_AUTH_SESSION raw header ({} bytes): {}", sizeof(IncomingPacketHeader), hdrHex);
|
||||||
|
}
|
||||||
|
|
||||||
if (!header->IsValidSize())
|
if (!header->IsValidSize())
|
||||||
{
|
{
|
||||||
_authCrypt.PeekDecryptRecv(reinterpret_cast<uint8*>(&header->EncryptedOpcode), sizeof(encryptedOpcode));
|
_authCrypt.PeekDecryptRecv(reinterpret_cast<uint8*>(&header->EncryptedOpcode), sizeof(encryptedOpcode));
|
||||||
@@ -624,7 +640,7 @@ WorldSocket::ReadDataHandlerResult WorldSocket::HandleAuthSession(WorldPacket&&
|
|||||||
rawHex.push_back(hexDigits[b & 0xF]);
|
rawHex.push_back(hexDigits[b & 0xF]);
|
||||||
rawHex.push_back(' ');
|
rawHex.push_back(' ');
|
||||||
}
|
}
|
||||||
TC_LOG_ERROR("network", "CMSG_AUTH_SESSION raw (%zu bytes): {}", packet.size(), rawHex);
|
TC_LOG_ERROR("network", "CMSG_AUTH_SESSION raw ({} bytes): {}", packet.size(), rawHex);
|
||||||
|
|
||||||
if (_authed)
|
if (_authed)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user