From: Daan De Meyer Date: Thu, 10 Aug 2023 15:05:55 +0000 (+0200) Subject: ukify: Use length= instead of ignore_padding= in inspect X-Git-Tag: v255-rc1~759 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c1e704626a162316f77ddc6e734ae63f4fb6bb88;p=thirdparty%2Fsystemd.git ukify: Use length= instead of ignore_padding= in inspect ignore_padding= was only added in a recent version of pefile. Let's set length= to the virtual size instead which is what ignore_padding does behind the scenes so we're compatible with older versions of pefile. --- diff --git a/src/ukify/ukify.py b/src/ukify/ukify.py index 0ddf56ae5e2..10a464bb1a3 100755 --- a/src/ukify/ukify.py +++ b/src/ukify/ukify.py @@ -958,8 +958,9 @@ def inspect_section(opts, section): ttype = config.output_mode if config else DEFAULT_SECTIONS_TO_SHOW.get(name, 'binary') - data = section.get_data(ignore_padding=True) size = section.Misc_VirtualSize + # TODO: Use ignore_padding once we can depend on a newer version of pefile + data = section.get_data(length=size) digest = sha256(data).hexdigest() struct = {