That explains it. The left arrow (is that decimal 27, or decimal 17?) is not a printable character on most systems. On DOS, of course, almost all (over 250) of the 256 Extended ASCII characters are printable (there are even visual representation for CR and LF), but on other systems many of them are not. Windows 9x took away the top half (characters above 127 are different from one Windows system to another, depending on stuff), but many of the lower chars (below 32) are still printable. But that's not portable at all, because those are control characters, and on many systems they do stuff. Also, some hardware (dumb terminals, especially) is physically incapable of displaying them; there is no visual representation for them, but if they are sent they control the behavior of the terminal in various ways. Apparently, gnome-terminal (and therefore probably most Linux terminals and consoles) handle the character you printed in a way that causes the following character to not show. It might do something different on a different type of Unix, however, let alone VMS or what-have-you.

My ASCII chart shows leftward arrows for 027 and 017; the former is ESC and is used in ANSI escape sequences. (You can also use ANSI escape sequences on DOS if you have ANSI.SYS, which used to be a standard thing almost everyone installed back in the days of DOS 3. We used it to have our prompt be different colors, put the time on the top line of the screen, and stuff like that. Some Win32 terminal emulators also support these, but I don't know about the Windows command prompt.) This might be what is happening. If so, it might actually be somewhat more portable than what I described; ANSI sequences are almost approximately similar to something that might be described as nearly standard. OTOH, if the character is just being taken as a garden-variety control character by the terminal (which is almost certainly the case if it's decimal 17), then like I said behavior might vary considerably from system to system.

It is also entirely possible that this might not work out exactly the same way in NT/2K/XP as it does in Win9x/Me, because the behavior you are seeing in Windows is descended from DOS, and NT might never have implemented it that way.

sub A{while($_[0]){$d=hex chop$_[0];foreach(1..4){$_[1].=($d %2)?1:0;$d>>=1;}}return$_[1];}sub J{$_=shift;while($_){$c=0; while(s/^0//){$c++;}s/^1//;$_[1].=(' ','|','_',"\n",'\\','/' )[$c]}@_}$PH="16f6da116f6db14b4b0906c4f324";print J(A($PH));

In reply to Re: Trying my hand at obfuscation by jonadab
in thread Trying my hand at obfuscation by Bismark

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.