packing-box / bintropy

Analysis tool for estimating the likelihood that a binary contains compressed or encrypted bytes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: module 'lief' has no attribute 'not_found'

ImSo3K opened this issue · comments

Referring to the following except statement:

except (AttributeError, lief.not_found, lief.conversion_error):

It seems like that in LIEF's latest update (0.13.0) they no longer use exceptions, this can be seen in their official docs too.

As a temporary fix, I just deleted these 2 attributes which results in:
except AttributeError:

Another thing that I've noticed, in the following line:

btype = str(type(binary)).split(".")[1]

will result in btype = '_lief' since type(binary) returns <class 'lief._lief.PE.Binary> so taking the next element in the split [2] will result in PE

I haven't tested this with ELF or Mach0 file types

commented

Hi @ImSo3K
Thank you for bringing this to my attention ! Fixed in 1.4.2.

Hi @ImSo3K Thank you for bringing this to my attention ! Fixed in 1.4.2.

Sure no problem, I did actually find another instance of the same issue with btype when I plotted the result.
You can see it here:

data['type'] = str(type(binary)).split(".")[1]

In my case, it just said Entropy per section of _lief file instead of PE, the same fix worked for me there too