本文整理汇总了Python中Client.print_state方法的典型用法代码示例。如果您正苦于以下问题:Python Client.print_state方法的具体用法?Python Client.print_state怎么用?Python Client.print_state使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client.print_state方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: P4wnP1
# 需要导入模块: import Client [as 别名]
# 或者: from Client import print_state [as 别名]
#.........这里部分代码省略.........
'''
print self.duckencoder.getLanguage()
def do_interact(self, line):
if not self.client.isConnected():
print "Not possible, client not connected"
return
pid = line.split(" ")[0]
if pid == "":
print "No process ID given, choose from:"
procs = self.client.getProcsWithChannel()
for p in procs:
if p.hasExited:
print "{0} (exited, interact to see final output)".format(p.id)
else:
print "{0}".format(p.id)
return
try:
pid = int(pid.strip())
except ValueError:
print "No valid process id: {0}".format(pid)
return
self.interactWithClientProcess(pid)
def do_exit(self, line):
print "Exitting..."
# self.ll.stop() # should happen in global finally statement
sys.exit()
def do_state(self, line):
self.client.print_state()
def do_echotest(self, line):
'''
If the client is connected, command arguments given should be reflected back.
Communications happen through a pure HID covert channel.
'''
self.client_call_echo(line)
def do_GetClientTimeout(self, line):
print "The client is considered disconnected, if no HID communication occures for"
print "\t{0} ms".format(P4wnP1.CLIENT_TIMEOUT_MS)
print
print "If you encounter disconnection issues (client is processing data to slow) increase"
print "this delay with `SetClientTimeout`"
def do_SetClientTimeout(self, line):
try:
val = int(line)
if val < 10 or val > 10000:
print "Timeout has to be chosenbetween 10ms and 10000ms"
return
P4wnP1.CLIENT_TIMEOUT_MS = val
except ValueError:
print "You have to provide a new timeout value in milliseconds"
def do_SendDuckyScript(self, line):
scriptpath = self.config["PATH_DUCKYSCRIPT"] + "/" + line
if not FileSystem.fileExists(scriptpath):
print "No script given or given script not found"
hasChosen = False