nitram2342 / bruteforce-crc

Brute-forcing CRC parameters
http://sitsec.net/blog/2012/02/10/brute-forcing-crc-parameters/
Boost Software License 1.0
65 stars 13 forks source link

Extra byte output in `Example Implementation` #5

Closed solomonbstoner closed 3 years ago

solomonbstoner commented 3 years ago

The code provided in the Example implementation output for found matches contains an extra last byte of the provided input bitstream (excluding the CRC).

For example, consider the bitstream generated below.

Screenshot from 2021-05-20 14-44-53

Its hex equivalent is shown below. The non-CRC portions are highlighted. Notice that the LSB on the right is 0x90.

Screenshot from 2021-05-20 15-07-05

However, the 0x90 is repeated in the example implementation in the output when --verbose true

Screenshot from 2021-05-20 15-07-17

Its a pretty inconsequential bug so I wasnt compelled to fix it. I might open a PR for this after my working hours

solomonbstoner commented 3 years ago

Consider the example below generated by the test case generator.

Screenshot from 2021-05-20 21-23-37

Under current master code would print an extra 0x19 in the example implementation.

Screenshot from 2021-05-20 21-34-12

After applying #6 , the correct byte sequence is printed.

Screenshot from 2021-05-20 21-37-24