From: Linus Torvalds Date: Fri, 27 Jan 2012 22:10:55 +0000 (-0800) Subject: cochran: do the full de-scramble for one case X-Git-Url: http://git.tdb.fi/?p=ext%2Fsubsurface.git;a=commitdiff_plain;h=5bc3ba5e95e753c86d483d8adc0326e8a80c5797 cochran: do the full de-scramble for one case So this descrambles all the dives in *one* of my cochran test files. I still don't know what the dive data *means*, but it's not a random jumble of bytes any more: there are very clear patterns. However, the magic offsets that work for that particular CAN file are not generic, because they don't work for another. So there is some magic dynamic decoding that I don't know about. There is probably more decode information in the initial decode block, over and beyond just the scrambling bytes. (The scrambling array is 234 bytes starting at 0x40001, but the first actual *dive* data starts at 0x45e03, so there's tons of unknown stuff in the file even outside the dives themselves) Signed-off-by: Linus Torvalds --- diff --git a/cochran.c b/cochran.c index 84bfcb9..e5beea9 100644 --- a/cochran.c +++ b/cochran.c @@ -146,7 +146,9 @@ static void parse_cochran_dive(const char *filename, int dive, * scrambled, but there seems to be size differences in the data, * so this just descrambles part of it: */ - partial_decode(0x48ff, size, decode, 0, mod, in, size, buf); + partial_decode(0x48ff, 0x4a14, decode, 0, mod, in, size, buf); + partial_decode(0x4a14, 0xc9bd, decode, 0, mod, in, size, buf); + partial_decode(0xc9bd, size, decode, 0, mod, in, size, buf); cochran_debug_write(filename, dive, buf, size);