else
{
printf("\\%.3hho", *data);
}
I could not find information regarding on how to decipher it on the net or by reading the C programming language book. I saw it in the following code snippet. The code is trying to perform password sniffing in the telnet protocol.
if ((pktlen - sizeof(struct ipheader)) > dataoffset)
{
printf(" SrcIP: %s,", inet_ntoa(ip->iph_sourceip));
printf(" DstIP: %s,", inet_ntoa(ip->iph_destip));
printf(" Data: ");
u_char* data = (u_char*)tcp + dataoffset;
for (unsigned short s = 0; s < (ntohs(ip->iph_len) - (sizeof(struct ipheader) + dataoffset)); s++)
{
if (isprint(*data) != 0)
{
printf("%c", *data);
}
else
{
printf("\\%.3hho", *data);
}
data++;
}
printf("\n");
}
}