当前位置: 首页>>代码示例>>Python>>正文


Python ndr.NDR类代码示例

本文整理汇总了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)
开发者ID:awesome-security,项目名称:impacket,代码行数:8,代码来源:dtypes.py

示例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)
开发者ID:CoreSecurity,项目名称:impacket,代码行数:11,代码来源:dtypes.py

示例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)
开发者ID:MrTchuss,项目名称:impacket,代码行数:12,代码来源:drsuapi.py

示例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)
开发者ID:tempbottle,项目名称:impacket-1,代码行数:12,代码来源:dtypes.py

示例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)
开发者ID:skelsec,项目名称:impacket,代码行数:13,代码来源:dtypes.py

示例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)
开发者ID:sjitech,项目名称:impacket,代码行数:13,代码来源:dtypes.py

示例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)
开发者ID:sjitech,项目名称:impacket,代码行数:5,代码来源:drsuapi.py

示例8: getData

 def getData(self, soFar = 0):
     if self['pTriggers'] != 0:
         self['cTriggers'] = len(self['pTriggers'])
     return NDR.getData(self, soFar)
开发者ID:Hormazd,项目名称:impacket,代码行数:4,代码来源:scmr.py

示例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)
开发者ID:Hormazd,项目名称:impacket,代码行数:5,代码来源:scmr.py

示例10: __getitem__

 def __getitem__(self, key):
     if key == 'Data':
         return self.fields[key].decode('utf-16le')
     else:
         return NDR.__getitem__(self,key)
开发者ID:CoreSecurity,项目名称:impacket,代码行数:5,代码来源:dtypes.py

示例11: __getitem__

 def __getitem__(self, key):
     if key == "Data":
         return self.fields[key].decode("utf-16le")
     else:
         return NDR.__getitem__(self, key)
开发者ID:sjitech,项目名称:impacket,代码行数:5,代码来源:dtypes.py

示例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)
开发者ID:mrlzh,项目名称:sLANt,代码行数:5,代码来源:scmr.py

示例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)
开发者ID:ReaganTheDino,项目名称:buttsniffer,代码行数:6,代码来源:dtypes.py

示例14: getData

 def getData(self, soFar=0):
     self["cbRequiredPrivileges"] = len(self["pRequiredPrivileges"])
     return NDR.getData(self, soFar=0)
开发者ID:mrlzh,项目名称:sLANt,代码行数:3,代码来源:scmr.py


注:本文中的impacket.dcerpc.v5.ndr.NDR类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。