Skip to content

Commit

Permalink
bugfix #1675 __str__
Browse files Browse the repository at this point in the history
  • Loading branch information
NtAlexio2 committed Jan 12, 2024
1 parent 6c9a1aa commit efd6789
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion impacket/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
from __future__ import print_function
from struct import pack, unpack, calcsize
from six import b, PY3
from sys import stdout


encoding = stdout.encoding

class Structure:
""" sublcasses can define commonHdr and/or structure.
Expand Down Expand Up @@ -172,7 +176,7 @@ def __delitem__(self, key):
del self.fields[key]

def __str__(self):
return self.getData()
return self.getData().decode(encoding)

def __len__(self):
# XXX: improve
Expand Down

0 comments on commit efd6789

Please sign in to comment.