fkie-cad / dewolf

A research decompiler implemented as a Binary Ninja plugin.
GNU Lesser General Public License v2.1
172 stars 9 forks source link

Improve error handling of decompilation tasks #391

Closed rihi closed 5 months ago

rihi commented 7 months ago

This PR improves the error handling of the decompilation process. Previously, error raised before cfg lifting, like during lifting of the function signature, were simply not caught. This resulted in decompile_all crashing if one function failed before cfg lifting. We do however already have a mechanism for failed function decompilation, which is that the decompiler taks object created for each function can be marked as 'failed'. This PR makes sure that these kinds of errors are now also caught with this in mind.

Additionally, this PR fixes #291, by checking if binary ninja decompiled the function successfully and failing with the appropriated reason if not.

Additionally this PR has two commits which slightly refactor some code 075965013f54c8c8c02c9366d49d43e3468c49c2, 2cd2a368082a5fc9ef95f003813f2d4eece86859. These are not directly needed to fix any bug, and could be dropped if desired.