BGNG
New member
I have an anonymous file that may or may not be related to ROMs and may or may not have anything to do with Nintendo DS. In said file, there is a header with three fields for checksums. The checksums are calculated with the CRC16 algorithm, or so I believe.
The first checksum is calculated on data later in the file, but the second checksum is calculated off of the header; including the pre-calculated value of the first checksum. For example:
File size: 10 bytes
Checksum 1: Bytes 8 to 10 -> Store in bytes 2 to 3
Checksum 2: Bytes 1 to 6
As you can see, Checksum 2 is calculated using the checksum previously calculated for Checksum 1.
__________
Thing is, though... I can calculate Checksum 2 correctly, which is based off of the values of Checksum 1, but I can't calculate Checksum 1 correctly.
The documentation I have says that bytes 0x4000 to 0x7FFF are used for Checksum 1, but I can't seem to get it to work. The same algorithm, however, correctly calculates Checksum 2 and Checksum 3.
I've attached the region of the anonymous file from 0x4000 to 0x7FFF. The checksum in the file's header is 0xCAC3, but when I calculate it, I keep getting 0x8582.
Anyone able to help?
The first checksum is calculated on data later in the file, but the second checksum is calculated off of the header; including the pre-calculated value of the first checksum. For example:
File size: 10 bytes
Checksum 1: Bytes 8 to 10 -> Store in bytes 2 to 3
Checksum 2: Bytes 1 to 6
As you can see, Checksum 2 is calculated using the checksum previously calculated for Checksum 1.
__________
Thing is, though... I can calculate Checksum 2 correctly, which is based off of the values of Checksum 1, but I can't calculate Checksum 1 correctly.
The documentation I have says that bytes 0x4000 to 0x7FFF are used for Checksum 1, but I can't seem to get it to work. The same algorithm, however, correctly calculates Checksum 2 and Checksum 3.
I've attached the region of the anonymous file from 0x4000 to 0x7FFF. The checksum in the file's header is 0xCAC3, but when I calculate it, I keep getting 0x8582.
Anyone able to help?