Path: blob/master/payloads/examples/Conditions/Conditions-example5.txt
2968 views
REM The syntax of IF states that in nearly all cases the expression should be surrounded by parenthesis ( ) — however there is an exception to this rule.1REM If the condition of only one variable is true or false, the parenthesis may be omitted. This results in a slightly smaller encoded inject.bin file as well as slightly faster payload execution. This is because it removes the step of first reducing the order precedence.23REM Example of optimized and unoptimized IF statements4REM Consider5VAR $FLAG = TRUE67IF $FLAG THEN8STRING FLAG is TRUE9END_IF1011REM versus1213IF ( $FLAG == TRUE ) THEN14STRING FLAG is TRUE15END_IF161718REM In the first example, the IF statement without the parenthesis results in a 6 bytes added to the compiled inject.bin file.19REM In the second example, the IF statement surrounded by parenthesis results in 16 bytes added to the compiled inject.bin file.202122