Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

out of the box request for assistance

by dpatrickallen (Novice)
on May 06, 2014 at 23:21 UTC ( #1085253=perlquestion: print w/ replies, xml ) Need Help??
dpatrickallen has asked for the wisdom of the Perl Monks concerning the following question:

I want to be upfront that everything I know about Perl - I just learned today. I had some Basic, Pascal, and Fortran classes in HS and college in the late '80s, but that background has not helped me at all here.

Anyway, I geocache. Most geocaches are straight forward. Some require you to solve a puzzle, after which the coordinates of the cache are revealed. That is where I need a little help.

On the geocache page in question, there was ASCII art forming the MIGO (Michigan Geocaching Organization) logo. After studying it for longer than I care to admit, I came to understand that the text was Perl. I ran the text on codepad.org (http://codepad.org/PruKUpjb) and the output was a web page (http://schartz.net/gpc?q=71126). If you change the number after the q, it gives you a hint, "Hmm.. perhaps you should think about how you got this URL."

I have tried running just parts of the code, and determined that everything after the eval command in line 48 can be removed without changing the output, but I am far from figuring out what any of the code means.

I hope that I am in the correct forum. The code sure seems unnecessarily complicated/obfuscated!

Any tips on how a complete novice might be able to break the code down? Any tools where I could step thru the code and track the values of the variables? Any tips on what parts of the code are meaningful and what parts are not? Is it obvious to someone who can read Perl what the next step would be, or what the coordinates would be? Any help or advice at all would be much appreciated!

$_ = q^$_V =q??; ?_?{$_V .=chr(ord ($_) -20)} _??_?//,q/P N; EhP7\c?kAWN: 9fQ;\ bOZIh?jQdLgqeC GPe@Dtt/; __?5?( u?4_k("\165",$_V)^;s/\?_\?/\155\x61p/; s/_\?\?\_\?/ \163 \160\x6ci\164/;s/__\?5\?/\x70r\151\x6et/; s/\?4\_/n\x70a\x63/; $/='-ddxxX888/.ls998l09\\99/88q\qqq\9988888_mI.oM//4448g8g8a9s99Mmm +MM8nAM\ =mj/q0q0=8889mK893343ds\\3ankMS-migo—M42d11m010orw83m07d343s/343// +3/?=//\ “”==HHHH+W+++W+++++s\\\\\ ---- - //// ---#-q0q000q0ew9rs \\ 8 +w888833/ “”=Vwwww[]ww8q0001””=======”” 992a0a00s/3242d.c99090 \\ + =jjij3333 _ “{{MmMMmmmsmmm.a8**EhP7\c?kAWNEhP7\c?kAW/ \\3 +as/\W=WWWW_\_mm\\ `###64/;s/__\?5\?/\x70\s/ “ +\/ JKLMM893343ds\8933 /.l + I \\VVMMMVVV--” //” /” +” 3m s/00q/8?/ “ II. +tokMMMMM\ HH(_#$” \$= + === =_@!\mm #wwwww/ __w +w.iwwMM12MM211nn /P9 o""M$_; +44 $_=/2/2//qw/.m\ {sw m P4,$a=_ +$__$ $$MM#M#3333PPL ` // M=#-d-4 +-_$;;$//x092/x092// .eMM H^/;$*= +$ff;;k/55/2398xxsK 08S**P ';$/=~/( +(?<=\.).).*?((?<=##\ ####. .#### ### .m####m. .m###mm. H0,87MmM164=;s=_ +_?5?x70r15xq09cat(8M ####A J#### ___ m##” “V##} m##”””w##m ^8?x70r15xq09;val; +8sqq=434f4e47524154P ###=#mJ#P### ### :### _____ :### ### X53425554544849534 +9534e534953;=x89\/8} ### #### ### ### '### ##### '### ### ##\/GCYXJOZIh?jQdL +gq??_???x61pn\x70a9 ### '##' ### ### '##m m##” '### m###' m-\....\.-\-.\-.-\. +..\x?aw^002073023^” ### ## ### ### `#####” “####” m\...\-\.-\-.\.-...\ +.-.\..-\-\....\0P #A..-.\---\.-.\-\.... +\.\..-.\..-\-.87 \.).).*?((?<=\.).).*? +(( ?<=\.).).*?[ mMMm. M I C H I G A N #}s X s\/x303aFaD0 +2aFa4\/033w00t! 8AF42N16A .#e4r5GKWYA_WIDJJ_HJQ +UA_PLOKD_LSS JA_PROQK_L G E O C A C H I N G ]*?[w('0d').e(ord(8a) +);hiJJM88\023\442\32\32\22\s #ewf(0)(0)(D)(G)#8(S0 +)(S2)x(s)(S4)(S1).(3)(F)(L)# O R G A N I Z A T I O N “]*((?<=\.).).*?((?< +=\.).).*?((?<=\.).).*?[a##@]* ((?<=\.).).*?((?<=\. +).)/xgs;$_M=q^//....?gorgehiK www.mi-geocaching.org \jj$4.$2.$3.$8.$3.$ +1.($4$8$2)MMMM\\""""?erRocks^; $q=qq($6$7$8$9);$q +='('.$1.$2.$3.$4.$5.$q.'('.$q. '))[6]*13,"\n"';$_ +.='.'. $q.") #($2q$q$GCP1P3^qq. [$_=$_$9-14-2-34-5 +-67-882-7-44-2-9-43-2-3-44-5-5” [cat($qq);$_=$@;@d +og(70,82,69,67,75,76,69,83);RM [dval;aval;$a$1000 +$6.qq?__?ww?__?d?__?4?81?_#@! [+4*2+3/2+5*1+3*3+ +2*7+7*4+$a;$a=5*9+2*19+14” M";s/\s*//g;eval;# +?$=GC;GC=12;GC2=14d;$_=q# /#$w=www=wq;$0x000q +0w0;$wcat=$9;#qq#qw#GC#M” /;#338a5f528d9s99a09 +3j00s900a93jd90j309s0M #H-#-#s--#k#-#-d#-#e# +-#l-#a-#w#a#s#here#>MP #{stash?}\014\030\037\ +017\052\033\#GCYXJW=$ $MM;#$_=;$=a67815;^Hin^ +TendGC019+TC=TT+71=@”

Comment on out of the box request for assistance
Download Code
Re: out of the box request for assistance
by choroba (Abbot) on May 06, 2014 at 23:28 UTC
    In similar situations, I usually start with B::Deparse. In this particular case, the output doesn't seem much helpful, though.

    To run the code statement by statement with the possibility to inspect variable values, use the debugger: just run the code with perl -d. See perldebug for more details.

    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: out of the box request for assistance
by toolic (Chancellor) on May 06, 2014 at 23:32 UTC

      Thanks for the assistance! I just solved the puzzle and got the coordinates. The geocache is GC1KJ04 - Only on Sundays for any geocachers out there in the Perl community.

      I am completely new here. Is there a way for me to rate your replies as helpful to give you points or something - if so I would be happy to do so, I just don't know how.

        See Voting/Experience System for details. You might need a higher level to be allowed to vote.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1085253]
Approved by toolic
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2014-12-21 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls