I'm trying to read http requests and responses by making a KEXT using NKE. I registered a socket filter, whenever I'm getting data I'm printing mbuf using a code like this:
unsigned char *dataString = mbuf_data(*data);
for (size_t i = 0; i < mbuf_len(*data); i++)
{
printf("%c", dataString[i]);
}
printf("\n-------------\n");
I can read http requests and some responses data from logs but can't see any HTML content. I was wondering if I'm not correctly reading mbuf or is it some other problem?