Reply to post: Backspace Packing

10 PRINT Memorial in New Hampshire marks the birthplace of BASIC

JeffyPoooh
Pint

Backspace Packing

Within many environments, the user display will dutifully obey the backspace character (ASCII 8), even embedded within the script or code. So by packing in some ASCII backspaces (using a routine to replace a placeholder character with ASCII 8), actual code can be hidden 'beneath' the backspaces, and decorative fake code can be displayed (after a hidden REM).

A BASIC example (from ~36 years ago):

10 PRINT "Yes!"; REM ^h^h^h^h^h^h^h^h^h^h^h "No!"

LIST

10 PRINT "No!"

RUN

Yes!

By this means, what is apparently listed and what is actual hidden code can be perfectly independent. The only clue might be the file size, if they're paying attention and counting characters.

Any environment that obeys the backspace is vulnerable to this mischief.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon