View Full Version : who can explain hex calculations in fine detail
martiboy
7th August, 2010, 07:21 PM
Im looking for a little help in hex calculations. I have tried to understand it but cant get the answer i need. i have loads of tools to do it for me but would like to understand how its done. This post may even help others to understand. im going to use an opel vectra as an example.
Car type: Opel Vectra C - 93c66 - 2002-2006 years
The mileage is stored in the next lines:
01F0: FD CA FD CA FD CA FD CA FD CA FD CA FD CA FD CA
where the next bytes:
E7 95 - is a mileage (this is 100000km)
I have used 100000 as an example. lets say its going to 81234km. How would you calculate this. Is there any sort of number that you will take a base from and count from there.
z786
7th August, 2010, 07:38 PM
the only 1 to answer that is none other than PremierD
and when he does, pay close attention cos you'l need it
drpeter
7th August, 2010, 07:58 PM
Im looking for a little help in hex calculations. I have tried to understand it but cant get the answer i need. i have loads of tools to do it for me but would like to understand how its done. This post may even help others to understand. im going to use an opel vectra as an example.
Car type: Opel Vectra C - 93c66 - 2002-2006 years
The mileage is stored in the next lines:
01F0: FD CA FD CA FD CA FD CA FD CA FD CA FD CA FD CA
where the next bytes:
E7 95 - is a mileage (this is 100000km)
I have used 100000 as an example. lets say its going to 81234km. How would you calculate this. Is there any sort of number that you will take a base from and count from there.
100000/16= 6250 = HEX 186A XOR FFFF = E795
81234/16 = 507775 HEX 13D5 XOR FFFF = EC2A
Life is simple :-)
z786
7th August, 2010, 08:08 PM
i dont understand this bit
"HEX 186A XOR FFFF"
martiboy
7th August, 2010, 08:13 PM
100000/16= 6250 = HEX 186A XOR FFFF = E795
81234/16 = 507775 HEX 13D5 XOR FFFF = EC2A
Life is simple :-)
Thank you drpeter. With windows cal i can get 100000/16= 186a. But what does xor ffff mean. Thanks for helping
PremierD
7th August, 2010, 08:16 PM
Thank you drpeter. With windows cal i can get 100000/16= 186a. But what does xor ffff mean. Thanks for helping
It means subtract from FF FF mate ... simple ...:rock:
drpeter
7th August, 2010, 08:21 PM
Thank you drpeter. With windows cal i can get 100000/16= 186a. But what does xor ffff mean. Thanks for helping
Premier tought me this :rock:, If you do this every day you recognise most algo's. start scientific calculator choose Xor and fill in ffff. Xor is same as FFFF - HEX value so
FFFF - 186A = E795
martiboy
7th August, 2010, 08:27 PM
Premier tought me this :rock:, If you do this every day you recognise most algo's. start scientific calculator choose Xor and fill in ffff. Xor is same as FFFF - HEX value so
FFFF - 186A = E795
Ah now i see it. 1 more thing (sorry to bug you). When you have done a cal how do you know when to change the bytes (swap bytes).
drpeter
7th August, 2010, 09:50 PM
Ah now i see it. 1 more thing (sorry to bug you). When you have done a cal how do you know when to change the bytes (swap bytes).
Simple if you see 95E7 you know that the bytes are swapped, just practise a lot you will recognise.
If you make a script and you load a dump, if the reading is not okay, swap the bytes and the reading will be fine. Then you save the dump swapped. The best way is to read chips with the same programmer, and write a script for the same programmer, bytes will never be swapped then. But thats not possible because I make script from dumps posted on this forum also, bytes can be swapped then because members don't use all the same programmer. You must always be aware that bytes can be swapped. NYO implemented a swap function for that.
dimitar
7th August, 2010, 09:56 PM
Ah now i see it. 1 more thing (sorry to bug you). When you have done a cal how do you know when to change the bytes (swap bytes).
Calculate the original mileage and you will find out if you need to swap bytes
vageric
8th August, 2010, 07:14 AM
is it always km / 16 ?
martiboy
8th August, 2010, 10:25 AM
Simple if you see 95E7 you know that the bytes are swapped, just practise a lot you will recognise.
If you make a script and you load a dump, if the reading is not okay, swap the bytes and the reading will be fine. Then you save the dump swapped. The best way is to read chips with the same programmer, and write a script for the same programmer, bytes will never be swapped then. But thats not possible because I make script from dumps posted on this forum also, bytes can be swapped then because members don't use all the same programmer. You must always be aware that bytes can be swapped. NYO implemented a swap function for that.
Thanks for your help again drpeter. I think i understand things alot better now.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.