diff --git a/samupload.py b/samupload.py index 41ee9e7..a03b9c1 100755 --- a/samupload.py +++ b/samupload.py @@ -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()