jglim / CaesarSuite

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

UDS Hex Editor #16

Open jglim opened 3 years ago

jglim commented 3 years ago

Feature request from @Feezex ( https://github.com/jglim/CaesarSuite/issues/13#issuecomment-752758616 ) to add a hex editor that uses UDS ReadDataByIdentifier and WriteDataByIdentifier.

jglim commented 3 years ago

@Feezex This is an experimental build that implements the UDS hex editor. Again, the target must first be unlocked to correctly read its memory. CaesarSuite_dbg_2020-12-31-A.zip

I have tried it briefly with my CRD3; I am pleasantly surprised that the read command works out of the box, although I am unable to verify if the write command works, since the CRD3 rejects it. I have attached my logs below, in case I was sending the wrong commands:

7cJvGxwQom

This region A001C000 was selected from a related CFF file:

Diogenes_UT87NYQYCg

W 10 03
R 50 03 00 14 00 C8
W 22 F1 00
R 62 F1 00 02 21 31 03
W 3E 00
R 7E 00
W 27 0B
R 67 0B 52 8E 89 C3
W 27 0C BA B1 BB 3D
R 67 0C
W 3E 00
R 7E 00
W 3E 00
R 7E 00
W 3E 00
R 7E 00
W 23 14 A0 01 C0 00 10
R 63 43 52 44 33 2D 36 35 31 2D 57 4D 49 37 37 44 31
W 23 14 A0 01 C0 10 10
R 63 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
W 23 14 A0 01 C0 20 10
R 63 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
W 23 14 A0 01 C0 30 10
R 63 36 35 31 39 30 33 31 34 33 31 0D 2B 01 22 00 40
W 23 14 A0 01 C0 40 10
R 63 00 30 5E 02 21 31 00 58 07 FF 57 4D 49 37 37 00
W 23 14 A0 01 C0 50 10
R 63 3E F8 0C FD 88 C0 01 A0 FF FF 0F A0 FF FF FF FF
W 23 14 A0 01 C0 60 10
R 63 FF FF FF FF FF FF FF FF FF FF FF FF 56 6A 0C 00
W 23 14 A0 01 C0 70 10
R 63 3C 9B 04 A0 7C D6 04 A0 FF FF FF FF FF FF FF FF
W 23 14 A0 01 C0 80 10
R 63 FF FF FF FF FF FF FF FF 00 28 00 28 00 28 00 28
W 23 14 A0 01 C0 90 10
R 63 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00
W 23 14 A0 01 C0 A0 10
R 63 00 00 00 00 00 28 00 28 00 00 00 00 00 00 00 00
W 23 14 A0 01 C0 B0 10
R 63 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
W 23 14 A0 01 C0 C0 10
R 63 00 08 00 08 00 00 00 00 00 00 00 00 00 00 00 00
W 23 14 A0 01 C0 D0 10
R 63 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00
W 23 14 A0 01 C0 E0 10
R 63 00 00 00 00 80 00 00 00 00 00 00 00 FF FF F7 FD
W 23 14 A0 01 C0 F0 10
R 63 00 00 00 00 00 00 FF 00 FF FF FF FF FF FF FF FF
W 3E 00
R 7E 00
W 3E 00
R 7E 00
W 3E 00
R 7E 00
W 3E 00
R 7E 00
W 3D 14 A0 01 C0 00 10 43 52 44 33 2D 31 32 33 2D 57 4D 49 37 37 44 31
R 7F 3D 31
W 3D 14 A0 01 C0 30 10 36 35 31 39 39 39 39 34 33 31 0D 2B 01 22 00 40
R 7F 3D 31
W 3E 00
R 7E 00
W 3E 00
R 7E 00
W 3E 00
R 7E 00
N0cynym commented 3 years ago

Wow this is amazing! I never thought that it would be able to realize this so quickly 👍

@jglim thanks for your hard work you're a big game changer! Hope you will have a good start into the new year.

Feezex commented 3 years ago

I wish this New Year Less sadness and worries More happiness and kindness, Smiles, tenderness, warmth!

To have faithful friends like a very friendly family, To make every day successful And to have enough strength for everything!

Well, also let the New Year Will bring more money Health, peace and love, So that there is no winter in the heart!

Feezex commented 3 years ago

I there a way to make it work for kw2c3pe? in video it been working over kwp. In my case it can be very useful

jglim commented 3 years ago

I loosened the UDS check, it will only warn you about the protocol mismatch, and continue to run. This assumes that your target ECU understands UDS ReadDataByIdentifier and WriteDataByIdentifier.

Available now in v1.4.6

jglim commented 3 years ago

@Feezex Whenever you try out the memory editor, please let me know if it works (so that I can close this issue), or if there is an issue (I will try to resolve it). Also, thanks for your notes on the bench setup :^)

WSorban commented 3 years ago

A very cool feature I thought about, and implemented the other day, was to simply select hex addresses, and generate and execute the UDS commands, for those memory segments, like so: image

I can contribute to your project, with such a feature, if you want

jglim commented 3 years ago

Thanks for the feedback, that is indeed a cool feature and it would be great to receive your contribution.

I took a quick peek at the referenced (third party) hexbox library, and it has SelectionStart and SelectionLength values. The function btnWrite_Click in UDSHexEditor.cs handles diffing and writing, and it might be a good place to work with (clamp the working memory range).

WSorban commented 3 years ago

BE HexBox is indeed a very very well made library, although I found that there is little documentation, and little talk from people, on social platforms, I had to figure everything myself. It wasn't a hard thing, though, as they also provide an example program, that implements mostly all functionalities.

Feezex commented 1 year ago

Noticed that progress bar can be sized fullscreen if doubleclick header.. Small fix needed

        loader.Resize = false;   

or similar

jglim commented 1 year ago

That's a feature for monitoring the progress while you are standing at the other end of your workshop ))

But yes, I'll take note to relook at that. It is configured as a FixedToolWindow which I assumed to behave like a FixedSingle (which doesn't resize).