We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents efb88c9 + 3c0c9fc commit 79347b2Copy full SHA for 79347b2
qiling/loader/elf.py
@@ -308,7 +308,7 @@ def __push_str(top: int, s: str) -> int:
308
Top of stack remains aligned to pointer size
309
"""
310
311
- data = s.encode('utf-8') + b'\x00'
+ data = (s if isinstance(s, bytes) else s.encode("utf-8")) + b'\x00'
312
top = QlLoaderELF.align(top - len(data), self.ql.pointersize)
313
self.ql.mem.write(top, data)
314
@@ -682,4 +682,4 @@ def get_elfdata_mapping(self, elffile: ELFFile) -> bytes:
682
# aggregate section data
683
elfdata_mapping.extend(sec.data())
684
685
- return bytes(elfdata_mapping)
+ return bytes(elfdata_mapping)
0 commit comments