Skip to content

Commit 65d2548

Browse files
committed
fix stuff for the last function
1 parent 3be7214 commit 65d2548

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

src/commands/functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ STRING World!
3939
A function may return a integer or boolean value which may also be evaluated.
4040
4141
\`\`\`
42-
FUNCITON TEST_CAPS_AND_NUM()
42+
FUNCTION TEST_CAPS_AND_NUM()
4343
IF (($_CAPSLOCK_ON == TRUE) && ($_NUMLOCK_ON == TRUE)) THEN
4444
RETURN TRUE
4545
ELSE

src/commands/general.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ Or in this case: \`STRING abc\`
106106
107107
\`\`\`
108108
STRINGLN
109-
a
110-
b
111-
c
109+
a
110+
b
111+
c
112112
END_STRINGLN
113113
\`\`\`
114114

src/commands/internal_variables.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,59 +13,59 @@ export const INTERNAL_VARIABLES_COMMANDS: CommandInfo[] = [
1313
1414
\`$_BUTTON_ENABLED\` - *Returns \`TRUE\` if the button is enabled or \`FALSE\` if the button is disabled.
1515
16-
\`$_BUTTON_USER_DEFINED\` - *Returns \`TRUE\` if a BUTTON_DEF has been implemented in the payload or \`FALSE\` if it hasn't been implemented.*
16+
\`$_BUTTON_USER_DEFINED\` - *Returns \`TRUE\` if a \`BUTTON_DEF\` has been implemented in the payload or \`FALSE\` if it hasn't been implemented.*
1717
1818
\`$_BUTTON_PUSH_RECEIVED\` - *Returns \`TRUE\` if the button has ever been pressed. May be retrieved or set.*
1919
2020
\`$_BUTTON_TIMEOUT\` - *The button debounce, or cooldown time before counting the next button press, in milliseconds. The default value is 1000.*
2121
2222
## LED
2323
24-
\`$_SYSTEM_LEDS_ENABLED\` - *Default set \`TRUE\`. May be retrieved or set. Boot and ATTACKMODE change LED.*
24+
\`$_SYSTEM_LEDS_ENABLED\` - *Default set \`TRUE\`. May be retrieved or set. Boot and \`ATTACKMODE\` change LED.*
2525
26-
\`$_STORAGE_LEDS_ENABLED\` - *Default set \`TRUE\`. May be retrieved or set.\nBlinks the LED red/green on storage read/write in ATTACKMODE STORAGE.*
26+
\`$_STORAGE_LEDS_ENABLED\` - *Default set \`TRUE\`. May be retrieved or set.\nBlinks the LED red/green on storage read/write in \`ATTACKMODE STORAGE\`.*
2727
28-
\`$_LED_CONTINUOUS_SHOW_STORAGE_ACTIVITY\` - *Default set \`TRUE\`. May be retrieved or set.\nThe LED will light solid green when the storage has been inactive for longer than $_STORAGE_ACTIVITY_TIMEOUT (default 1000 ms). Otherwise, the LED will light red when active.*
28+
\`$_LED_CONTINUOUS_SHOW_STORAGE_ACTIVITY\` - *Default set \`TRUE\`. May be retrieved or set.\nThe LED will light solid green when the storage has been inactive for longer than \`$_STORAGE_ACTIVITY_TIMEOUT\` (default 1000 ms). Otherwise, the LED will light red when active.*
2929
3030
\`$_INJECTING_LEDS_ENABLED\` - *Default set \`TRUE\`. May be retrieved or set. When \`TRUE\` the LED will blink green on payload execution.*
3131
3232
\`$_EXFIL_LEDS_ENABLED\` - *Default set \`TRUE\`. May be retrieved or set. When \`TRUE\` the LED will blink green during Keystroke Reflection.*
3333
34-
\`$_LED_SHOW_CAPS\` - *Default set \`FALSE\`. May be retrieved or set. When \`TRUE\` will bind the GREEN LED state to the CAPSLOCK state.*
34+
\`$_LED_SHOW_CAPS\` - *Default set \`FALSE\`. May be retrieved or set. When \`TRUE\` will bind the GREEN LED state to the \`CAPSLOCK\` state.*
3535
36-
\`$_LED_SHOW_NUM\` - *Default set \`FALSE\`. May be retrieved or set. When \`TRUE\` will bind the RED LED state to the NUMLOCK state.*
36+
\`$_LED_SHOW_NUM\` - *Default set \`FALSE\`. May be retrieved or set. When \`TRUE\` will bind the RED LED state to the \`NUMLOCK\` state.*
3737
38-
\`$_LED_SHOW_SCROLL\` - *Default set \`FALSE\`. May be retrieved or set. When \`TRUE\` will bind the GREEN LED state to the SCROLLLOCK state.*
38+
\`$_LED_SHOW_SCROLL\` - *Default set \`FALSE\`. May be retrieved or set. When \`TRUE\` will bind the GREEN LED state to the \`SCROLLOCK\` state.*
3939
4040
## ATTACKMODE
4141
4242
\`$_CURRENT_VID\` - *Returns the currently operating Vendor ID with endian swapped. May only be retrieved. Cannot be set.*
4343
4444
\`$_CURRENT_PID\` - *Returns the currently operating Product ID with endian swapped. May only be retrieved. Cannot be set.*
4545
46-
\`$_CURRENT_ATTACKMODE\` - *Returns the currently operating ATTACKMODE represented as 0 for OFF, 1 for HID, 2 for STORAGE and 3 for both HID and STORAGE.|
46+
\`$_CURRENT_ATTACKMODE\` - *Returns the currently operating \`ATTACKMODE\` represented as \`0\` for \`OFF\`, \`1\` for \`HID\`, \`2\` for \`STORAGE\` and 3 for both \`HID\` and \`STORAGE\`.
4747
4848
## RANDOM
4949
5050
\`$_RANDOM_INT\` - *Random integer within set range.*
5151
52-
\`$_RANDOM_MIN\` - *Random integer minimum range (unsigned, 0-65535).|
52+
\`$_RANDOM_MIN\` - *Random integer minimum range (unsigned, 0-65535).*
5353
54-
\`$_RANDOM_MAX\` - *Random integer maximum range (unsigned, 0-65535).|
54+
\`$_RANDOM_MAX\` - *Random integer maximum range (unsigned, 0-65535).*
5555
56-
\`$_RANDOM_SEED\` - *Random seed from seed.bin|
56+
\`$_RANDOM_SEED\` - *Random seed from seed.bin*
5757
58-
\`$_RANDOM_LOWER_LETTER_KEYCODE\` - *Returns random lower letter scancode (a-z)|
58+
\`$_RANDOM_LOWER_LETTER_KEYCODE\` - *Returns random lower letter scancode (a-z)*
5959
60-
\`$_RANDOM_UPPER_LETTER_KEYCODE\` - *Returns random upper letter scancode (A-Z)|
60+
\`$_RANDOM_UPPER_LETTER_KEYCODE\` - *Returns random upper letter scancode (A-Z)*
6161
62-
\`$_RANDOM_LETTER_KEYCODE\` - *Returns random letter scancode (a-zA-Z)|
62+
\`$_RANDOM_LETTER_KEYCODE\` - *Returns random letter scancode (a-zA-Z)*
6363
64-
\`$_RANDOM_NUMBER_KEYCODE\` - *Returns random number scancode (0-9)|
64+
\`$_RANDOM_NUMBER_KEYCODE\` - *Returns random number scancode (0-9)*
6565
66-
\`$_RANDOM_SPECIAL_KEYCODE\` - *Returns random special char scancode (shift+0-9)|
66+
\`$_RANDOM_SPECIAL_KEYCODE\` - *Returns random special char scancode (shift+0-9)*
6767
68-
\`$_RANDOM_CHAR_KEYCODE\` - *Returns random letter number or special scancode|
68+
\`$_RANDOM_CHAR_KEYCODE\` - *Returns random letter number or special scancode*
6969
7070
## JITTER
7171
@@ -81,11 +81,11 @@ export const INTERNAL_VARIABLES_COMMANDS: CommandInfo[] = [
8181
8282
\`$_SCROLLLOCK_ON\` - *\`TRUE\` if on, \`FALSE\` if off.*
8383
84-
\`$_SAVED_CAPSLOCK_ON\` - *On USB attach or SAVE_HOST_KEYBOARD_LOCK_STATE, sets \`TRUE\` or \`FALSE\` depending on the reported OS condition.*
84+
\`$_SAVED_CAPSLOCK_ON\` - *On USB attach or \`SAVE_HOST_KEYBOARD_LOCK_STATE\`, sets \`TRUE\` or \`FALSE\` depending on the reported OS condition.*
8585
86-
\`$_SAVED_NUMLOCK_ON\` - *On USB attach or SAVE_HOST_KEYBOARD_LOCK_STATE, sets \`TRUE\` or \`FALSE\` depending on the reported OS condition.*
86+
\`$_SAVED_NUMLOCK_ON\` - *On USB attach or \`SAVE_HOST_KEYBOARD_LOCK_STATE\`, sets \`TRUE\` or \`FALSE\` depending on the reported OS condition.*
8787
88-
\`$_SAVED_SCROLLLOCK_ON\` - *On USB attach or SAVE_HOST_KEYBOARD_LOCK_STATE, sets \`TRUE\` or \`FALSE\` depending on the reported OS condition.*
88+
\`$_SAVED_SCROLLLOCK_ON\` - *On USB attach or \`SAVE_HOST_KEYBOARD_LOCK_STATE\`, sets \`TRUE\` or \`FALSE\` depending on the reported OS condition.*
8989
9090
\`$_RECEIVED_HOST_LOCK_LED_REPLY\` - *On receipt of any lock state LED control code, sets \`TRUE\`. This flag is helpful for fingerprinting certain operating systems (e.g. macOS) or systems which do not reflect lock keys.*
9191
@@ -95,13 +95,13 @@ export const INTERNAL_VARIABLES_COMMANDS: CommandInfo[] = [
9595
9696
## EXFILTRATION
9797
98-
\`$_EXFIL_MODE_ENABLED\` - *Default \`FALSE\`. Set \`TRUE\` to enable Keystroke Reflection. Will listen for CAPSLOCK and NUMLOCK changes, writing binary values to loot.bin. num=1, caps=0.*
98+
\`$_EXFIL_MODE_ENABLED\` - *Default \`FALSE\`. Set \`TRUE\` to enable Keystroke Reflection. Will listen for \`CAPSLOCK\` and \`NUMLOCK\` changes, writing binary values to loot.bin. num=1, caps=0.*
9999
100100
## OS_DETECT
101101
102-
\`$_HOST_CONFIGURATION_REQUEST_COUNT\` - *Used by OS_DETECT EXTENSION to detect device enumeration count.*
102+
\`$_HOST_CONFIGURATION_REQUEST_COUNT\` - *Used by \`OS_DETECT\` EXTENSION to detect device enumeration count.*
103103
104-
\`$_OS\` - *Used by OS_DETECT EXTENSION to return value of fingerprinted operating system. May return WINDOWS, MACOS, LINUX, CHROMEOS, ANDROID, IOS. These names are reserved and should not be used in user variables.*
104+
\`$_OS\` - *Used by \`OS_DETECT\` EXTENSION to return value of fingerprinted operating system. May return \`WINDOWS\`, \`MACOS\`, \`LINUX\`, \`CHROMEOS\`, \`ANDROID\`, \`IOS\`. These names are reserved and should not be used in user variables.*
105105
106106
`),
107107
text: ""

