I need small app (and src) for finding typical checksums in binary file.
1. The program opens the binary file and displays it by showing bytes in the hexadecimal notation, 16 bytes in a line, at the beginning of the line the address of the line.
2. the program initially determines the length of the binary file and the maximum address.
3. The program asks you to enter the search range of the checksum: the address of the first byte and the address of the last. The last one can not be larger than the specified file length. It might be even as field to enter start and end manually.
4. The program asks you to enter the value of the checksum you are looking for
5. The program asks you to choose the type of checksum, only 16-bit interest, just plain CRC-16, select from the combi field (first version crc16 other in future with diff checksums as update)
6. The program takes the first byte of the range to the first + 1 counts the sum and compares it with the value sought, if there is no match, takes the first byte to the first + 2 until it reaches the end address. If it is not found, it takes the first + 1 for the first byte and counts to the last, then the first + 2 to the last, etc.
It is also advisable to search from the end, that is, take the last byte as the last and the first as the last -1, -2, etc. Search direction option: down / up, selectable by indicator.
The program is to enable further search, if the result is accidentally correct: to ask: "I found such a sum in such a scope, or look further?"
We have an example:
The sum of CRC-16 with the value AD7D is in the address $ 425C and 425D, just here in the record BA, the sum relates to the range $ 4240-425B. The program after entering the sum value (AD 7D) and the range of search addresses, e.g. $ 4200-42FF, as the result is to give the range of $ 4240-425B