ReFirmLabs / binwalk

Firmware Analysis Tool
MIT License
10.35k stars 1.49k forks source link

Call plugins when Result is Valid #662

Open dingiso opened 7 months ago

dingiso commented 7 months ago

Dear binwalk maintainers:

The results passed to plugins are confusing to me.

The result function in module.py validate the result first and transfer it to plugins. Although plugins can judge using 'r.valid', the results is not valid can make the user confused.

self.validate(r)
self._plugins_result(r)

After skimming the plugins files in src/binwalk/plugins, since all of them are not use the invalid results, how about we just pass the valid result.

self.validate(r)
if r.valid:
    self._plugins_result(r)

One alternative way is to add the help message in wiki: https://github.com/ReFirmLabs/binwalk/wiki/Creating-Custom-Plugins

Thanks, Dingisoul