Properly decode values from ELF files even with partial smear

This commit is contained in:
Andrew Case
2025-03-05 23:11:37 +00:00
parent 86ef99f57a
commit bfab5bfd23
@@ -340,7 +340,7 @@ class elf_sym(objects.StructType):
if idx != -1:
name_bytes = name_bytes[:idx]
return name_bytes.decode("utf-8", errors="ignore")
return name_bytes.decode("utf-8", errors="replace")
class elf_phdr(objects.StructType):
@@ -446,7 +446,7 @@ class elf_linkmap(objects.StructType):
idx = buf.find(b"\x00")
if idx != -1:
buf = buf[:idx]
return buf.decode("utf-8", errors="ignore")
return buf.decode("utf-8", errors="replace")
class_types = {