pancake wrote:
> I have also modified the pZ in order to display the entropy ranges
> from 0 to 255.
Nice. But it needs to perform the cast *after* scaling. Try this:
case 'e': // entropy
- ret = (unsigned char) (r_hash_entropy (bufz, size)*255)/8;
+ ret = (unsigned char) (r_hash_entropy (bufz, size)*255/8);
break;
Another adjustment that might be useful is for smaller buffers: when
size<256 (which can happen in zoom view with a large terminal and a
small file) the maximum is only log2(size). But that change means
adding a libm dependency to libr_core, or adding a wrapper function in
hash/entropy.c (r_hash_entropy_fraction?).
Glyn
_______________________________________________
radare mailing list
[email protected]
http://lists.nopcode.org/listinfo.cgi/radare-nopcode.org