Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Obfuscated Perl in PBP

Reply
Thread Tools

Obfuscated Perl in PBP

 
 
amirkarger@gmail.com
Guest
Posts: n/a
 
      05-16-2006
Rather than spend my time reading Perl Best Practices, I decided to
play with the obfuscated code on p. 19. I can't imagine someone would
spend the time to write it if it doesn't do anything, but when I run
it, it just prints "No\n", which isn't very exciting.

In particular, the very beginning,
$;=$/;seek+DATA,undef$/,!$s;$_=<DATA>;
doesn't seem to get anything in $_ because there's no __DATA__ section.

So, do you need to call it with special input, is there a certain
version it works with, did I type it in incorrectly (How come they
didn't include it in the code tarball from O'Reilly?), or what?

"I must know."

-Amir Karger

 
Reply With Quote
 
 
 
 
DJ Stunks
Guest
Posts: n/a
 
      05-16-2006

amirkar...@gmail.com wrote:
> Rather than spend my time reading Perl Best Practices, I decided to
> play with [myself]


Rather than spend my time reading the remainder of this post I decided
to ignore any and all requests made by you in the future.

-jp

 
Reply With Quote
 
 
 
 
amirkarger@gmail.com
Guest
Posts: n/a
 
      05-16-2006

DJ Stunks wrote:
> amirkar...@gmail.com wrote:
> > Rather than spend my time reading Perl Best Practices, I decided to
> > play with [myself]

>
> Rather than spend my time reading the remainder of this post I decided
> to ignore any and all requests made by you in the future.
>
> -jp


Awesome! I haven't been kill-filed since I complimented Baby Bop on
alt.barney.die.die.die!

-Amir

 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      05-16-2006
wrote in news:1147808272.920848.280930
@v46g2000cwv.googlegroups.com:

>
> DJ Stunks wrote:
>> amirkar...@gmail.com wrote:
>> > Rather than spend my time reading Perl Best Practices, I decided to
>> > play with [myself]

>>
>> Rather than spend my time reading the remainder of this post I
>> decided to ignore any and all requests made by you in the future.


....

> Awesome! I haven't been kill-filed since I complimented Baby Bop on
> alt.barney.die.die.die!


And today, you get two for the price of one.

Sinan

--
A. Sinan Unur <>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc...uidelines.html

 
Reply With Quote
 
amirkarger@gmail.com
Guest
Posts: n/a
 
      05-17-2006

Ferry Bolhar wrote:
> Amir Karger:
>
> > In particular, the very beginning,
> > $;=$/;seek+DATA,undef$/,!$s;$_=<DATA>;
> > doesn't seem to get anything in $_ because there's no __DATA__ section.

>
> And who tells you that this isn't expected behaviour? Reading from
> <DATA> when there is no __DATA__ section is the same as reading
> from a filehandle which was opened for an empty file or when the file
> end was reached already - it just returns "undef" and sets the EOF
> condition true for the filehandle.


Well, IF there's a __DATA__ section, then seek undef $/, 1; $_=<DATA>
does in fact get you the entire program (including whatever's in
__DATA__). But without a __DATA__ section, you don't get anything. So
yes, I've seen obfuscated examples that do this, but I don't see how
you can get anything useful without a __DATA__. Which is why I feel
like I must be missing something.

>
> I havn't the "Best Practices" book here, so I can't look for the
> example, but I have seen many obfuscated examples for printing
> out "Just another Perl hacker", wherein often the code works
> just by using more or less documented side-effects in constructs.
> So while the code snippet you posted makes no sense at the first
> view, this doesn't mean that it will not make sense in the entire
> example.
>
> It's up to you to get the solution...


I can play with putting stuff in __DATA__. But figuring out what code
does when you don't even have the whole program is even harder!

There was definitely no __DATA__ in the example. (In fact, the example
was about code indentation, and had a boss sending email to "you"
saying, "I came across this chunk of code in your lateset module...."
and '>' quoting the code.

-Amir

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ANN: 2005 International Obfuscated Ruby Code Contest (IORCC) iorcc@yahoo.com Perl 0 03-18-2005 11:44 PM
obfuscated Lloyd Jones Computer Information 9 07-02-2004 09:18 AM
obfuscated c/c++ Thomas Garai C++ 5 06-22-2004 08:05 PM
Help...I feel Obfuscated, but I need to decompile something.. chris kramer Java 5 04-09-2004 09:17 PM
Obfuscated xsl fix XML 4 11-28-2003 05:08 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57