本文整理汇总了Python中impacket.structure.Structure方法的典型用法代码示例。如果您正苦于以下问题:Python structure.Structure方法的具体用法?Python structure.Structure怎么用?Python structure.Structure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类impacket.structure
的用法示例。
在下文中一共展示了structure.Structure方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OpenSCManager
# 需要导入模块: from impacket import structure [as 别名]
# 或者: from impacket.structure import Structure [as 别名]
def OpenSCManager(host, access = 1):
class foo(Structure):
opnum = 0x0f
structure = (
('str1', ':'),
('null', '<L=0'),
('access', '<L'),
)
query = foo()
query['str1'] = rpcstr("\\\\%s\x00" % (host))
query['access'] = access
return query
# MS RPC OpenServiceW
示例2: OpenService
# 需要导入模块: from impacket import structure [as 别名]
# 或者: from impacket.structure import Structure [as 别名]
def OpenService(handle, service, access = 1):
class foo(Structure):
opnum = 0x10
structure = (
('handle', ':'),
('str1', ':'),
('access', '<L'),
)
query = foo()
query['handle'] = handle
query['str1'] = rpcstr("%s\x00" % (service), 0)
query['access'] = access
return query
示例3: __init__
# 需要导入模块: from impacket import structure [as 别名]
# 或者: from impacket.structure import Structure [as 别名]
def __init__(self, *args, **kargs):
structure.Structure.__init__(self, *args, **kargs)
self['data'] = ''
示例4: __init__
# 需要导入模块: from impacket import structure [as 别名]
# 或者: from impacket.structure import Structure [as 别名]
def __init__(self, data = None, alignment = 0):
structure.Structure.__init__(self, data, alignment)
示例5: rpcstr
# 需要导入模块: from impacket import structure [as 别名]
# 或者: from impacket.structure import Structure [as 别名]
def rpcstr(str, id = 1, unicode_string = 1):
class foo(Structure):
alignment = 4
structure = ()
if(id == 1):
structure += (('id', '<L')),
structure += (
('max', '<L'),
('offset', '<L=0'),
('actual', '<L'),
('str', '%s'),
)
query = foo()
if(id == 1):
query['id'] = dword_rand()
query['max'] = len(str)
query['actual'] = len(str)
if(unicode_string == 1):
query['str'] = utf16(str)
else:
query['str'] = str
return query
# MS RPC OpenSCManager
示例6: __init__
# 需要导入模块: from impacket import structure [as 别名]
# 或者: from impacket.structure import Structure [as 别名]
def __init__(self, *args, **kargs):
structure.Structure.__init__(self, *args, **kargs)
self['data'] = b''