本文整理匯總了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''