PDA

View Full Version : km - hex conversion on Land Rover Discovery 2 dashboard



AdrianSuki
10th December, 2024, 01:18 PM
Good morning to all.


I'm practicing with a dashboard from a junkyard Discovery 2 (The original one from my car I still don't touch it for fear).


I would like to learn how I can do the conversion from hex to kilometers and kilometers to hex.


I have been reading the forum and I have seen some information notes, but they always end up solving the doubts by sending a modified binary.


I'm using a binary that I got from this forum but I can't figure out how to get from point A to point B.

(attached is an image of the binary opened with the GQ-4x4 software).

1060679

As I read in the same thread, the equivalence between km/hex is as follows:

"250.175 to hex is 03 D1 3F"

I do not understand how this data can be obtained, nor how to find it in the binary.

This is the thread where this topic is discussed:

https://www.digital-kaos.co.uk/forums/showthread.php/765023-Discovery-2-blinking-mileage

I would appreciate any kind of information or training in this regard.


Thank you very much for your time and sorry for the translation, as I use DeepL.


Best regards.

jomberykaso
10th December, 2024, 04:56 PM
Hi, to understand this "250.175 to hex is 03 D1 3F" first you will need a calculator in "programmer mode" (you can use a phone app or windows calculator)

put in Decimal 250175 then convert to hexadecimal and you will see 03 D1 3F

AdrianSuki
10th December, 2024, 05:41 PM
Hi, to understand this "250.175 to hex is 03 D1 3F" first you will need a calculator in "programmer mode" (you can use a phone app or windows calculator)

put in Decimal 250175 then convert to hexadecimal and you will see 03 D1 3F

Hi jomberykaso!


Thanks for your reply!


Ok, I've learned this part. I don't understand why I haven't seen it before. The conversion from km to hex is at least clear to me now.


How do I now search for 03 D1 3F in the binary?

jomberykaso
10th December, 2024, 05:50 PM
with this software, open file, press F3 , put the code you are searching for...press ENTER, then press F3 to search for the next position of the codes

AdrianSuki
10th December, 2024, 06:04 PM
with this software, open file, press F3 , put the code you are searching for...press ENTER, then press F3 to search for the next position of the codes

Thanks again for such a quick reply!


Thanks for the SW, it will be very useful!


But I can't find 03 D1 3F in the binary. Theoretically (or at least that's how I understood it in the other post) in the .bin that I attached, it should show 250175 km which in hex is = "03 D1 3F". I search for it with HexCmp and it doesn't find the hex string. What am I doing wrong?


Thank you very much for your time and dedication.

jomberykaso
10th December, 2024, 07:23 PM
your file uses different algorithm, that file is not decimal to hex , this code "84 1E 7B E1" is repeated 16 times in your file.

841E : is the result of kms in decimal divided *32 with bytes swapped

7BE1: is the result of 841E xor FFFF

AdrianSuki
11th December, 2024, 09:08 AM
your file uses different algorithm, that file is not decimal to hex , this code "84 1E 7B E1" is repeated 16 times in your file.

841E : is the result of kms in decimal divided *32 with bytes swapped

7BE1: is the result of 841E xor FFFF

OMG! The light came!!


I finally understood how to do it!


The problem came from the root, I was comparing information from a binary with a binary that did not correspond to that information!


So simple and at the same time so stupid!


There is one last question, why 32?


I'm making a small guide to collaborate with the forum and when writing the steps, the 32 squeaks in my mind. Where do you get that the number 32 is for division or multiplication?


Thank you very much for your patience!!!