Closed hughsie closed 2 years ago
I suppose the reason is that uefi_r2 now parses binaries not by functions (as it was before), but by instructions (since r2/rizin does not define all functions for EFI binaries due to the large number of callbacks inside). A possible solution would be to check the file type before analyzing.
A possible solution would be to check the file type before analyzing.
If it helps, my workaround is:
if blob[0:2] != b"MZ":
return
Yes, I am talking about just such a check.
But I was wrong, the main problem is not on the uefi_r2
side (with file instead of blob it works fine), we need to report it to the rizin
.
@hughsie what do you think, raise exception is good or will better to return empty result in get_summary()
?
Well, I can catch the exception -- that's probably the most sane thing to do.
Uploaded in PyPI: https://pypi.org/project/uefi-r2/1.1.2/
Don;t you need to export AnalyzerError in init.py?
And maybe it should be called UefiAnalyzerError?
It make sense, thank you
It is because sometimes the size of the shared memory is bigger than requested by the file. In our tests we solved this problem by allowing to specify the size of the object passed via shm://
right in the URI:
For example, something like shm://bla/4096
It should work not only in dev
but also on stable
, which is now released as 0.3.1. Let me know if that is a good enough for you.
@XVilka, thank you
When you use
UefiAnalyzer()
on a small EFI binary it typically finishes in about 100ms. If you ask UefiAnalyzer() to analyse something that's not a PE file (e.g. a jpg, or a zip file, or a ROM image, or just some text) then it takes a long time to process the file. Like minutes per file.where foo.py is just:
eventually it outputs:
I assume it's just read 4G of data....