在 CRC-8 逆向工程方面需要帮助

Needing help on CRC-8 reverse engineering

我收到以下消息:

|pref|data                                  |cs|post|
|----|--------------------------------------|--|----|
|1002|00070080000000000000000000000000000000|87|10fe|
|1002|000700000c0000000000000000000000000000|19|10fe|
|1002|00070081000000000000000000000000000000|86|10fe|
|1002|00070001010000000000000000000000000000|15|10fe|
|1002|00070082000000000000000000000000000000|85|10fe|
|1002|00070005b00000000000000000000000000000|a0|10fe|
|1002|00070083000000000000000000000000000000|84|10fe|
|1002|000700b0140000000000000000000000000000|b1|10fe|
|1002|00070084000000000000000000000000000000|83|10fe|
|1002|00070000000000000000000000000000000000|15|10fe|
|1002|00070085000000000000000000000000000000|82|10fe|
|1002|00070000000000000000000000000000000000|15|10fe|
|1002|00070086000000000000000000000000000000|81|10fe|
|1002|00070000010000000000000000000000000000|14|10fe|
|1002|00070087000000000000000000000000000000|80|10fe|
|1002|00070000000000000000000000000000000000|15|10fe|
|1002|00070088000000000000000000000000000000|8f|10fe|
|1002|00070000000000000000000000000000000000|15|10fe|
|1002|00070089000000000000000000000000000000|8e|10fe|
|1002|00070000000000000000000000000000000000|15|10fe|
|1002|0007008a000000000000000000000000000000|8d|10fe|
|1002|00070000000000000000000000000000000000|15|10fe|
|1002|0007008b000000000000000000000000000000|8c|10fe|
|1002|000700979d0000000000000000000000000000|1f|10fe|
|1002|00050300000000000000000000000000000000|06|10fe|
|1002|000503044b0000000000000000000000000000|5b|10fe|
|1002|00ff000000ff01000000000000000000000002|11|10fe|
  1. 所有基于 16(十六进制)的数字
  2. pref 总是 1002 消息开头
  3. cs 可能是 8 位校验和
  4. post 总是 10fe 消息结束

我的问题是“如何计算校验和?”


马克向我详细介绍了解决方案。 我写了一个小测试代码,让 Marks algorithmus 计算了很多消息的校验和。我几乎得到 12h,但有时得到 00h。

你能找出原因吗?

    #include <stdio.h>

