Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

One-liner .sig

by BlueLines (Hermit)
on Dec 12, 2000 at 05:15 UTC ( [id://46199]=obfuscated: print w/replies, xml ) Need Help??

This was actually written by a co-worker of mine. Works under linux for sure (i don't know how other *nix systems deal with /dev/dsp). I have no idea (perl-wise) how this works, and would appreciate any explanation...

perl -e 's>^>gps%o)nbq|3++sboe~1//24*|qsjou)qbdl)#d#-75+)\ tjo)%o+%`*,2***gps)1//777*<~>;y>#-~>"-}>;eval;' > /dev/dsp


BlueLines

Disclaimer: This post may contain inaccurate information, be habit forming, cause atomic warfare between peaceful countries, speed up male pattern baldness, interfere with your cable reception, exile you from certain third world countries, ruin your marriage, and generally spoil your day. No batteries included, no strings attached, your mileage may vary.

Replies are listed 'Best First'.
Re: One-liner .sig
by cogent (Monk) on Dec 12, 2000 at 09:44 UTC

    Cogent takes a shot at his first de-obfuscation...

    So, we have three things going on: A substitution,a transliteration, and an eval. (Which, had I realized it, I could've found out from the Function Nodelet.)

    All three of the operations are working directly on $_. The first, the substitution, does the easy part: it replaces the only thing in $_, a zero-width beginning-of-line metacharacter, with some predetermined text:

    gps%o)nbq|3++sboe~1//24*|qsjou)qbdl)#d#-75+)tjo)%o+%`*,2***gps)1//777* +<~

    Now $_ contains something useful. In a manner of speaking. Then the code transliterates that into something truly useful, by changing everything between ASCII 35 and ASCII 126 to be between ASCII 34 and ASCII 125. It drops everything down a place. Basically your simple caesar cipher. That gives us:

    for$n(map{2**rand}0..13){print(pack("c",64*(sin($n*$_)+1)))for(0..666) +;}

    which is much more readable, especially if you have an eager newbie with something to prove ( :-) ) here to help you out:

    for $n (map {2**rand} 0..13) { print ( pack ("c", 64*(sin($n * $_)+1))) for(0..666); }

    For fourteen times: It takes two, raises that to the power of some random number, and uses that as the frequency of a sine wave. The duration of said sine wave is specified by the 666. So, for the duration (that is, for 667 iterations of a loop), the code makes a byte and sends it to /dev/dsp. So there's your sound.

    Whew!

      I've always been scared to try and de-obfusticate. Now I know I've right; keep me out of there! I'm not ready yet.

      Fu ..., er, simply amazing cogent and whomever created it. Oh, and ++ to LW to, I guess.

      a

Re: One-liner .sig
by marius (Hermit) on Dec 12, 2000 at 11:37 UTC
    For those of us on non-/dev/dsp supported systems, anyone care to comment as to what the sound is? Is it just a sine wave, as cogent suggests but doesn't affirm? Is it just a bleep? Is it something clever? I presume it's the sine wave, but didn't see an affirmation from anyone.

    -marius

      Ah, sorry. It's actually fourteen fairly short (on my system, at least) beeps of random pitch. I presume that the sine waves are the (very low-level) way of making the sound wave for each beep, but that's a guess, as I don't really know how /dev/dsp works.

      I could probably make a wav, given enough time...

        That would me moderately frightening if you could cause it to speak your name. Granted, it would no longer be a One-Liner .sig. =]

        -marius

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://46199]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-25 04:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found