所以我有问题找到一系列命令的CRC值,我已经有一些命令的CRC值,但我需要弄清楚它们是如何计算的。 仔细检查数据流并尝试计算CRC后,我们无法获得已知的CRC值和计算出的CRC值以匹配。 我以前从来没有计算过CRC,但我已经阅读过多篇论文,似乎很容易,除非它没有工作。 我手册中说多项式生成器是(x ^ 8 + x ^ 7 + X ^ 2 + X ^ 0),它给出了一个唯一的非零值B1(十六进制)。 完整命令是A9E40401(十六进制),CRC为1E(十六进制)。 我目前使用的过程涉及将数据流从十六进制转换为二进制,使用LSB优先规则,将FF(十六进制)插入命令以检测无关的零,将00(十六进制)添加到结尾作为占位符而不是执行mod2划分,并且将其反转并将其应用于数据流。 要么我做错了什么,要么我错过了一步。 我假设我提供的多项式是正确的。 任何帮助将不胜感激。
So I have problem finding the CRC value for a series of commands, I already have the CRC values for some of the commands but I need to figure out how they were calculated. After carefully going over the data stream and attempting to calculate the CRC we cannot get the known CRC value and the calculated one to match. I have never calculated a CRC before but I have read multiple papers on it and it seems easy enough, except for the fact that its not working. The manual I have says the polynomial generator is (x^8 + x^7 + X^2 + X^0) and it gives me a unique non zero value of B1 (hex). The full command is A9E40401 (hex) with a CRC of 1E (hex). The process I am currently using involves converting the data stream from hex into binary, using the LSB first rule, inserting FF(hex) into the command to detect extraneous zeros, adding 00(hex) to the end as a place holder and than performing mod2 division, and than I invert it and apply it to the data stream. Either I'm doing something wrong or I missed a step. I am assuming the polynomial I was provided is correct. Any help would be greatly appreciated.
最满意答案
您可以尝试使用RevEng来确定一组示例中的CRC参数。
然后你可以使用crcany来生成代码。
I feel like an idiot. When I calculated my CRC I did every step properly except the very last step where you must perform the LSB first rule and than invert the remainder. I only performed the LSB first rule (thinking that's what was meant by invert). So with a remainder of 00011101 I got the wrong CRC value (10111000). when I should have gotten 01000111.
我如何反向工程一个已知的循环冗余校验值?(How do i reverse engineer a known Cyclic Redundancy Check value?)所以我有问题找到一系列命令的CRC值,我已经有一些命令的CRC值,但我需要弄清楚它们是如何计算的。 仔细检查数据流并尝试计算CRC后,我们无法获得已知的CRC值和计算出的CRC值以匹配。 我以前从来没有计算过CRC,但我已经阅读过多篇论文,似乎很容易,除非它没有工作。 我手册中说多项式生成器是(x ^ 8 + x ^ 7 + X ^ 2 + X ^ 0),它给出了一个唯一的非零值B1(十六进制)。 完整命令是A9E40401(十六进制),CRC为1E(十六进制)。 我目前使用的过程涉及将数据流从十六进制转换为二进制,使用LSB优先规则,将FF(十六进制)插入命令以检测无关的零,将00(十六进制)添加到结尾作为占位符而不是执行mod2划分,并且将其反转并将其应用于数据流。 要么我做错了什么,要么我错过了一步。 我假设我提供的多项式是正确的。 任何帮助将不胜感激。
So I have problem finding the CRC value for a series of commands, I already have the CRC values for some of the commands but I need to figure out how they were calculated. After carefully going over the data stream and attempting to calculate the CRC we cannot get the known CRC value and the calculated one to match. I have never calculated a CRC before but I have read multiple papers on it and it seems easy enough, except for the fact that its not working. The manual I have says the polynomial generator is (x^8 + x^7 + X^2 + X^0) and it gives me a unique non zero value of B1 (hex). The full command is A9E40401 (hex) with a CRC of 1E (hex). The process I am currently using involves converting the data stream from hex into binary, using the LSB first rule, inserting FF(hex) into the command to detect extraneous zeros, adding 00(hex) to the end as a place holder and than performing mod2 division, and than I invert it and apply it to the data stream. Either I'm doing something wrong or I missed a step. I am assuming the polynomial I was provided is correct. Any help would be greatly appreciated.
最满意答案
您可以尝试使用RevEng来确定一组示例中的CRC参数。
然后你可以使用crcany来生成代码。
I feel like an idiot. When I calculated my CRC I did every step properly except the very last step where you must perform the LSB first rule and than invert the remainder. I only performed the LSB first rule (thinking that's what was meant by invert). So with a remainder of 00011101 I got the wrong CRC value (10111000). when I should have gotten 01000111.
发布评论