How to correct checksum when it resides within checked data?
Moderators: Mangus, robertisaar, dex
How to correct checksum when it resides within checked data?
My bin has a checksum value that resides within the checked data. When updating the checksum, the changed checksum value changes the sum of the checked block of data. This makes the checksum invalid. The default checksum plugin just chases its tail trying to update the checksum which invalidates itself every time its updated. Is there a formula to apply to a checksum so that it will account for itself in the checked data?
Re: How to correct checksum when it resides within checked data?
How is the checksum calculated and are there any ROM addresses outside of the checksum range?
Re: How to correct checksum when it resides within checked data?
The entire eprom is summed as 8 bits into a 16 bit checksum. At least thats what I think is happening. Using HxD and selecting the checksum-16 algorithim option, its dead nuts on for every OE rom I have.
Re: How to correct checksum when it resides within checked data?
Have you tried setting the checksum to zero before calculating the checksum?
Re: How to correct checksum when it resides within checked data?
Yes. That was my first instinct. It made me realize you can't simply sum a block of data if the checksum is within the data. There must be a formula that can account for it but the terms are too general for google to be of any help.
On the up side, finding that the checksum sums the whole eprom seems more than very likely that the ECU doesn't care about it. There's no way that a processor that's frugal about accomplishing tasks with the least clock cycles is going to drop everything to count every byte in the eprom. I've run this module with an uncorrected checksum with no apparent ill effects. It would be nice though to figure this out, if for nothing more than personal satisfaction.
On the up side, finding that the checksum sums the whole eprom seems more than very likely that the ECU doesn't care about it. There's no way that a processor that's frugal about accomplishing tasks with the least clock cycles is going to drop everything to count every byte in the eprom. I've run this module with an uncorrected checksum with no apparent ill effects. It would be nice though to figure this out, if for nothing more than personal satisfaction.
Re: How to correct checksum when it resides within checked data?
It depends on how the checksum is calculated as to whether it can be within the data range being summed. You need to find out what the checksum algorithm is to see if it can be replicated in the definition.