Skip to content

Conversation

@fpacenza
Copy link

@fpacenza fpacenza commented Mar 6, 2025

What's new

  • Added the possibility to define constants via the DEFINE command
  • Added the possibility to define variables via the VAR command

Syntax

DEFINE

DEFINE NAME VALUE
or
DEFINE #NAME VALUE

where

DEFINE denotes the start of a constant definition
NAME or #NAME is the label or key used to locate usage within your payload
VALUE is the value to replace matching instances of NAME throughout your payload

VAR

VAR $NAME = VALUE

where

VAR denotes the start of a variable definition
$NAME is the variable name used to locate usage within your payload
VALUE is the value to replace matching instances of NAME throughout your payload

Verification

Create an example payload like the following one and run it.

Payload Example

STRINGLN --------- START TEST ---------

DEFINE CONSTANT constant value
DEFINE #CONSTANT constant value using # symbol
VAR $variable = my variable value

STRINGLN this is the value of the constant: CONSTANT
STRINGLN this is the value of the #constant: #CONSTANT
STRINGLN this is the value of the variable: $variable

STRINGLN --------- END TEST ---------

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@fpacenza fpacenza changed the title added constants and variables definition Added support for constants and variables definition to BadUSB Mar 6, 2025
@fpacenza fpacenza changed the title Added support for constants and variables definition to BadUSB BadUSB: Added support for constants and variables definition Mar 6, 2025
@hedger hedger added USB BadUSB + physical USB interface New Feature Contains an IMPLEMENTATION of a new feature labels Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Feature Contains an IMPLEMENTATION of a new feature USB BadUSB + physical USB interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants