Fix strings with extra NUL padding

This commit is contained in:
William Toohey
2020-07-10 09:26:55 +10:00
parent ca4a6e309e
commit b1339d6c4b

View File

@@ -377,7 +377,8 @@ class KBinXML():
else:
string = ' '.join(map(nodeFormat.get('toStr', str), data))
node.text = string
# some strings have extra NUL bytes, compatible behaviour is to strip
node.text = string.strip('\0')
# because we need the 'real' root
self.xml_doc = self.xml_doc[0]