本文整理汇总了Python中impacket.dcerpc.v5.ndr.NDRSTRUCT类的典型用法代码示例。如果您正苦于以下问题:Python NDRSTRUCT类的具体用法?Python NDRSTRUCT怎么用?Python NDRSTRUCT使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NDRSTRUCT类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, data = None, isNDR64 = False):
NDRSTRUCT.__init__(self, data, isNDR64)
self.structure = (
('tdescElem',TYPEDESC),
('cDims',USHORT),
('rgbounds',SAFEARRAYBOUND_ARRAY),
)
示例2: __getitem__
def __getitem__(self, key):
if key == 'asData':
value = ''
for letter in self.fields['asData']['Data']:
value += pack('<H', letter).decode('utf-16le')
return value
else:
return NDRSTRUCT.__getitem__(self,key)
示例3: __setitem__
def __setitem__(self, key, value):
if key == 'Data' and isinstance(value, NDR) is False:
try:
value.encode('utf-16le')
except UnicodeDecodeError:
import sys
value = value.decode(sys.getfilesystemencoding())
self['Length'] = len(value)*2
self['MaximumLength'] = len(value)*2
return NDRSTRUCT.__setitem__(self, key, value)
示例4: __setitem__
def __setitem__(self, key, value):
if key == 'asData':
value = value #+ '\x00'
array = list()
for letter in value:
encoded = letter.encode('utf-16le')
array.append(unpack('<H', encoded)[0])
self.fields[key]['Data'] = array
self['cBytes'] = len(value)*2
self['clSize'] = len(value)
self.data = None # force recompute
else:
return NDRSTRUCT.__setitem__(self, key, value)
示例5: fromString
def fromString(self, data, soFar=0):
retVal = NDRSTRUCT.fromString(self, data, soFar)
# self.dumpRaw()
return retVal
示例6: getData
def getData(self, soFar=0):
return NDRSTRUCT.getData(self, soFar)
示例7: __init__
def __init__(self, data = None,isNDR64 = False):
NDRSTRUCT.__init__(self, data, isNDR64)
self['context_handle_uuid'] = '\x00'*20
示例8: getData
def getData(self, soFar = 0):
self['SubAuthorityCount'] = len(self['SubAuthority'])
return NDRSTRUCT.getData(self, soFar)
示例9: __setitem__
def __setitem__(self, key, value):
if key == 'Data' and isinstance(value, NDR) is False:
self['Length'] = len(value)*2
self['MaximumLength'] = len(value)*2
return NDRSTRUCT.__setitem__(self, key, value)
示例10: __init__
def __init__(self, data=None, isNDR64=False):
NDRSTRUCT.__init__(self, data, isNDR64)
self["context_handle_uuid"] = "\x00" * 20
示例11: getData
def getData(self, soFar=0):
self["SubAuthorityCount"] = len(self["SubAuthority"])
return NDRSTRUCT.getData(self, soFar)