jglim / CaesarSuite

Library and applications to work with Dаіmlеr diagnostics CBF files.
MIT License
125 stars 33 forks source link

Not all functions are parsed from a cbf file #44

Closed KT819GM closed 2 years ago

KT819GM commented 2 years ago

Hello, in general some cbf files for older cars have DiagJob field which contains access unlock functions, making seed calculation unnecessary. As an example Smart For Two W451 have almost all cbf's with these functions available. Being not a programmer I can't contribute to this, but I did checked few times with different cbf's and compared end results against vedi* and CaesarSuite. If this project is still developed I could provide exact file with screenshots.

jglim commented 2 years ago

Hello KT819GM,

Thanks for taking time to write about this issue.

You are correct that the DiagJob contained within CBF files may have the ability to automatically unlock a target. However, DiagJobs are able to do this only because they call on an embedded, compiled script within the CBF. The DiagJob itself does not contain meaningful information; instead, the heavy lifting is done by the script. In the below example screenshot, notice that the bytes for diagjobs (prefixed by DJ_) are either empty or useless 00s.

image

The script interpreter/vm is fairly complex and difficult to implement correctly, so at this time, this project does not have the ability to execute scripts. This means that out of the box, Caesar/Diogenes does not have the ability to generate seed keys. Instead, this task is deferred to UnlockECU, where many algos are reverse-engineered and re-implemented.

*The official tools (e.g. DTS/Vedi) naturally have no difficulties in executing those scripts, so they do not need an additional ECU unlocking tool.

KT819GM commented 2 years ago

Hello, Thank you for an explanation, couldn't be written more clearly.