const unsigned char data[172][20] = {
    {0x01,0xf6,0x60,0x00,0x1e,0xb0,0x0f,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0xcb},
    {0x00,0xff,0x00,0x51,0x00,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x40},
    {0x01,0xf8,0x19,0xad,0x89,0x1d,0xd9,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x9d},
    {0x01,0xf8,0x99,0xbd,0x85,0x81,0x01,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x25},
    {0x01,0xf9,0x98,0x71,0x35,0x41,0x3f,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0xc7},
    {0x01,0xfa,0x98,0x4c,0x01,0x71,0xc9,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x6b},
    {0x01,0xfb,0x18,0x00,0x01,0x36,0xcb,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x83},
    {0x01,0xf8,0x1b,0xad,0xf0,0x5c,0x57,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x49},
    {0x01,0xf8,0x9b,0xbd,0x0c,0x3a,0x45,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x31},
    {0x01,0xf9,0x1b,0xa6,0x38,0x42,0x27,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0xe5},
    {0x01,0xf9,0x9a,0x71,0x3c,0x23,0xe7,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x76},
    {0x01,0xfa,0x1b,0x94,0x00,0x82,0x63,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x68},
    {0x01,0xfa,0x9a,0x4c,0x00,0x88,0xbb,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x83},
    {0x01,0xfb,0x1a,0x00,0x00,0xcf,0xb9,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x6b},
    {0x01,0xfb,0x9a,0x6c,0x00,0x1d,0xf5,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x79},
    {0x01,0xf8,0x1d,0xac,0x4c,0xc2,0xb7,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x8c},
    {0x01,0xf9,0x1d,0xa6,0x3c,0xe9,0x63,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x68},
    {0x01,0xfa,0x1d,0x94,0x00,0xa1,0x6b,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x45},
    {0x01,0xfa,0x9c,0x4c,0x00,0xab,0xb3,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0xae},
    {0x01,0xfb,0x9c,0x6c,0x00,0x3e,0xfd,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x34},
    {0x01,0xf6,0x20,0x6c,0x00,0x38,0x43,0x1e,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x3c},
    {0x00,0xff,0x00,0x53,0x00,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x42},
    {0x01,0xf6,0x00,0x6c,0x00,0x7c,0x65,0x1e,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x7e},
    {0x01,0xe0,0x78,0x00,0x00,0x3c,0x61,0x2d,0xd0,0x00,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0x0a},
    {0x00,0xff,0x00,0x53,0x00,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x02,0xc2},
    {0x00,0xff,0x00,0x53,0x00,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x02,0xc2},
    {0x01,0xa0,0x78,0x00,0x02,0x00,0x00,0xb3,0x7b,0x87,0x87,0x87,0x7b,0x22,0x00,0x00,0x00,0x00,0x00,0xdf},
    {0x01,0x60,0xb8,0x00,0x00,0xc0,0x3c,0x1b,0xd0,0x00,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0xdd},
    {0x01,0x60,0xb8,0x00,0x00,0xc1,0xb7,0x29,0x7f,0xc2,0xaf,0x7f,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0xd8},
    {0x01,0xf0,0x20,0x00,0x00,0x20,0x80,0x00,0x00,0x11,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x4a},
    {0x01,0xf2,0x00,0x00,0x00,0x41,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18},
    {0x01,0xf0,0x20,0x00,0x00,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x3b},
    {0x01,0xf2,0x00,0x00,0x00,0x21,0x80,0x00,0x00,0x11,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x69},
    {0x01,0xf0,0x20,0x00,0x00,0x20,0x81,0x00,0x00,0x02,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x59},
    {0x01,0xf2,0x00,0x00,0x00,0x41,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x19},
    {0x01,0xf0,0x20,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x34},
    {0x01,0xf2,0x00,0x00,0x00,0x21,0x8f,0x00,0x00,0x62,0xa2,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0xb7},
    {0x01,0xf0,0x20,0x1e,0x1e,0x20,0x81,0x00,0x00,0x03,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x58},
    {0x01,0xf2,0x00,0x00,0x00,0x41,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x19},
    {0x01,0xf0,0x20,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x34},
    {0x01,0xf2,0x00,0x00,0x00,0x21,0x8f,0x00,0x00,0xf5,0x7c,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0xfe},
    {0x01,0xf0,0x20,0x1e,0x1e,0x20,0x81,0x00,0x00,0x08,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x53},
    {0x01,0xf0,0x20,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x34},
    {0x01,0xf2,0x00,0x00,0x00,0x21,0x8f,0x00,0x00,0x06,0x23,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x52},
    {0x01,0xf0,0x20,0x1e,0x1e,0x20,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x5b},
    {0x01,0xf2,0x00,0x00,0x00,0x41,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18},
    {0x00,0xff,0x00,0x53,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x80,0x00,0x00,0x00,0x02,0x3e},
    {0x01,0x60,0xb8,0x02,0x00,0x02,0x1c,0x19,0x00,0x00,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0xef},
    {0x01,0x60,0xb8,0x02,0x00,0x03,0x97,0x2b,0x7f,0x00,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0x28},
    {0x01,0xf2,0x00,0x02,0x00,0x42,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x19},
    {0x01,0xf0,0x40,0x02,0x00,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x59},
    {0x01,0xf2,0x00,0x02,0x00,0x22,0x80,0x00,0x00,0x12,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x6b},
    {0x01,0xf0,0x40,0x02,0x00,0x20,0x81,0x00,0x00,0x06,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x3f},
    {0x01,0xf2,0x00,0x02,0x00,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
    {0x01,0xf2,0x00,0x02,0x00,0x22,0x8f,0x00,0x00,0x92,0xf2,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x16},
    {0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x02,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x38},
    {0x01,0xf2,0x00,0x02,0x00,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
    {0x01,0xf2,0x00,0x02,0x00,0x22,0x8f,0x00,0x00,0x3b,0xf7,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0xba},
    {0x01,0xf2,0x00,0x02,0x00,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
    {0x01,0xf2,0x00,0x02,0x00,0x22,0x8f,0x00,0x00,0x06,0x23,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x53},
    {0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x0a,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x31},
    {0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
    {0x01,0xf0,0x40,0x02,0x00,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x56},
    {0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0x55,0x35,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x14},
    {0x01,0xf0,0x40,0x02,0x00,0x20,0x81,0x00,0x00,0x03,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x3b},
    {0x01,0xf2,0x00,0x02,0x00,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8c,0x00,0x00,0x04,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x53},
    {0x01,0xf2,0x00,0x02,0x00,0x22,0x8c,0x00,0x00,0xf6,0xff,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x7d},
    {0x01,0xf0,0x40,0x1e,0x1e,0x20,0x85,0x00,0x00,0x08,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x36},
    {0x01,0xf2,0x00,0x02,0x00,0x42,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1c},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8c,0x00,0x00,0x04,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x53},
    {0x01,0xf2,0x00,0x02,0x00,0x22,0x8c,0x00,0x00,0x07,0x04,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x76},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8c,0x00,0x00,0x01,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x56},
    {0x01,0xf2,0x00,0x02,0x00,0x22,0x8c,0x00,0x00,0x02,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x77},
    {0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x0a,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x31},
    {0x01,0xf2,0x00,0x02,0x00,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8a,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x51},
    {0x01,0xf2,0x00,0x02,0x00,0x22,0x8a,0x00,0x00,0x20,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x53},
    {0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x0b,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x30},
    {0x00,0xff,0x00,0x53,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x02,0x3c},
    {0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
    {0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0xa7,0xce,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1d},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8a,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x51},
    {0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x19,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x22},
    {0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
    {0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0xaf,0xac,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x77},
    {0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x0c,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x37},
    {0x00,0xff,0x00,0x53,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x02,0x3c},
    {0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
    {0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0xba,0xa5,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x6b},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8a,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x51},
    {0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8a,0x00,0x00,0x20,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x51},
    {0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x0d,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x36},
    {0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
    {0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0x05,0x28,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x59},
    {0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x13,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x28},
    {0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
    {0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0xee,0xd8,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x42},
    {0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x0e,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x35},
    {0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
    {0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0x0f,0xe1,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x9a},
    {0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x14,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x2f},
    {0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
    {0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0x81,0x3b,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0xce},
    {0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x11,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x2a},
    {0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
    {0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0xbc,0xa9,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x61},
    {0x01,0xf0,0x40,0x1e,0x1e,0x20,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x3b},
    {0x01,0xf2,0x00,0x1e,0x1e,0x42,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1b},
    {0x01,0xf0,0x40,0x1e,0x1e,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x9b},
    {0x01,0xf2,0x00,0x1e,0x1e,0x22,0x40,0x00,0x00,0x00,0x00,0x7f,0xff,0x38,0x00,0x00,0x00,0x00,0x00,0x3b},
    {0x01,0xf2,0x00,0x1e,0x1e,0x22,0x50,0x00,0x00,0x7f,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0xd4},
    {0x01,0x60,0xb8,0x00,0x00,0xc0,0x3c,0x1b,0x02,0x19,0xc1,0x7f,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0xa8},
    {0x01,0xa1,0x98,0x00,0x00,0x00,0x00,0x62,0x9b,0x2f,0xe9,0x7f,0x7b,0x22,0x00,0x00,0x00,0x00,0x00,0x33},
    {0x01,0xe1,0x98,0x00,0x08,0x97,0x33,0x14,0x00,0x0f,0x59,0x07,0x00,0x28,0x00,0x00,0x00,0x00,0x00,0xab},
    {0x01,0xe0,0x78,0x00,0x00,0x3c,0x61,0x2d,0x9b,0x2f,0xe9,0x7f,0x7b,0x21,0x00,0x00,0x00,0x00,0x00,0x83},
    {0x00,0xff,0x00,0x53,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x00,0x02,0x3c},
    {0x00,0x04,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06},
    {0x01,0x60,0xb8,0x02,0x00,0x03,0x97,0x2b,0x3c,0x03,0x16,0xb3,0xd1,0x21,0x00,0x00,0x00,0x00,0x00,0x1c},
    {0x01,0x60,0xb8,0x00,0x00,0xc1,0xb7,0x29,0x7f,0x87,0x87,0x87,0x7b,0x21,0x00,0x00,0x00,0x00,0x00,0x36},
    {0x01,0xa0,0x78,0x00,0x02,0x00,0x00,0xb3,0x7b,0x87,0x87,0x87,0x7b,0x22,0x00,0x00,0x00,0x00,0x00,0xdf},
    {0x00,0xff,0x00,0x01,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x02,0x6c},
    {0x00,0x04,0x03,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05},
    {0x01,0xa1,0x98,0x00,0x00,0x00,0x00,0x62,0x9b,0x87,0x87,0x87,0x7b,0x22,0x00,0x00,0x00,0x00,0x00,0x0d},
    {0x01,0xf1,0xe0,0x00,0x00,0x20,0x80,0x00,0x00,0x1f,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xa7},
    {0x01,0xf2,0x00,0x00,0x00,0x4f,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x16},
    {0x01,0xf1,0xe0,0x00,0x00,0x20,0x81,0x00,0x00,0x03,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xba},
    {0x01,0xf2,0x00,0x02,0x00,0x4f,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x15},
    {0x01,0xe1,0x38,0x1e,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4},
    {0x01,0xf1,0xe0,0x00,0x00,0x40,0x89,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xd1},
    {0x01,0xf2,0x00,0x1e,0x02,0x2f,0x89,0x00,0x00,0x01,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x62},
    {0x01,0xf1,0xe0,0x00,0x00,0x20,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xbc},
    {0x01,0xf2,0x00,0x1e,0x1e,0x4f,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x12},
    {0x01,0xf1,0xe0,0x00,0x00,0x40,0x86,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xde},
    {0x01,0xf2,0x00,0x1e,0x02,0x2f,0x86,0x00,0x00,0x0d,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x61},
    {0x01,0xf1,0xe0,0x00,0x00,0x20,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xbd},
    {0x00,0xff,0x00,0x01,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x02,0x6e},
    {0x01,0xf2,0x00,0x02,0x02,0x4f,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x13},
    {0x01,0xf1,0xe0,0x00,0x00,0x50,0x8c,0x00,0x00,0x0d,0x00,0x00,0x40,0x08,0x00,0x00,0x00,0x00,0x00,0x89},
    {0x01,0xf2,0x00,0x1e,0x02,0x0f,0x8c,0x00,0x00,0x0d,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x4b},
    {0x01,0xf2,0x1c,0x00,0x02,0xf6,0xff,0x01,0x00,0x01,0x07,0xf2,0xff,0x38,0x00,0x00,0x00,0x00,0x00,0xc4},
    {0x01,0xf2,0x1e,0x00,0x04,0x07,0x04,0x00,0x00,0x02,0x1b,0x1d,0x00,0x35,0x00,0x00,0x00,0x00,0x00,0xc9},
    {0x01,0xf1,0xfe,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a},
    {0x01,0xf2,0x00,0x00,0x04,0x8f,0x8c,0x00,0x00,0xe8,0x2c,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
    {0x01,0xf1,0xe0,0x00,0x00,0x80,0x8c,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x14},
    {0x01,0xf1,0xe0,0x00,0x00,0x40,0x8a,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xd2},
    {0x01,0xf2,0x00,0x02,0x02,0x2f,0x8a,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x7c},
    {0x01,0xf1,0xe0,0x00,0x00,0x40,0x8b,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xd3},
    {0x01,0xf2,0x00,0x00,0x04,0x2f,0x8b,0x00,0x00,0x75,0x4d,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x41},
    {0x01,0xf1,0xe0,0x00,0x00,0x20,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xb8},
    {0x01,0xf2,0x00,0x02,0x02,0x4f,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x16},
    {0x01,0xf1,0xe0,0x00,0x00,0x40,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x10},
    {0x01,0xf2,0x00,0x02,0x02,0x2f,0x48,0x00,0x00,0x03,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0xbd},
    {0x00,0x04,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06},
    {0x00,0xff,0x00,0x01,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x02,0x6d},
    {0x01,0x60,0xd8,0x02,0x02,0x03,0x01,0x01,0xa5,0x25,0x00,0x00,0x00,0x23,0x00,0x00,0x00,0x00,0x00,0x0b},
    {0x01,0xa1,0x98,0x00,0x00,0x00,0x00,0x62,0x9b,0x87,0x7f,0x87,0x7b,0x22,0x00,0x00,0x00,0x00,0x00,0xf5},
    {0x01,0x60,0xb8,0x02,0x00,0x02,0x1c,0x19,0x9b,0x87,0x7f,0x87,0x7b,0x21,0x00,0x00,0x00,0x00,0x00,0x70},
    {0x01,0x60,0xd8,0x02,0x02,0x02,0x01,0x01,0x45,0x0d,0x00,0x00,0x00,0x23,0x00,0x00,0x00,0x00,0x00,0xc2},
    {0x01,0x60,0xd8,0x02,0x02,0x05,0x01,0x01,0x78,0x83,0x00,0x00,0x00,0x23,0x00,0x00,0x00,0x00,0x00,0x76},
    {0x01,0xa0,0x78,0x00,0x02,0x00,0x00,0xb3,0x7b,0x83,0x00,0x00,0x00,0x22,0x00,0x00,0x00,0x00,0x00,0xa0}
};

int main(int argc, char **argv)
{
    puts("Mark Adler has said ...");
    for(int row=0;row<172;row++)
    { 
        const unsigned char *prow = data[row];
        unsigned char s = 0;
        for(int col=0;col<20;col++)
        {
            s ^= prow[col];
            printf("%02x ",prow[col]);
        }
        printf(" ==> %02x\n",s);
    }
    return 0;
}

结果

[juergen@nadhh ~]$ ./xor12 
Mark Adler has said ...
01 f6 60 00 1e b0 0f 7f 10 0a d5 7f 00 20 00 00 00 00 00 cb  ==> 12
00 ff 00 53 02 00 01 00 00 00 00 00 00 03 80 00 00 00 02 3c  ==> 12
00 04 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06  ==> 00
01 60 b8 02 00 03 97 2b 3c 03 16 b3 d1 21 00 00 00 00 00 1c  ==> 12
01 60 b8 00 00 c1 b7 29 7f 87 87 87 7b 21 00 00 00 00 00 36  ==> 12
01 a0 78 00 02 00 00 b3 7b 87 87 87 7b 22 00 00 00 00 00 df  ==> 12
00 ff 00 01 02 00 01 00 00 00 00 00 00 01 80 00 00 00 02 6c  ==> 12
00 04 03 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ==> 00
01 a1 98 00 00 00 00 62 9b 87 87 87 7b 22 00 00 00 00 00 0d  ==> 12
01 f1 e0 00 00 20 80 00 00 1f 00 00 00 08 00 00 00 00 00 a7  ==> 00
01 f2 00 00 00 4f 80 00 00 00 00 00 00 38 00 00 00 00 00 16  ==> 12
01 f1 e0 00 00 20 81 00 00 03 00 00 00 08 00 00 00 00 00 ba  ==> 00
01 f2 00 02 00 4f 81 00 00 00 00 00 00 38 00 00 00 00 00 15  ==> 12
01 e1 38 1e 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 c4  ==> 00
01 f1 e0 00 00 40 89 00 00 00 00 00 00 08 00 00 00 00 00 d1  ==> 00
01 f2 00 1e 02 2f 89 00 00 01 00 00 00 38 00 00 00 00 00 62  ==> 12
01 f1 e0 00 00 20 84 00 00 00 00 00 00 08 00 00 00 00 00 bc  ==> 00
01 f2 00 1e 1e 4f 84 00 00 00 00 00 00 38 00 00 00 00 00 12  ==> 12
01 f1 e0 00 00 40 86 00 00 00 00 00 00 08 00 00 00 00 00 de  ==> 00
01 f2 00 1e 02 2f 86 00 00 0d 00 00 00 38 00 00 00 00 00 61  ==> 12
01 f1 e0 00 00 20 85 00 00 00 00 00 00 08 00 00 00 00 00 bd  ==> 00
00 ff 00 01 02 00 02 00 00 00 00 00 00 00 80 00 00 00 02 6e  ==> 12
01 f2 00 02 02 4f 85 00 00 00 00 00 00 38 00 00 00 00 00 13  ==> 12
01 f1 e0 00 00 50 8c 00 00 0d 00 00 40 08 00 00 00 00 00 89  ==> 00
01 f2 00 1e 02 0f 8c 00 00 0d 00 00 00 38 00 00 00 00 00 4b  ==> 12
01 f2 1c 00 02 f6 ff 01 00 01 07 f2 ff 38 00 00 00 00 00 c4  ==> 12
01 f2 1e 00 04 07 04 00 00 02 1b 1d 00 35 00 00 00 00 00 c9  ==> 12
01 f1 fe 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0a  ==> 00
01 f2 00 00 04 8f 8c 00 00 e8 2c 00 00 38 00 00 00 00 00 1a  ==> 12
01 f1 e0 00 00 80 8c 00 00 00 00 00 00 08 00 00 00 00 00 14  ==> 00
01 f1 e0 00 00 40 8a 00 00 00 00 00 00 08 00 00 00 00 00 d2  ==> 00
01 f2 00 02 02 2f 8a 00 00 00 00 00 00 38 00 00 00 00 00 7c  ==> 12
01 f1 e0 00 00 40 8b 00 00 00 00 00 00 08 00 00 00 00 00 d3  ==> 00
01 f2 00 00 04 2f 8b 00 00 75 4d 00 00 38 00 00 00 00 00 41  ==> 12
01 f1 e0 00 00 20 80 00 00 00 00 00 00 08 00 00 00 00 00 b8  ==> 00
01 f2 00 02 02 4f 80 00 00 00 00 00 00 38 00 00 00 00 00 16  ==> 12
01 f1 e0 00 00 40 48 00 00 00 00 00 00 08 00 00 00 00 00 10  ==> 00
01 f2 00 02 02 2f 48 00 00 03 00 00 00 38 00 00 00 00 00 bd  ==> 12
00 04 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06  ==> 00
00 ff 00 01 02 00 01 00 00 00 00 00 00 00 80 00 00 00 02 6d  ==> 12
01 60 d8 02 02 03 01 01 a5 25 00 00 00 23 00 00 00 00 00 0b  ==> 12
01 a1 98 00 00 00 00 62 9b 87 7f 87 7b 22 00 00 00 00 00 f5  ==> 12
01 60 b8 02 00 02 1c 19 9b 87 7f 87 7b 21 00 00 00 00 00 70  ==> 12
01 60 d8 02 02 02 01 01 45 0d 00 00 00 23 00 00 00 00 00 c2  ==> 12
01 60 d8 02 02 05 01 01 78 83 00 00 00 23 00 00 00 00 00 76  ==> 12
01 a0 78 00 02 00 00 b3 7b 83 00 00 00 22 00 00 00 00 00 a0  ==> 12
[juergen@nadhh ~]$ 

它不是 CRC-8。

每个“cs”值都是所有“数据”值的 exclusive-or,或者 exclusive-or 与 0x12 的值。在您的列表中,每行的 exclusive-or 是 00x12 交替,但最后一行除外。我在数据中没有看到任何明显的信息表明它应该是 0 还是 0x12