Skip to content

Commit 701ded3

Browse files
committed
feat(handler): fix false positive
Running on non-NSIS PE released by Nullsoft was causing the extractor to run when we actually don't want it to.
1 parent d005709 commit 701ded3

File tree

1 file changed

+5
-1
lines changed
  • python/unblob/handlers/executable

1 file changed

+5
-1
lines changed

python/unblob/handlers/executable/pe.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,16 @@ def is_nsis(self, binary: lief.PE.Binary) -> bool:
4545
"""
4646
Test if binary appears to be a Nullsoft Installer self-extracting archive
4747
48+
Partially based on file magic's rule:
49+
50+
https://github.com/file/file/blob/7ed3febfcd616804a2ec6495b3e5f9ccb6fc5f8f/magic/Magdir/msdos#L383
51+
4852
TODO: this series of tests is possibly too strict
4953
"""
5054

5155
return binary.has_resources and \
5256
binary.resources_manager.has_manifest and \
53-
"Nullsoft" in binary.resources_manager.manifest
57+
"Nullsoft " in binary.resources_manager.manifest
5458

5559

5660

0 commit comments

Comments
 (0)