0

I write little application for design message history from whatsapp app. The whatsapp app is stored data into sqlite db.

First of all I decrypt the db.

Secondly, I see that the DB have a table for messages, with those columns (attached as link):

http://imgbox.com/HCyEfH3e

So, there have a records for images, video, audio and etc.

Now, for every record I try to save to local directory on my pc, as follows:

First way:

File.WriteAllBytes(Path.Combine(directoryPath, msg.Media.MediaName)), msg.Media.RAW_DATA);

But I see, that it working only for image files, not for audio and video files..

Second way:

using (FileStream fs = new FileStream(Path.Combine(directoryPath, msg.Media.MediaName), FileMode.Create))
{
    using (BinaryWriter writer = new BinaryWriter(fs))
    {
        writer.Write(msg.Media.RAW_DATA);
    }
}

but I get same results :-(

My question - what the correct way for getting audio and video files?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
David Michaeli
  • 367
  • 5
  • 26
  • Most likely the blob is too large so it's buffering the returned value. [See here](http://stackoverflow.com/questions/625029/how-do-i-store-and-retrieve-a-blob-from-sqlite) how to read a large blob from sql lite. – Candide Mar 31 '14 at 09:15
  • A blob in the database maps to a byte array in .NET, so i cast the column to byte[] as this: byte[] raw_data = row[RAW_DATA_COLUMN] as byte[]; – David Michaeli Mar 31 '14 at 10:12

0 Answers0