aboutsummaryrefslogtreecommitdiffstats
path: root/cochran.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-01-27 14:10:55 -0800
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-01-27 14:10:55 -0800
commit5bc3ba5e95e753c86d483d8adc0326e8a80c5797 (patch)
tree187f227d523948845655e9e6f830e9faff4a8ea1 /cochran.c
parente5d2bdc9ba6f6a160776717f244a05286831c1ed (diff)
downloadsubsurface-5bc3ba5e95e753c86d483d8adc0326e8a80c5797.tar.gz
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 <torvalds@linux-foundation.org>
Diffstat (limited to 'cochran.c')
-rw-r--r--cochran.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cochran.c b/cochran.c
index 84bfcb96a..e5beea9bc 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);