MCPcopy
hub / github.com/knownsec/pocsuite3 / decode

Method decode

pocsuite3/lib/helper/java/serialization.py:787–798  ·  view source on GitHub ↗
(self, io)

Source from the content-addressed store, hash-verified

785
786class LongUtf(Utf):
787 def decode(self, io):
788 raw_length = io.read(8)
789 if not raw_length or len(raw_length) != 8:
790 raise Exception('Failed to unserialize LongUtf')
791 self.length = struct.unpack('>Q', raw_length)[0]
792 if self.length == 0:
793 self.contents = ""
794 else:
795 self.contents = io.read(self.length)
796 if not self.contents or len(self.contents) != self.length:
797 raise Exception('Failed to unserialize LongUtf')
798 return self
799
800 def encode(self):
801 encoded = struct.pack('>Q', [self.length])

Callers 1

decode_contentFunction · 0.95

Calls 1

readMethod · 0.80

Tested by

no test coverage detected