ci: install pefile

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-12-07 15:53:47 +01:00
parent 0fdf4e1810
commit 1f6da5d902
5 changed files with 11 additions and 1 deletions
+6
View File
@@ -20,6 +20,12 @@ try:
except ImportError:
sys.exit(77)
try:
# pyflakes: noqa
import pefile # noqa
except ImportError:
sys.exit(77)
# We import ukify.py, which is a template file. But only __version__ is
# substituted, which we don't care about here. Having the .py suffix makes it
# easier to import the file.
+2 -1
View File
@@ -20,7 +20,6 @@ import subprocess
import tempfile
import typing
import pefile
__version__ = '{{GIT_VERSION}}'
@@ -66,6 +65,8 @@ def shell_join(cmd):
def pe_executable_size(filename):
import pefile
pe = pefile.PE(filename)
section = pe.sections[-1]
return section.VirtualAddress + section.Misc_VirtualSize