I've started taking a look at the firmware of the Leica Q camera.
After you XOR everything with FF, you end up with something that is like the firmware of Panasonic cameras (UPD format):
UPD is the magic, CAYMN I assume is the codename of the camera, 0316 is the version of the firmware, 0200 the size of the first header, 0312E200 the size of the file without the first header, B5435A78 the checksum.
The firmware contains 22 sections:
18 of which are encrypted. I haven't been able yet to figure out what encryption they use and how to decrypt them, hence this post.
There's an index section right after the second UPD header:
I have figured out that:
By just applying AES-128 ECB decryption with the 16 bytes that are a key, I don't get to decrypt the sections.
I have also noticed that right before this UPD header there is a section starting with "leica" that contains 64 bytes that I cannot relate to any checksums:
so maybe the encryption method combines those with the 16 bytes of each section in the index.
Has any of you encountered anything similar in the firmware of other cameras? Any hints about how to proceed in order to decrypt the 18 encrypted sections?
Hi @paorin thanks for the findings! It's a reply after 6 years:) I'm recently exploring my Q3 firmware and they are in the same structure. I believe this format is also widely used in Panasonic Lumix cameras. For Q3 firmware, there are 56 sections defined while some of them are 0 sized.
The key problem here is encryption. All encrypted sections have a 16-byte data which might be IV or some key. If they are IV, then the key must be hard coded in the firmware or in the hardware directly. It's difficult to fetch them unless we can have a clean firmware dump
boot
loader1
loader2
loader3
storage
program
postboot1_r
postboot2_r
postboot3_r
postboot4_r
postboot5_r
postboot1_r
postboot3_r
postboot5_r
eep_ow_a
eep_ow_b
eep_adj
eep_fix
eep_act_a
eep_act_b
eep_exp_a
eep_exp_b
history
lens_hist
music
osdover
osddata
wifi_info
menu_save
kizu_data
vkizu_data
usbcharge
hm_c_prog
hm_d_prog
hm_c_ddr
hm_d_ddr
hm_d_nw
hm_d_nw_sng
hr_c_prog
hr_d_prog
hr_c_ddr
pzm_data
lns_micon
lns_micon_e
xtk
lut_data
dsp_kizu_c
dsp_kizu_d
bt_info
lpc_data
lpc_code
raw_kizu_c
raw_kizu_d
ext_ver
welcom_fs
mbr_dummy_d
Ouch, complex.
Wish you luck.
All modern cameras use encryption by key that is stored inside encrypted firmware. :-)
This is why Canon hacking had been project is very shady back in time (in some moments), as few keys appeared out of nowhere (from Canon help, I suppose).
It looks like you're new here. If you want to get involved, click one of these buttons!