Added support for constants and variables definition to BadKB#372
Added support for constants and variables definition to BadKB#372fpacenza wants to merge 6 commits intoNext-Flip:devfrom
Conversation
|
unfortunately this came in at a bad time. badkb was behind on a few OFW refactors, since those refactors did not add any functionality that badkb didnt already have, but it meant that it was quite differently structured. i just spend the last 3 days rewriting badkb on top of ofw's "new" badusb structure, so now this pr will probably need some reworking. also, i would prefer if you tried to contribute this to official firmware first, everything that gets added downstream here becomes an additional maintenance burder when inevitably ofw will change things once again. if they reject these additions, then i will have a look and possibly accept them here |
|
Alright! I make a pull request on the OFW, and it’s awaiting review. |
# Conflicts: # applications/main/bad_kb/helpers/ducky_script.c # applications/main/bad_kb/helpers/ducky_script_commands.c # applications/main/bad_usb/helpers/ducky_script_i.h # applications/main/bad_usb/helpers/uthash.h
|
closing as you have opened flipperdevices/flipperzero-firmware#4141 and we could merge that downstream here in case. |
What's new
DEFINEcommandVARcommandSyntax
DEFINE
DEFINE NAME VALUEor
DEFINE #NAME VALUEwhere
DEFINEdenotes the start of a constant definitionNAMEor#NAMEis the label or key used to locate usage within your payloadVALUEis the value to replace matching instances ofNAMEthroughout your payloadVAR
VAR $NAME = VALUEwhere
VARdenotes the start of a variable definition$NAMEis the variable name used to locate usage within your payloadVALUEis the value to replace matching instances ofNAMEthroughout your payloadPayload Example
DEFINE CONSTANT constant valueDEFINE #CONSTANT constant value using # symbolVAR $variable = my variable valueSTRINGLN this is the value of the constant: CONSTANTSTRINGLN this is the value of the #constant: #CONSTANTSTRINGLN this is the value of the variable: $variableFor the reviewer