Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix issue #1675 #1680

Merged
merged 2 commits into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions impacket/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from __future__ import print_function
from struct import pack, unpack, calcsize
from six import b, PY3
from binascii import hexlify


class Structure:
""" sublcasses can define commonHdr and/or structure.
Expand Down Expand Up @@ -160,7 +162,7 @@ def fromString(self, data):
data = data[size:]

return self

def __setitem__(self, key, value):
self.fields[key] = value
self.data = None # force recompute
Expand All @@ -170,9 +172,9 @@ def __getitem__(self, key):

def __delitem__(self, key):
del self.fields[key]

def __str__(self):
return self.getData()
return hexlify(self.getData())

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