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

bruteforce-crc.cc: Fix errors with `initial` & example implementation #6

Closed solomonbstoner closed 3 years ago

solomonbstoner commented 3 years ago

Fixes #4. Fixes #5.

  1. Since initial was declared to be uint32_t, the conversion of the argument should likewise be converted to uint32_t. size_t converts it to 8-bytes, which will not fit into 4-bytes.

  2. probe_initial should be set to false by default to prevent the current bug. The current bug causes the program to ignore the user specified value --initial x and bruteforce crc seeds.

  3. The extra byte output is a typical fence post problem. Fixed with this PR.

Signed-off-by: Solomon Tan solomonbstoner@yahoo.com.au

solomonbstoner commented 3 years ago

See Issues #4 and #5 for description on how PR #6 will solve them. Ready for review and merge, please.