usbrubberducky-payloads/payloads/examples/Operators/Operators-example3.txt

1 line
433 B
Plaintext

REM Bitwise operators are operators which operate on the uint16 values at the binary level.
ATTACKMODE HID STORAGE VID_05AC PID_021E
VAR $FOO = $_CURRENT_VID
REM Because VID/PID parameters are little endian,
$FOO = ((($FOO >> 8) & 0x00FF) | (($FOO << 8) & 0xFF00))
REM $FOO will now equal 0xAC05
REM The value of $_CURRENT_VID is saved into the variable $FOO as AC05.
REM Using bitwise operators its endianness is swapped to 05AC.