@@ -288,8 +288,11 @@ def get_params_for_dji_imah_fwsig(modl_inp_fn):
288288 module_changes_limit = 2 + 256
289289 elif (m := re .match (r'^.*/(rc-n1-wm260)([._].*)?[.](bin|cfg|enc|fw|img|sig|ta|txt)$' , modl_inp_fn , re .IGNORECASE )):
290290 platform = m .group (1 )
291- if False :
292- pass # no quirks
291+ # specific nested modules
292+ if (re .match (r'^.*{:s}_1502_[^/]*[.]fw_1502.*adsb_soc.*$' .format (platform ), modl_inp_fn , re .IGNORECASE )):
293+ module_cmdopts = "-k PRAK-2020-04 -k TBIE-9999-99 -f" # TBIE not published, forcing extract encrypted
294+ # allow change of 2 bytes from auth key name, 4+4 from enc+dec checksum, 256 from signature, up to 11x16 chunk padding, 32 payload digest
295+ module_changes_limit = 2 + 4 + 4 + 256 + 11 * 16 + 32
293296 else : # if first level module or nested within m1301
294297 module_cmdopts = "-k PRAK-2018-01 -k TBIE-2020-04"
295298 # allow change of 2 bytes from auth key name, 256 from signature, up to 16 chunk padding
@@ -356,6 +359,11 @@ def get_params_for_dji_imah_fwsig(modl_inp_fn):
356359 module_cmdopts = "-k PRAK-2018-01 -k TBIE-2020-04"
357360 # allow change of 2 bytes from auth key name, 4+4 from enc+dec checksum, 256 from signature, up to 11x16 chunk padding, 32 payload digest
358361 module_changes_limit = 2 + 4 + 4 + 256 + 11 * 16 + 32
362+ # specific nested modules
363+ elif (re .match (r'^.*{:s}_0801_[^/]*[.]fw_0801.*adsb_soc.*$' .format (platform ), modl_inp_fn , re .IGNORECASE )):
364+ module_cmdopts = "-k PRAK-2020-04 -k TBIE-9999-99 -f" # TBIE not published, forcing extract encrypted
365+ # allow change of 2 bytes from auth key name, 4+4 from enc+dec checksum, 256 from signature, up to 11x16 chunk padding, 32 payload digest
366+ module_changes_limit = 2 + 4 + 4 + 256 + 11 * 16 + 32
359367 # remaining nested modules
360368 elif (re .match (r'^.*{:s}_0701_[^/]*[.]fw_0701.*$' .format (platform ), modl_inp_fn , re .IGNORECASE ) or
361369 re .match (r'^.*{:s}_0801_[^/]*[.]fw_0801.*$' .format (platform ), modl_inp_fn , re .IGNORECASE ) or
@@ -369,8 +377,13 @@ def get_params_for_dji_imah_fwsig(modl_inp_fn):
369377 module_changes_limit = 2 + 4 + 256
370378 elif (m := re .match (r'^.*/(wm170|wm232|gl170|pm430|ag500)([._].*)?[.](bin|cfg|enc|fw|img|sig|ta|txt)$' , modl_inp_fn , re .IGNORECASE )):
371379 platform = m .group (1 )
372- # nested modules
373- if (re .match (r'^.*{:s}_0701_[^/]*[.]fw_0701.*$' .format (platform ), modl_inp_fn , re .IGNORECASE ) or
380+ # specific nested modules
381+ if (re .match (r'^.*{:s}_0801_[^/]*[.]fw_0801.*adsb_soc.*$' .format (platform ), modl_inp_fn , re .IGNORECASE )):
382+ module_cmdopts = "-k PRAK-2020-04 -k TBIE-9999-99 -f" # TBIE not published, forcing extract encrypted
383+ # allow change of 2 bytes from auth key name, 4+4 from enc+dec checksum, 256 from signature, up to 11x16 chunk padding, 32 payload digest
384+ module_changes_limit = 2 + 4 + 4 + 256 + 11 * 16 + 32
385+ # remaining nested modules
386+ elif (re .match (r'^.*{:s}_0701_[^/]*[.]fw_0701.*$' .format (platform ), modl_inp_fn , re .IGNORECASE ) or
374387 re .match (r'^.*{:s}_0801_[^/]*[.]fw_0801.*$' .format (platform ), modl_inp_fn , re .IGNORECASE ) or
375388 re .match (r'^.*{:s}_0802_[^/]*[.]fw_0802.*$' .format (platform ), modl_inp_fn , re .IGNORECASE )):
376389 module_cmdopts = "-k PRAK-2020-01 -k TBIE-2020-02"
@@ -622,7 +635,12 @@ def get_params_for_dji_imah_fwsig(modl_inp_fn):
622635 elif (m := re .match (r'^.*/(wm260|wm2605)([.][a-z]*|[_][0-9]{4}.*)?[.](bin|cfg|enc|fw|img|sig|ta|txt)$' , modl_inp_fn , re .IGNORECASE )):
623636 platform = m .group (1 )
624637 # specific nested modules
625- if (re .match (r'^.*{:s}_1502_[^/]*[.]fw_1502.*$' .format (platform ), modl_inp_fn , re .IGNORECASE )):
638+ if (re .match (r'^.*{:s}_1502_[^/]*[.]fw_1502.*adsb_soc.*$' .format (platform ), modl_inp_fn , re .IGNORECASE )):
639+ module_cmdopts = "-k PRAK-2020-04 -k TBIE-9999-99 -f" # TBIE not published, forcing extract encrypted
640+ # allow change of 2 bytes from auth key name, 4+4 from enc+dec checksum, 256 from signature, up to 11x16 chunk padding, 32 payload digest
641+ module_changes_limit = 2 + 4 + 4 + 256 + 11 * 16 + 32
642+ # specific nested modules
643+ elif (re .match (r'^.*{:s}_1502_[^/]*[.]fw_1502.*$' .format (platform ), modl_inp_fn , re .IGNORECASE )):
626644 module_cmdopts = "-k PRAK-2020-01 -k TBIE-2020-02"
627645 # allow change of 2 bytes from auth key name, 4+4 from enc+dec checksum, 256 from signature, up to 9x16 chunk padding, 32 payload digest, 6x16 unknown additional
628646 module_changes_limit = 2 + 4 + 4 + 256 + 9 * 16 + 32 + 6 * 16
@@ -937,7 +955,7 @@ def test_dji_imah_fwsig_v2_rebin(capsys, cmdargs, pkg_inp_dir, test_nth):
937955 pass
938956
939957
940- @pytest .mark .order (5 ) # must be run after test_bin_archives_imah_v2_extract, test_bin_bootimg_imah_v2_extract, test_bin_archives_imah_v2_nested_extract
958+ @pytest .mark .order (6 ) # must be run after test_bin_archives_imah_v2_extract, test_bin_bootimg_imah_v2_extract, test_bin_archives_imah_v2_nested_extract, test_bin_bootimg_imah_v2_nested_extract
941959@pytest .mark .fw_imah_v2
942960@pytest .mark .parametrize ("modl_inp_dir,test_nth" , [
943961 ('out/ac103-osmo_action_2' ,1 ,),
@@ -1006,6 +1024,7 @@ def test_dji_imah_fwsig_v2_nested_rebin(capsys, cmdargs, modl_inp_dir, test_nth)
10061024 "{}/*/*-loader_p*.img.sig" .format (modl_inp_dir ),
10071025 "{}/*/*-unpack_p*.img.sig" .format (modl_inp_dir ),
10081026 "{}/*/*-part_p*.img.sig" .format (modl_inp_dir ),
1027+ # output from test_bin_bootimg_imah_v2_nested_extract
10091028 "{}/*/*-adsb_soc_p*.img.sig" .format (modl_inp_dir ),
10101029 # output from test_bin_archives_imah_v2_nested_extract
10111030 "{}/*/*-extr1/vendor-extr1/ta/*-*-*0.ta" .format (modl_inp_dir ),
0 commit comments