binarly-io / fwhunt-scan

Tools for analyzing UEFI firmware and checking UEFI modules with FwHunt rules
GNU General Public License v3.0
214 stars 30 forks source link

TypeError: 'NoneType' object is not iterable #44

Closed hughsie closed 2 years ago

hughsie commented 2 years ago

When running on the LVFS I get:

  File ".../env/lib/python3.10/site-packages/fwhunt_scan/uefi_scanner.py", line 834, in _get_bounds
    funcs = list(self._uefi_analyzer._rz.cmdj("aflqj"))
TypeError: 'NoneType' object is not iterable

firmware.zip

I've attached a file that reproduces the issue, rules are all of FwHunt/rules/Vulnerabilities/** -- the unzip password is lvfs

yeggor commented 2 years ago

What version of rizin are you currently using? The aflqj command stopped working at some point. I fixed as follows: https://github.com/binarly-io/fwhunt-scan/commit/9b63f5af9fadd44228511edb45bfc23c4792cc4d

hughsie commented 2 years ago

rizin-0.4.0; but regardless -- fwhunt_scan should check for it being None before casting to a list -- and if None return something like UefiScannerError

yeggor commented 2 years ago

Agreed. But in fix that I've mentioned it works via uefi_analyzer.functions. I should have realised whether to fix it as you suggested or merge the changes from the rizin-v0.4.0 branch.

yeggor commented 2 years ago

If it works fine for you now, I will upload a new release on pypi.

hughsie commented 2 years ago

Yup, that works fine -- thanks.