Closed malikcjm closed 6 years ago
This function shannon
is copied from binwalk, and should work for python2 and python3.
My mistake is that in binwalk the argument data
is always of type str
while here it is of type str
in python2 and data
in python3.
With your patch, it does not work with python2 anymore.
Thank you for reporting this bug of cpu_rec
.
I tried to use cpu_rec from master branch and commit f1934bc888067c716f39b8856e48ebe99a73aa78 'Display the value of Shannon entropy when used as a binwalk module: this helps to recognise false detection' as binwalk module. And every time I tried such exception was throw
Based on usage of seen dictionary I've made this change to make it work.