Announcement

Collapse
No announcement yet.

Flashing the MK60 with ZCP software

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • bigjae46
    replied
    I have no idea what's going on but sounds like progress! lol

    Leave a comment:


  • Bry5on
    replied
    Very nice!!! Great work

    Leave a comment:


  • heinzboehmer
    replied
    Click image for larger version

Name:	PfgNWZ.gif
Views:	145
Size:	852.8 KB
ID:	615547

    Man, it took forever, but I finally got a dump!
    Click image for larger version

Name:	Screenshot 2026-11-16 at 5.53.50 AM.png
Views:	142
Size:	425.7 KB
ID:	615546

    Got the non-M module to boot into the manufacturer diag protocol. From there I managed to dump the whole flash over K line. Took a while (~20 min), but at least we've got the FW now 🙂

    terra let me know if you want the image. I'll try dumping my ZCP module next.

    Leave a comment:


  • terra
    replied
    Yeah I really need to just dump the firmware on this thing. WindowsARM giving me a little difficulty with getting the python ccp toosl to work (I think). Guess I gotta setup one of my other computers.

    I'm hoping being able to disassemble the bootloader gives us some insights into how to get into it and any proprietary communications protocol that miight still be present on the MK60.

    Leave a comment:


  • heinzboehmer
    replied
    Also, upgraded my harness today (albeit in a kinda hacky way):

    Click image for larger version

