本文整理汇总了Python中impacket.dcerpc.v5.ndr.NDR类的典型用法代码示例。如果您正苦于以下问题:Python NDR类的具体用法?Python NDR怎么用?Python NDR使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NDR类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __setitem__
def __setitem__(self, key, value):
if key == 'Data':
self.fields[key] = value
self.fields['MaximumCount'] = None
self.fields['ActualCount'] = None
self.data = None # force recompute
else:
return NDR.__setitem__(self, key, value)
示例2: __setitem__
def __setitem__(self, key, value):
if key == 'Data':
try:
self.fields[key] = value.encode('utf-16le')
except UnicodeDecodeError:
import sys
self.fields[key] = value.decode(sys.getfilesystemencoding()).encode('utf-16le')
self.data = None # force recompute
else:
return NDR.__setitem__(self, key, value)
示例3: __getitem__
def __getitem__(self, key):
if key == 'Data':
try:
return ''.join([chr(i) for i in self.fields[key]])
except ValueError:
# We might have Unicode chars in here, let's use unichr instead
LOG.debug('ValueError exception on %s' % self.fields[key])
LOG.debug('Switching to unichr()')
return ''.join([unichr(i) for i in self.fields[key]])
else:
return NDR.__getitem__(self,key)
示例4: __setitem__
def __setitem__(self, key, value):
if key == 'Data':
try:
self.fields[key] = value.encode('utf-16le')
except UnicodeDecodeError:
import sys
self.fields[key] = value.decode(sys.stdin.encoding).encode('utf-16le')
self.fields['MaximumCount'] = None
self.fields['ActualCount'] = None
self.data = None # force recompute
else:
return NDR.__setitem__(self, key, value)
示例5: __setitem__
def __setitem__(self, key, value):
#input('WSTR setitem! key: %s value: %s' % (key, value))
if key == 'Data':
try:
self.fields[key] = value.encode('utf-16le')
except UnicodeDecodeError:
import sys
self.fields[key] = value.decode(sys.getfilesystemencoding()).encode('utf-16le')
self.fields['MaximumCount'] = None
self.fields['ActualCount'] = None
self.data = None # force recompute
else:
return NDR.__setitem__(self, key, value)
示例6: __setitem__
def __setitem__(self, key, value):
if key == "Data":
try:
self.fields[key] = value.encode("utf-16le")
except UnicodeDecodeError:
import sys
self.fields[key] = value.decode(sys.getfilesystemencoding()).encode("utf-16le")
self.fields["MaximumCount"] = None
self.fields["ActualCount"] = None
self.data = None # force recompute
else:
return NDR.__setitem__(self, key, value)
示例7: __getitem__
def __getitem__(self, key):
if key == "Data":
return "".join([chr(i) for i in self.fields[key]])
else:
return NDR.__getitem__(self, key)
示例8: getData
def getData(self, soFar = 0):
if self['pTriggers'] != 0:
self['cTriggers'] = len(self['pTriggers'])
return NDR.getData(self, soFar)
示例9: __init__
def __init__(self, data = None, isNDR64 = False):
NDR.__init__(self,None,isNDR64)
self.fields['Data'].item = SC_ACTION
if data is not None:
self.fromString(data)
示例10: __getitem__
def __getitem__(self, key):
if key == 'Data':
return self.fields[key].decode('utf-16le')
else:
return NDR.__getitem__(self,key)
示例11: __getitem__
def __getitem__(self, key):
if key == "Data":
return self.fields[key].decode("utf-16le")
else:
return NDR.__getitem__(self, key)
示例12: __init__
def __init__(self, data=None, isNDR64=False):
NDR.__init__(self, None, isNDR64)
self.fields["Data"].item = LPWSTR
if data is not None:
self.fromString(data)
示例13: __setitem__
def __setitem__(self, key, value):
if key == 'Data':
self.fields[key] = value.encode('utf-16le')
self.data = None # force recompute
else:
return NDR.__setitem__(self, key, value)
示例14: getData
def getData(self, soFar=0):
self["cbRequiredPrivileges"] = len(self["pRequiredPrivileges"])
return NDR.getData(self, soFar=0)