Continue on to read the exciting adventures of boo_radley on IRC!
TIME PASSES AND THE CODE IS DEPARSED<booradley> $_=""; <booradley> if (samanda) {print "eek"} <booradley> then <booradley> $_="m"; <booradley> if (samanda) {print "eek"} <booradley> the first one tests true, but the second doesn't. Why? <ar0n> samanda? <ar0n> Where is samanda defined? <booradley> ah ah <ar0n> Whhat <booradley> it's not defined at all. <booradley> I though it would be interpreted as : <booradley> $_="m"; <booradley> if (s amanda) {print "eek $_"} <booradley> (to be a little clearer) <Juerdje> deparse it
CHAPTER 3 : Too Tricky For His Own Good!<Juerdje> samanda seems to be an unquoted string, and therefore always true <booradley> aah <Juerdje> which will get optimized away <Juerdje> so there's no if(){} at all in the deparsed result <Zaxo> work like you want for me, with the space affter s <Juerdje> with the space after it, it'll be interpreted as s/m/nd/ <Juerdje> space is only optional for a non-whitespace non-alphanumeric character <booradley> I thought the separator/ delimiter rules of s/// would tak +e precidence, but I guess that was stupid :-) <Juerdje> (afaik, you can't use whitespace as a delimiter in current versions anymore) <Juerdje> booradley: if the space were optional, it'd be a regex, but the space can only be left out for non-alphanumeric characters
The character I used was (A + COMBINING GRAVE ACCENT), but I wonder if this was a result of my editor, or one of our IRC clients translating the character into something else? Here's a small example which works appropriately (or my estimation of appropriately)*booradley tries using a unicode character for a delimiter. <Juerdje> hmmm <booradley> keen <booradley> unicode will usher in a new world of obfu :-) <Juerdje> it works? <booradley> yep <Juerdje> omg <booradley> sámándá <booradley> HOO HOO HA HA HA <Juerdje> omfg <booradley> pheer <Juerdje> is that unicode? <Juerdje> looks like a normal chr(255) <Juerdje> hmmm <Juerdje> 225
$_="I am you"; print if (sámándá);
I'm curious to hear your comments or opinions.
In reply to Unicode and the fine art of obfuscation by boo_radley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |