Fix device name display

This commit is contained in:
Bjoern Kerler 2023-03-20 16:52:37 +01:00
parent 06151c0737
commit 3923b27d6c
No known key found for this signature in database
GPG key ID: 52E823BB96A55380

View file

@ -492,15 +492,20 @@ class partitiontable:
self.mode = mode
if mode == 64:
self.ptype = sh.dword()
self.pname = sh.bytes(12)
self.pname = self.pname[:self.pname.find(b"\x00")].decode('utf-8')
self.info = sh.qword()
self.pname = sh.bytes(20)
if b"\x00" in self.pname:
self.pname = self.pname[:self.pname.find(b"\x00")].decode('utf-8')
else:
self.pname=self.pname.decode('utf-8')
self.pstart = sh.qword()
self.pend = sh.qword()
elif mode == 32:
self.ptype = sh.dword()
self.pname = sh.bytes(16)
self.pname = self.pname[:self.pname.find(b"\x00")].decode('utf-8')
if b"\x00" in self.pname:
self.pname = self.pname[:self.pname.find(b"\x00")].decode('utf-8')
else:
self.pname=self.pname.decode('utf-8')
self.pstart = sh.dword()
self.pend = sh.dword()