A CRC calculation itself is not tricky, you can use one of the many available example
implementations. The ECU uses exactly the standardized CRC32 algorithm.
What is tricky, is to figure out which starting values for crc calculation the ecu uses and for
which data areas crc's get calculated. These things are NOT stored in tables,
you will have to look up these details in the code
.
Look at the table at address 81'E76A in the M-box image, it is just the standard CRC32
table with 256 entries. Exactly the same table you would use when you implement a table
driven crc32 calculation algorithm on your PC. This table does not contain information about
the data areas of the ecu that are protected with crc32.
The address of the table itself also does not reveal the ranges of data that the ecu verifies
against crc32 checksum(s).
You can find an implementation of the table driven CRC32 algorithm in the ecu code,
e.g. for the M-box this function starts at address 87'A94A. It has input parameters
R14=number_of_bytes and R13,R12=bufferaddress.
It takes the last calculated CRC32 value from memory and returns the updated checksum
in R5,R4. It is just a general checksum function which updates a crc32 for a block of
memory. Which memory blocks get summed up in total you will only find when inspecting
the code that calls this function.