Skip to content

Commit 0c5fb74

Browse files
authored
Fix uefi parse of ASUS bios CAP files (#128)
Checked with: https://dlcdnets.asus.com/pub/ASUS/mb/BIOS/Pro-WS-WRX90E-SAGE-SE-ASUS-0502.zip Workaround for: File "uefi_firmware/guids/__init__.py", line 21, in get_guid_name raw_guid = aguid(guid) ^^^^^^^^^^^ File "/home/denis/Develop/linux-kernel/checks/uefi-firmware-parser/uefi_firmware/utils.py", line 105, in aguid a, b, c, d = struct.unpack("%sIHH8s" % (">" if big else "<"), b) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ struct.error: unpack requires a buffer of 16 bytes
1 parent 631956e commit 0c5fb74

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

uefi_firmware/utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ def a2sguid(a):
102102

103103
def aguid(b, big=False):
104104
'''RFC4122 binary GUID as int array.'''
105+
if len(b) < 16:
106+
for i in range(16 - len(b)):
107+
b += b'\0'
105108
a, b, c, d = struct.unpack("%sIHH8s" % (">" if big else "<"), b)
106109
return [a, b, c] + [_c for _c in d]
107110

0 commit comments

Comments
 (0)