Name:	20261115_231852.jpg
Views:	70
Size:	254.4 KB
ID:	615537

    Now Gauge.S can control the module's ignition signal (and it has feedback on its status). With this, I should be able to have enough control over the ignition timing to try to get into the manufacturing diag protocol.

    Leave a comment:


  • heinzboehmer
    replied
    Originally posted by terra View Post
    Correct. Haven't actually tried doing stuff with CCP yet. But at the very least does seem to take the 31 31 01 command and report a success?
    Hell yeah! That's pretty awesome.

    Originally posted by terra View Post
    For whatever it's worth, 1A 94 seems to correspond to the 'ident_teves_ecu_sw_nr' job in tool32

    Looking back to how the DME flashing works (which is what I think how all officially programmable BMW modules of the E6x / E9x generation works), 1A 89 is used to grab the 'serial number' of the module, which is combined with a random seed and a 'user ID' (which can be anything) hashed/signed and compared to what the module computes. That seems similar to what you found, except just the hash being compared instead of the RSA signed product? In this case since we'd potentially be using non-BMW flashing routines, I guess perhaps not something we need to worry about (and may well just not be present in these E46 / E85 variants)

    On the DMEs, flashing via CCP appears to bypass all of the signature validation stuff altogether, which is what I'm hoping we can achieve.
    That's good to know. Seems to line up with what both the disassembly and that repo say.​ If I'm not mistaken, the `10 85` job is what WinKFP uses to flash the E5, so I think it should all be BMW routines.

    But yes, CCP would be awesome to find on the E46 module. So much faster than K line and no auth stuff to worry about.

    Leave a comment:


  • terra
    replied
    Originally posted by heinzboehmer View Post
    Just to make sure I got the order of everything right, Z4M module does have CCP, non-ZCP and ZCP both don't authenticate to level 0x7E?
    Correct. Haven't actually tried doing stuff with CCP yet. But at the very least does seem to take the 31 31 01 command and report a success?

    Originally posted by heinzboehmer View Post
    Also, am reading through that tool's code again and it looks like the module specific keys are in different spots than on the E5? Specifically, what I called `unit_key` above seems to come from `1A 94`, not `1A 89`. I'll need to go retest this on my bench module (and double check my disassembly).

    I'm hoping the FW key is the same on all modules, cause that one is much, much harder to brute force.
    For whatever it's worth, 1A 94 seems to correspond to the 'ident_teves_ecu_sw_nr' job in tool32

    Looking back to how the DME flashing works (which is what I think how all officially programmable BMW modules of the E6x / E9x generation works), 1A 89 is used to grab the 'serial number' of the module, which is combined with a random seed and a 'user ID' (which can be anything) hashed/signed and compared to what the module computes. That seems similar to what you found, except just the hash being compared instead of the RSA signed product? In this case since we'd potentially be using non-BMW flashing routines, I guess perhaps not something we need to worry about (and may well just not be present in these E46 / E85 variants)

    On the DMEs, flashing via CCP appears to bypass all of the signature validation stuff altogether, which is what I'm hoping we can achieve.

    Leave a comment:


  • heinzboehmer
    replied
    Originally posted by terra View Post
    So this is what I get when I try sending 1A 89 and 31 31 (using tool32 mostly out of laziness)


    Code:
     JOB_STATUS = ERROR_ECU_SUBFUNCTION_NOT_SUPPORTED__INVALID_FORMA T
    
    _TEL_AUFTRAG = 6 Bytes
    
    0000 : B8 29 F1 02 1A 89 ¸)ñ..?
    
    _TEL_ANTWORT = 8 Bytes
    
    0000 : B8 F1 29 03 7F 1A 12 14 ¸ñ)....
    
    JOB_STATUS = ERROR_ECU_SUBFUNCTION_NOT_SUPPORTED__INVALID_FORMAT
    
    _TEL_AUFTRAG = 6 Bytes
    
    0000 : B8 29 F1 02 31 31 ¸)ñ.11
    
    _TEL_ANTWORT = 8 Bytes
    
    0000 : B8 F1 29 03 7F 31 12 3F ¸ñ).1.?
    ​
    Seems like failures on both counts?

    Seeds 27 03, 27 07, 27 FB, 27 FD do appear to be available on this module. 27 04 and 27 FE might exist (gives response code 22 instead of 12).

    Edit:
    Supposedly enabling CCP via this tool does work however - https://vesrah.github.io/MK60E5-Z4-GT3-ABS-Tools/

    I'll have to see if I can adapt their CAN code to work with a candlelight device

    Code:
    [10:08:35 PM] port open for Z4 GT3 (serial); keys: none
    [10:08:35 PM] part number ZB 6769162
    [10:08:35 PM] software id AN_RAE00026
    [10:08:35 PM] key constants from ident: CCP key 0x3BF0 coding key 0x2444
    [10:08:35 PM] Z4 GT3 is answering
    [10:08:39 PM] CCP enabled: 10 87 + level 0x7e seed 0x476b key 0x3304 + 31 31 01​
    Attempting the same on my M3 non-ZCP module:
    Code:
    [10:14:00 PM] port open for Z4 GT3 (serial); keys: none
    [10:14:00 PM] part number ZB 2282250
    [10:14:00 PM] software id AUPY3482.9C3
    [10:14:00 PM] key constants from ident: CCP key 0x1103 coding key 0x0E0D
    [10:14:00 PM] Z4 GT3 is answering
    [10:14:07 PM] enable CCP: NRC 0x33 securityAccessDenied​
    Will try to head to my actual car (which has a ZCP module) and see what that reports

    And basically same result with ZCP module
    Code:
    [10:20:37 PM] port open for Z4 GT3 (serial); keys: none
    [10:20:37 PM] part number ZB 2282420
    [10:20:38 PM] software id AWPY3381.ZC4
    [10:20:38 PM] key constants from ident: CCP key 0x0D03 coding key 0x0B14
    [10:20:38 PM] Z4 GT3 is answering
    [10:20:46 PM] enable CCP: NRC 0x33 securityAccessDenied​
    Which I guess is because the E46 modules don't report 0x7e is available (but perhaps if CCP does exist on these, they use one of the other modes to get in? Or maybe doesn't even have to be enabled like on e5?)
    Very cool!

    Just to make sure I got the order of everything right, Z4M module does have CCP, non-ZCP and ZCP both don't authenticate to level 0x7E?

    Also, am reading through that tool's code again and it looks like the module specific keys are in different spots than on the E5? Specifically, what I called `unit_key` above seems to come from `1A 94`, not `1A 89`. I'll need to go retest this on my bench module (and double check my disassembly).

    I'm hoping the FW key is the same on all modules, cause that one is much, much harder to brute force.

    Edit: Wait, I've been getting the CCP enable path and the programming mode path mixed up in my past few posts. `1A 89` is needed for the programming path, `1A 94` seems to be a shortcut for the CCP enable key, so no need to brute force it. I'll fix my other posts in a bit.
    Last edited by heinzboehmer; 11-15-2026, 09:53 PM.

    Leave a comment:


  • terra
    replied
    So this is what I get when I try sending 1A 89 and 31 31 (using tool32 mostly out of laziness)


    Code:
     JOB_STATUS = ERROR_ECU_SUBFUNCTION_NOT_SUPPORTED__INVALID_FORMA T
    
    _TEL_AUFTRAG = 6 Bytes
    
    0000 : B8 29 F1 02 1A 89 ¸)ñ..?
    
    _TEL_ANTWORT = 8 Bytes
    
    0000 : B8 F1 29 03 7F 1A 12 14 ¸ñ)....
    
      JOB_STATUS                      = ERROR_ECU_SUBFUNCTION_NOT_SUPPORTED__INVALID_FORMAT
    
      _TEL_AUFTRAG                    = 6 Bytes
    
        0000 : B8 29 F1 02 31 31                                  ¸)ñ.11
    
      _TEL_ANTWORT                    = 8 Bytes
    
        0000 : B8 F1 29 03 7F 31 12 3F                            ¸ñ).1.?  
    ​
    Seems like failures on both counts?

    Seeds 27 03, 27 07, 27 FB, 27 FD do appear to be available on this module. 27 04 and 27 FE might exist (gives response code 22 instead of 12).

    Edit:
    Supposedly enabling CCP via this tool does work however - https://vesrah.github.io/MK60E5-Z4-GT3-ABS-Tools/

    I'll have to see if I can adapt their CAN code to work with a candlelight device

    Code:
    [10:08:35 PM] port open for Z4 GT3 (serial); keys: none
    [10:08:35 PM] part number ZB 6769162
    [10:08:35 PM] software id AN_RAE00026
    [10:08:35 PM] key constants from ident: CCP key 0x3BF0 coding key 0x2444
    [10:08:35 PM] Z4 GT3 is answering
    [10:08:39 PM] CCP enabled: 10 87 + level 0x7e seed 0x476b key 0x3304 + 31 31 01​
    Attempting the same on my M3 non-ZCP module:
    Code:
    [10:14:00 PM] port open for Z4 GT3 (serial); keys: none
    [10:14:00 PM] part number ZB 2282250
    [10:14:00 PM] software id AUPY3482.9C3
    [10:14:00 PM] key constants from ident: CCP key 0x1103 coding key 0x0E0D
    [10:14:00 PM] Z4 GT3 is answering
    [10:14:07 PM] enable CCP: NRC 0x33 securityAccessDenied​
    Will try to head to my actual car (which has a ZCP module) and see what that reports

    And basically same result with ZCP module
    Code:
    [10:20:37 PM] port open for Z4 GT3 (serial); keys: none
    [10:20:37 PM] part number ZB 2282420
    [10:20:38 PM] software id AWPY3381.ZC4
    [10:20:38 PM] key constants from ident: CCP key 0x0D03 coding key 0x0B14
    [10:20:38 PM] Z4 GT3 is answering
    [10:20:46 PM] enable CCP: NRC 0x33 securityAccessDenied​
    Which I guess is because the E46 modules don't report 0x7e is available (but perhaps if CCP does exist on these, they use one of the other modes to get in? Or maybe doesn't even have to be enabled like on e5?)

    Leave a comment:


  • terra
    replied
    Cool, I'll work on that a little this weekend. I might hit you up for the slop tool if I'm not making any progress. Don't have that device, but perhaps can adapt it to what I do have.

    Leave a comment:


  • heinzboehmer
    replied
    Originally posted by liam821 View Post
    I doubt there is a JTAG debugger pins/pads on the board, that would be the dream though. You’ll most likely have to use exposed copper traces, vias, or the chip's package pins. And you’re right, the contents of the flash might very well be encrypted - probably is. You’ll still be able to access the boot loader though which should give you some clues.
    That's a good point about the bootloader. Having access to it would be awesome.

    Originally posted by terra View Post
    Do have an easy way to dump these just yet? I guess similar commands to the DMEs etc assuming they're implemented? From what I remember way back in the day this thing behaved pretty similarly to the E46 MK60, but that was when we knew far less than you know now. I could probably start with experiments similar to what you did above
    Only way I know of dumping them is via CCP, so maybe just start by checking if it responds to the `1A 89` and `31 31` KWP commands.

    The steps to enable CCP should be the same as the E5 disassembly steps I posted some posts back. After that it's just standard CCP commands over CAN, as far as I can tell. The UPLOAD command is probably what you want.

    Not at my computer right now, but these are all good resources:

    - https://github.com/heinzboehmer/MK60...wp_dispatch.md
    - https://github.com/vesrah/MK60E5-Z4-...ce-tool/ccp.py

    Can also PM you the slop tool I've been using to test with, but you'll need a Gauge.S (or similar ESP32-S3 based board with CAN and K line chips).

    Leave a comment:


  • terra
    replied
    Originally posted by heinzboehmer View Post
    Can you try getting a dump from your Z4M module just cause? I don't expect the FW to be notably different to the E5 FW available from BMW, but might be worth poking around to see what BMW did and didn't compile in to that one. I'd expect that module to need CCP to be enabled over K line.
    Do have an easy way to dump these just yet? I guess similar commands to the DMEs etc assuming they're implemented? From what I remember way back in the day this thing behaved pretty similarly to the E46 MK60, but that was when we knew far less than you know now. I could probably start with experiments similar to what you did above

    Leave a comment:


  • liam821
    replied
    I doubt there is a JTAG debugger pins/pads on the board, that would be the dream though. You’ll most likely have to use exposed copper traces, vias, or the chip's package pins. And you’re right, the contents of the flash might very well be encrypted - probably is. You’ll still be able to access the boot loader though which should give you some clues.

    Leave a comment:


  • heinzboehmer
    replied
    Originally posted by terra View Post
    Hmm, sounds like we might need to figure out an invasive way of extracting the contents of the flash to really poke around in these. Wonder how practical it'd be to interface a debugger to one of these things. CPU is probably similar to a variant of this? https://www.nxp.com/docs/en/data-sheet/MMC2107.pdf

    Also I have a Z4M MK60e5 I could try poking at if you think that has relevance
    Yep, JTAG is looking more and more like the path forward. Although I'm not sure if we'll run into issues with the onboard security module. Also no clue where to connect the debugger, there's no obvious header on the board.

    Can you try getting a dump from your Z4M module just cause? I don't expect the FW to be notably different to the E5 FW available from BMW, but might be worth poking around to see what BMW did and didn't compile in to that one. I'd expect that module to need CCP to be enabled over K line.

    Originally posted by George Hill View Post
    I don't know if it is helpful but I will likely have an E90 Non-M MK60 available in a few weeks if you need to do some testing that might be destructive.
    Thanks George! That should be an E5, which we have FW for already, but it might be useful for validating the tooling (e.g. for nailing down the timing of the manufacturing test protocol). I'll let you know.

    Leave a comment:


  • George Hill
    replied
    I don't know if it is helpful but I will likely have an E90 Non-M MK60 available in a few weeks if you need to do some testing that might be destructive.

    Leave a comment:

Working...
X