io_crypt - encrypt your photos while you shoot them

Started by g3gg0, February 02, 2014, 12:36:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

g3gg0

can you:
- load and enable trace.mo
- start camera
- set password using password encrypion
- shoot one image
- poweroff

and send me both log and image please?
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

1%

ha, didn't think to log it.

shit, I'm not getting the log... even if I comment out the if(1) in iocrypt_init

g3gg0

Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!


eos

[650D; M; 9.feb nightly; iocrypt 9.feb 19:44; io_decrypt.exe 09.feb]

decoded .cr2 & .jpg still not readable (neither pw nor rsa).

1%

Do the log like I did.... maybe g3gg0 can compare the 2

g3gg0

fixed a bug that happened rarely on the 5D3 and sometimes on the 7D.
reason was an odd address offset that i didnt handle cleanly on block size borders.

should fix the issue you had, 1%
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

1%

Ok, will give it a go.

It appears to be working... the files now decrypt in camera and when you don't set the right password they do not. Can't test the RSA unless you updated the exe


c:\mingw\include\io.h:302:39: error: unknown type name 'off64_t'
__CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence) {
                                       ^
In file included from crypt_rsa.c:24:0:
c:\mingw\include\unistd.h:65:20: error: unknown type name 'off_t'
int ftruncate(int, off_t);

g3gg0

still get an error 70 during series shooting, which i am currently tracking down.
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

1%

Wonder if the other iodev_ctx I had will work too since behavior was the same with both.. previous was pointer to somewhere, current goes to 0.

eos

Sorry, I've been very busy in the last days.
I have no toolchain. So can someone give me a download to a compiled trace.mo?

1%

Ok, EOSM is working:


    else if(streq(camera_model_short, "EOSM"))
    {
        iodev_table = 0x6F518;
        iodev_ctx = 0x9C4A8;
        iodev_ctx_size = 0x20;
    }


Only tested password... did jpegs

g3gg0

Cool. Thanks.
did you have any issues with series shooting longer than 5 seconds?
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

1%


ASSERT: 0
at ./Capture/Capture.c:526, task EventMgr
lv:0 mode:3


Magic Lantern version : Tragic.2014Feb13.6D113
Mercurial changeset   : 9706fb780627+ (unified) tip
Built on 2014-02-14 04:46:32 UTC by User@PC.
Free Memory  : 341K + 1661K


http://paste2.org/LVVd7x4e

Yea, It dies

g3gg0

it is some weird error.
either some memory areas are corrupted when the module is loaded, or ... hmm i dont know.
point is, even if i remove the whole encryption stuff and just cycle through a few bytes without modifying, it crashes.
making the code smaller, causes the error to disappear.

caller stack cannot be the issue. i reserve a few bytes only in a function that is calling complex FIO_ stuff which potentially needs hundreds of bytes.
also tskmon isnt ringing.
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

a1ex

Can you prepare a minimal working example with these few bytes?

g3gg0

yep, can prepare one.
first i wanted to check if the memory backend changes made things worse or better.

basically it was commenting out all update_key in encrypt crypt_lfsr64_encrypt and commenting out the assignments in crypt_lfsr64_xor_uint*
so the loops were iterating, but not changing anything. the assembly code was sane and just counting up registers, depending on optimization level.

alternatively running the first update_key, doing a msleep(20) and returning caused the same crash.

disabling trace module didnt help
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

eos

[650D; P; 14.feb nightly; iocrypt 9.feb 19:44]

In review most pictures are only shown as a thumbnail with
"Cannot playback image".

shooting series (only tried with pw):
mostly i get an error 80 and sometimes error 70.

1%

Then 650D must be wrong/still not decrypting.


    else if(streq(camera_model_short, "50D"))
    {
        trace_write(iocrypt_trace_ctx, "io_crypt: Detected 50");
        iodev_table = 0x1F208;
        iodev_ctx = 0x49A64;
        iodev_ctx_size = 0x18;
    }


Not sure on the CTX but images are taken and encrypted... just not decrypted.

g3gg0

will disable encryption when series shooting is active.
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

g3gg0

When shoot mode is not single image mode, encryption is disabled.
this will catch the cases where shooting will fail during IO encryption.

this will also disable it in silent image mode that 5d3 and 6d (iirc) have.

of course it not the root reason, but if someone can find out where the crashes come from, please tell me.
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

1%

Did it also error on 600D and 7D in burst?

I'll have to log 50D and post here :) Same should be done for 650D

g3gg0

tried on 5d3 and 7d, both crash.
my (private) 600d is currently at a friend
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

1%


Marsu42

Quote from: g3gg0 on February 15, 2014, 03:17:49 PM
this will also disable it in silent image mode that 5d3 and 6d (iirc) have.

Is this a side effect or intentional? As far as I can see, shooting in single image mode but silent shouldn't be different from vanilla non-burst mode - or am I missing some internals?