I've got a few Yahoo! Messenger .dat files that I'm trying to read. I found this site:
that describes the file format. Basically, you have four four-byte integers, then an xor'ed message payload. The payload is different for each message. The fourth integer gives you the length of the message payload in bytes.
My goal is to read these messages in, de-XOR them, and then output them to a file. Reading the four integers is easy, but the idea fails when I get to reading the message itself. Here's the code:
After the fread() call, any access to the message_text array causes a segfault. I've tried to add a string terminator, which fails; printing one element of the array fails. I'm having trouble seeing what I'm doing wrong here. Does anyone have any idea?
struct y_mess_header message;
printf("Epoch time is: %d \n",message.epoch_time);
printf("Throwaway is: %d \n",message.throwaway);
printf("Sender is: %d \n",message.sender);
printf("Message length is: %d \n",message.length);
printf ("Read: %d\n",y);
printf("Array 0 is %c\n",message_text);
Thanks for the help.