src/commands/loops.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ WHILE ( $FOO > 0 )
1919
END_WHILE
2020
2121
WHILE TRUE
22-
SRINGLN This is an infinite loop. This message repeats forever.
22+
STRINGLN This is an infinite loop. This message repeats forever.
2323
END_WHILE
2424
\`\`\`
2525

syntaxes/duckyscript.tmLanguage.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@
4141
},
4242
{
4343
"name": "keywords.statement.duckyscript",
44-
"match": "(?<=\\s|\\t|^)(EXTENSION|END_EXTENSION|DEFINE|VAR|IF|ELSE|THEN|END_IF|IF_DEFINED_TRUE|END_IF_DEFINED|WHILE|END_WHILE|FUNCTION|END_FUNCTION|[A-Za-z0-9]+\\(.*\\))(?=\\s|\\t|$)"
44+
"match": "(?<=\\s|\\t|^)(EXTENSION|END_EXTENSION|BUTTON_DEF|END_BUTTON|DEFINE|VAR|IF|ELSE|THEN|END_IF|IF_DEFINED_TRUE|END_IF_DEFINED|WHILE|END_WHILE|FUNCTION|END_FUNCTION|[A-Za-z0-9]+\\(.*\\))(?=\\s|\\t|$)"
4545
},
4646
{
4747
"name": "keywords.truecondition.duckyscript",
4848
"match": "(TRUE|FALSE)"
4949
},
5050
{
5151
"name": "keywords.command.duckyscript",
52-
"match": "(?<=\\s|\\t|^)(STRING|STRING_POWERSHELL|STRING_BATCH|STRING_BASH|STRING_JAVASCRIPT|STRING_PYTHON|STRING_RUBY|STRING_HTML|END_STRING|STRINGLN|STRINGLN_POWERSHELL|STRINGLN_BATCH|STRINGLN_BASH|STRINGLN_JAVASCRIPT|STRINGLN_PYTHON|STRINGLN_RUBY|STRINGLN_HTML|END_STRINGLN|DEFAULTDELAY|DEFAULT_DELAY|DELAY|ATTACKMODE|ENTER|ESCAPE|SHIFT|ALT|CTRL|GUI|DOWNARROW|DOWN|UPARROW|UP|LEFTARROW|LEFT|RIGHTARROW|RIGHT|TAB|CAPSLOCK|DELETE|DEL|END|ESC|HOME|INSERT|PAGEUP|PAGEDOWN|PRINTSCREEN|SPACE|BACKSPACE|BREAK|PAUSE|MENU|APP|F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12|NUMLOCK|SCROLLLOCK|WINDOWS|CONTROL|COMMAND|OPTION|INJECT_MOD|WAIT_FOR_BUTTON_PRESS|LED_OFF|LED_R|LED_G|HID|STORAGE|OFF|ATTACKMODE|RANDOM_LOWERCASE_LETTER|RANDOM_UPPERCASE_LETTER|RANDOM_LETTER|RANDOM_NUMBER|RANDOM_SPECIAL|RANDOM_CHAR|VID_RANDOM|PID_RANDOM|MAN_RANDOM|PROD_RANDOM|SERIAL_RANDOM|HOLD|RESET|RESTART_PAYLOAD|STOP_PAYLOAD|HIDE_PAYLOAD|RESTORE_PAYLOAD|WAIT_FOR_CAPS_ON|WAIT_FOR_CAPS_OFF|WAIT_FOR_CAPS_CHANGE|WAIT_FOR_NUM_ON|WAIT_FOR_NUM_OFF|WAIT_FOR_NUM_CHANGE|WAIT_FOR_SCROLL_ON|WAIT_FOR_SCROLL_OFF|WAIT_FOR_SCROLL_CHANGE|SAVE_HOST_KEYBOARD_LOCK_STATE|RESTORE_HOST_KEYBOARD_LOCK_STATE|EXFIL)(?=\\s|\\t|$)"
52+
"match": "(?<=\\s|\\t|^)(STRING|STRING_POWERSHELL|STRING_BATCH|STRING_BASH|STRING_JAVASCRIPT|STRING_PYTHON|STRING_RUBY|STRING_HTML|END_STRING|STRINGLN|STRINGLN_POWERSHELL|STRINGLN_BATCH|STRINGLN_BASH|STRINGLN_JAVASCRIPT|STRINGLN_PYTHON|STRINGLN_RUBY|STRINGLN_HTML|END_STRINGLN|DEFAULTDELAY|DEFAULT_DELAY|DELAY|ATTACKMODE|ENTER|ESCAPE|SHIFT|ALT|CTRL|GUI|DOWNARROW|DOWN|UPARROW|UP|LEFTARROW|LEFT|RIGHTARROW|RIGHT|TAB|CAPSLOCK|DELETE|DEL|END|ESC|HOME|INSERT|PAGEUP|PAGEDOWN|PRINTSCREEN|SPACE|BACKSPACE|BREAK|PAUSE|MENU|APP|F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12|NUMLOCK|SCROLLLOCK|WINDOWS|CONTROL|COMMAND|OPTION|INJECT_MOD|WAIT_FOR_BUTTON_PRESS|LED_OFF|LED_R|LED_G|HID|STORAGE|OFF|ATTACKMODE|RANDOM_LOWERCASE_LETTER|RANDOM_UPPERCASE_LETTER|RANDOM_LETTER|RANDOM_NUMBER|RANDOM_SPECIAL|RANDOM_CHAR|VID_RANDOM|PID_RANDOM|MAN_RANDOM|PROD_RANDOM|SERIAL_RANDOM|HOLD|RESET|RESTART_PAYLOAD|STOP_PAYLOAD|HIDE_PAYLOAD|RESTORE_PAYLOAD|WAIT_FOR_CAPS_ON|WAIT_FOR_CAPS_OFF|WAIT_FOR_CAPS_CHANGE|WAIT_FOR_NUM_ON|WAIT_FOR_NUM_OFF|WAIT_FOR_NUM_CHANGE|WAIT_FOR_SCROLL_ON|WAIT_FOR_SCROLL_OFF|WAIT_FOR_SCROLL_CHANGE|SAVE_HOST_KEYBOARD_LOCK_STATE|RESTORE_HOST_KEYBOARD_LOCK_STATE|EXFIL|RESTORE_ATTACKMODE|SAVE_ATTACKMODE|RELEASE|SCROLLOCK|RETURN)(?=\\s|\\t|$)"
5353
}
5454
]
5555
},

0 commit comments

Comments
 (0)