The Problem
Camera is constantly writing to the card File doesnt get a lesystem entry until its nished File is MIA, I want to see the crash video! Camera lost power before recording was nished (front part of plane separated, battery was ejected.
PARKZONE RADIAN
Thursday, 16 September 2010
What to do?
Dont write to the card. Dont lesystem check the card. Dont even mount it. Image it. Stop diskarbitrationd on OS X dd if=/dev/disk2s1 of=~/sdcard.img bs=128m chmod -w ~/sdcard.img
Clusters
mkdosfs\0
sectorsPer sectorsPer FAT Track media Heads
reserved Sectors
nSectors
sectors PerFAT
fatVers Num
clusterNumRootDir
drive Letter NT Flags sig
cluster FSInfo
clusterBa ckupBoot
volumeSerialNumber
volumeLabel bootCode
partSig
VOLUME HEADER
Thursday, 16 September 2010
mkdosfs\0
sectorsPer sectorsPer FAT Track media Heads
reserved Sectors
nSectors
sectors PerFAT
fatVers Num
clusterNumRootDir
drive Letter NT Flags sig
cluster FSInfo
clusterBa ckupBoot
volumeSerialNumber
volumeLabel bootCode
partSig
Clusters
CLUSTER FORMAT
Thursday, 16 September 2010
THE FAT
Thursday, 16 September 2010
READ CLUSTERS
Thursday, 16 September 2010
What next?
Go through the FAT, for each cluster, assemble a set of linked list chains from all the pointers. Go through each chain and dump all the clusters to a le.
THE RESULT
Thursday, 16 September 2010
There are two unaccounted for videos here. Lets play them... Except they dont play. What a shame.
gm$ file * 11.avi: RIFF (little-endian) data, AVI, 0 x 0, >30 fps, video: Motion JPEG, audio: uncompressed PCM (mono, 24000 Hz) 27.avi: RIFF (little-endian) data, AVI, 720 x 480, 30.00 fps, video: Motion JPEG, audio: uncompressed PCM (mono, 24000 Hz) 29.avi: RIFF (little-endian) data, AVI, 720 x 480, 30.00 fps, video: Motion JPEG, audio: uncompressed PCM (mono, 24000 Hz) 30.avi: RIFF (little-endian) data, AVI, 720 x 480, 30.00 fps, video: Motion JPEG, audio: uncompressed PCM (mono, 24000 Hz) 31.avi: RIFF (little-endian) data, AVI, 720 x 480, 30.00 fps, video: Motion JPEG, audio: uncompressed PCM (mono, 24000 Hz) 32.avi: RIFF (little-endian) data, AVI, 720 x 480, 30.00 fps, video: Motion JPEG, audio: uncompressed PCM (mono, 24000 Hz) 33.avi: RIFF (little-endian) data, AVI, 0 x 0, >30 fps, video: Motion JPEG, audio: uncompressed PCM (mono, 24000 Hz)
FILE *
Thursday, 16 September 2010
HEXEDIT TIME!
Thursday, 16 September 2010
RIFF type AVI LIST type hdrl avih - main headers strl - stream headers LIST type movi (optionally also rec ) 00dc compressed video 01wb audio 00dc compressed video 01wb audio
AVI hdrl headers movi 00dc compressed video 01wb audio 00dc compressed video 01wb audio 00dc compressed video 00dc compressed video 00dc compressed video 01wb audio 01wb audio 01wb audio
00DC
01WB
DO THIS:
Thursday, 16 September 2010
AUDIO FORMAT
Thursday, 16 September 2010
Split the le by every instance of FFD8 and write to a le Motion JPEG frames have no DHT segment Simple. Apple must be using the QuickTime decoder for it which knows what motion JPEG is, and therefore is using the right DHT.
Thursday, 16 September 2010
Wrong! The le works in imagemagick and Chromium. FFC4 is the marker for the start of the Huffman table. Theres one in the le. This camera is doing it the dodgy way - probably just writes out JPEGs from an embedded JPEG camera chip.
IMPORT
Thursday, 16 September 2010
directory: le1 starts at 3 consult FAT: 3->4->5->6->? Whered the le go? Delayed write = incomplete sector chain. The missing part of the FAT is on a sector boundary. Block allocation, however, is pretty much linear for a card that started off empty. Read from sector 3 to where the data becomes zeros. Use the FAT only for the starting position.
Where to now?
http://gm.stackunderow.com/blog/pivot/entry.php?id=158 http://vimeo.com/14581494 http://en.wikipedia.org/wiki/File_Allocation_Table http://wiki.osdev.org/FAT http://gm.stackunderow.com/stuff/fat32_5mins.pdf