MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / ProtocolError

Class ProtocolError

pager_lib/smb/smb_structs.py:34–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33
34class ProtocolError(Exception):
35
36 def __init__(self, message, data_buf = None, smb_message = None):
37 self.message = message
38 self.data_buf = data_buf
39 self.smb_message = smb_message
40
41 def __str__(self):
42 b = StringIO()
43 b.write(self.message + os.linesep)
44 if self.smb_message:
45 b.write('=' * 20 + ' SMB Message ' + '=' * 20 + os.linesep)
46 b.write(str(self.smb_message))
47
48 if self.data_buf:
49 b.write('=' * 20 + ' SMB Data Packet (hex) ' + '=' * 20 + os.linesep)
50 b.write(str(binascii.hexlify(self.data_buf)))
51 b.write(os.linesep)
52
53 return b.getvalue()
54
55class SMB2ProtocolHeaderError(ProtocolError):
56

Callers 13

decodeMethod · 0.85
decodeMethod · 0.85
decodeMethod · 0.85
decodeMethod · 0.85
decodeMethod · 0.85
decodeMethod · 0.85
decodeMethod · 0.85
decodeMethod · 0.85
decodeMethod · 0.85
decodeMethod · 0.85
decodeMethod · 0.85
_updateState_SMB2Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected