the checksum calculation was more harder to find, i've not discovered yet a bypass trick.
Actually i've traced the checks the bootloader does on main firmware (it skips some flash regions, unique data at 0x4000-0x7FFF and bootloader area).
These areas are checked (flash is mapped to 200000):
- from 200000 to 203FFF
- from 208000 to 20BFFF
- from 210000 to 2DFFFF
for each area (starting form the last word then backward), a word based sum is done and the result must be 00, while 4 parallel xor are calculated and must result 00. I'll try to explain better:
00000000 56 31 59 4C 28 22 2D 23 02 01 02 00 00 00 00 00 V1YL("-#........
00000010 40 40 00 79 1E 02 4A 14 00 00 00 00 00 00 00 00 @@.y..J.........
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000030 4D 43 30 38 31 30 2F 30 33 2F 30 36 00 21 7C E4 MC0810/03/06.!|.
..............
...............
00003FB0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
00003FC0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
00003FD0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
00003FE0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
00003FF0 F6 71 56 29 90 AE 58 C4 48 AB A3 37 0F 20 6C A5 .qV)..X.H..7. l.
| | | | |
| | | | |
divide the above into 4 vertical columns, each word in the colums, starting from the end, is xored with the upper word in the same column, finally the result for each column must be 00 (at least it seems for sure for the 3rd column in the code i've traced)
ROM:002F0D76 ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
ROM:002F0D76
ROM:002F0D76
ROM:002F0D76 .type various_XOR, @function
ROM:002F0D76 various_XOR:
ROM:002F0D76 stm0 (r5, r6) ; DATA XREF: checksum_firmware+C
ROM:002F0D76 ; checksum_firmware+18
ROM:002F0D76 ; bootmode_unknown_3B_not04_writebuffer+18
ROM:002F0D76 ; bootmode_unknown_3B_not04_writebuffer+20
ROM:002F0D78 enter #4
ROM:002F0D7A stm0 (r0, r1, r2, r3, r7)
ROM:002F0D7C stm1 (r13)
ROM:002F0D7E mov r5, r13
ROM:002F0D80 lsl #2, r13 ; 4000, D000, 4000, offset to start reading flash content
ROM:002F0D82 ldi:8 #0, r7 ; will contain sum of words
ROM:002F0D84 ldi:8 #0, r0 ; will contain result of xor of 1st column
ROM:002F0D86 ldi:8 #0, r1 ; will contain result of xor of 2nd column
ROM:002F0D88 ldi:8 #0, r2 ; will contain result of xor of 3rd column
ROM:002F0D8A ldi:8 #0, r3 ; will contain result of xor of 4th column
ROM:002F0D8C
ROM:002F0D8C loc_2F0D8C: ; CODE XREF: various_XOR+38
ROM:002F0D8C add2 #0xC, r13 ; subtract 4
ROM:002F0D8E ld @(r13, r4), r5 ; r4 is flash base address, 200000, 210000, 208000
ROM:002F0D90 add r5, r7
ROM:002F0D92 eor r5, r3
ROM:002F0D94 add2 #0xC, r13
ROM:002F0D96 ld @(r13, r4), r5
ROM:002F0D98 add r5, r7
ROM:002F0D9A eor r5, r2
ROM:002F0D9C add2 #0xC, r13
ROM:002F0D9E ld @(r13, r4), r5
ROM:002F0DA0 add r5, r7
ROM:002F0DA2 eor r5, r1
ROM:002F0DA4 add2 #0xC, r13
ROM:002F0DA6 ld @(r13, r4), r5
ROM:002F0DA8 add r5, r7
ROM:002F0DAA eor r5, r0
ROM:002F0DAC cmp #0, r13
ROM:002F0DAE bne loc_2F0D8C ; repeat untill the begin of the checksumed area
ROM:002F0DB0 mov r7, r4 ; r4 now is the sum of words
ROM:002F0DB2 ld @r6, r5 ; initially should be 00000000
ROM:002F0DB2 ; but if more than one fw area is checked, it
ROM:002F0DB2 ; contains the resulting xor of the previous
ROM:002F0DB2 ; fw checked part
ROM:002F0DB4 eor r0, r5
ROM:002F0DB6 st r5, @r6
ROM:002F0DB8 add #4, r6
ROM:002F0DBA ld @r6, r5
ROM:002F0DBC eor r1, r5
ROM:002F0DBE st r5, @r6
ROM:002F0DC0 add #4, r6
ROM:002F0DC2 ld @r6, r5
ROM:002F0DC4 eor r2, r5
ROM:002F0DC6 st r5, @r6
ROM:002F0DC8 add #4, r6
ROM:002F0DCA ld @r6, r5
ROM:002F0DCC eor r3, r5
ROM:002F0DCE st r5, @r6
ROM:002F0DD0 ldm1 (r13)
ROM:002F0DD2 ldm0 (r0, r1, r2, r3, r7)
ROM:002F0DD4 leave
ROM:002F0DD6 addsp #8
ROM:002F0DD8 ret
ROM:002F0DD8 .size various_XOR, .-various_XOR
ROM:002F0DDA ; ---------------------------------------------------------------------------
I've checked the sum of fw part is really 00, using firmsum.exe by xt5 (also hitachi drive uses a word based sum for checks)
http://www.ingenieria-inversa.cl/files/toolkit.rarbut i need a tool that calculates the xors, is there anyone that could help? i'm not able to do it myself

the first and last 0x10 bytes of fw part seems changeable values to let calculation pass, but...just wondering, is it possible that sums and xors could be all 00?