properly pack/unpack the verison numbers into a number

This commit is contained in:
lomeroe 2017-05-17 14:46:30 -05:00
parent 4ed45d9dcc
commit 91bfa6d9fe

View File

@ -4029,8 +4029,7 @@ def _write_regpol_data(data_to_write,
version_nums = (version_nums[0], version_nums[1] + 1)
elif gpt_extension.lower() == 'gPCUserExtensionNames'.lower():
version_nums = (version_nums[0] + 1, version_nums[1])
version_num = int("{0}{1}".format(str(version_nums[0]).zfill(4),
str(version_nums[1]).zfill(4)), 16)
version_num = struct.unpack('>I', struct.pack('>2H', *version_nums))[0]
gpt_ini_data = "{0}{1}={2}\r\n{3}".format(
gpt_ini_data[0:version_loc.start()],
'Version', version_num,