From c1e704626a162316f77ddc6e734ae63f4fb6bb88 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 10 Aug 2023 17:05:55 +0200 Subject: [PATCH] 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. --- src/ukify/ukify.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 = { -- 2.47.3