mirror of
https://github.com/dbisu/pico-ducky.git
synced 2026-01-21 17:26:00 +00:00
Removed unneeded returns, and changed defaultdelay to global (#6)
This commit is contained in:
@@ -36,11 +36,9 @@ def runScriptLine(line):
|
|||||||
for k in line:
|
for k in line:
|
||||||
kbd.press(k)
|
kbd.press(k)
|
||||||
kbd.release_all()
|
kbd.release_all()
|
||||||
return
|
|
||||||
|
|
||||||
def sendString(line):
|
def sendString(line):
|
||||||
layout.write(line)
|
layout.write(line)
|
||||||
return
|
|
||||||
|
|
||||||
def parseLine(line):
|
def parseLine(line):
|
||||||
if(line[0:3] == "REM"):
|
if(line[0:3] == "REM"):
|
||||||
@@ -57,7 +55,6 @@ def parseLine(line):
|
|||||||
else:
|
else:
|
||||||
newScriptLine = convertLine(line)
|
newScriptLine = convertLine(line)
|
||||||
runScriptLine(newScriptLine)
|
runScriptLine(newScriptLine)
|
||||||
return
|
|
||||||
|
|
||||||
kbd = Keyboard(usb_hid.devices)
|
kbd = Keyboard(usb_hid.devices)
|
||||||
layout = KeyboardLayoutUS(kbd)
|
layout = KeyboardLayoutUS(kbd)
|
||||||
@@ -72,10 +69,9 @@ progStatus = False
|
|||||||
progStatusPin = digitalio.DigitalInOut(GP0)
|
progStatusPin = digitalio.DigitalInOut(GP0)
|
||||||
progStatusPin.switch_to_input(pull=digitalio.Pull.UP)
|
progStatusPin.switch_to_input(pull=digitalio.Pull.UP)
|
||||||
progStatus = progStatusPin.value
|
progStatus = progStatusPin.value
|
||||||
|
defaultDelay = 0
|
||||||
if(progStatus == True):
|
if(progStatus == True):
|
||||||
#not in programming state, run script file
|
#not in programming state, run script file
|
||||||
defaultDelay = 0
|
|
||||||
duckyScriptPath = "payload.dd"
|
duckyScriptPath = "payload.dd"
|
||||||
f = open(duckyScriptPath,"r",encoding='utf-8')
|
f = open(duckyScriptPath,"r",encoding='utf-8')
|
||||||
print("Running payload.dd")
|
print("Running payload.dd")
|
||||||
|
|||||||
Reference in New Issue
Block a user