MCPcopy Create free account
hub / github.com/secdev/scapy / fromstr

Method fromstr

scapy/layers/smb2.py:808–819  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

806
807 @staticmethod
808 def fromstr(x):
809 m = WINNT_SID._SID_REG.match(x)
810 if not m:
811 raise ValueError("Invalid SID format !")
812 rev, authority, subauthority = m.groups()
813 return WINNT_SID(
814 Revision=int(rev),
815 IdentifierAuthority=WINNT_SID_IDENTIFIER_AUTHORITY(
816 Value=struct.pack(">Q", int(authority))[2:]
817 ),
818 SubAuthority=[int(x) for x in subauthority[1:].split("-")],
819 )
820
821 def summary(self):
822 return "S-%s-%s%s" % (

Callers 3

aceguiMethod · 0.80
viewsecMethod · 0.80
_parse_attributeMethod · 0.80

Calls 2

WINNT_SIDClass · 0.85

Tested by

no test coverage detected