Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

die if lie! fun with Win32

by Discipulus (Abbot)
on Nov 12, 2018 at 10:27 UTC ( #1225619=obfuscated: print w/replies, xml ) Need Help??

Hello nuns and monks!

I'm not an obfusctor, but as Win32 is obfuscated per se i present you this little lie/truth game

use Win32; exit unless @}; $ms = \&Win32::GetSystemMet +rics if $^O; END{ exit if @};while(<DATA>) { s/\s//g ; push @} , jo +in '', map {chr (($^O =~ s/\D+//r)+$_)}( $_ =~ /\d{2}/g ) } seek DA +TA, 0, 0; ; $s.=$_ for<DATA>;die if !eval $s; system('cls'); print $ +^O,' ', map {uc $_} substr($} [4], 0, 1 ), substr ($}[0] , 7 , 1), sub +str( $}[5] ,4,1), substr ($}[8],1,1), $/;} map{die 'lie!' unless($$_[1 +]->($$_[2] )?6:7 )== Win32::MsgBox($}[$$_ [0]] . "?", 4, $0); }[0, $ms +,75], [1, $ms, 91], [2, $ms, 23],[3,$ms, 0x2004], [4,$ms, 67],[5, $ms +,0x2003]; map { print $}[$$_[0]]. "?\n"; <STDIN> eq $$_[1] ( $$_[2] ). +"\n" or die'lie!'}[6,$ms,80],[7,$ms,0], [8,$ms,1]; eval '#!perl' unle +ss $^O; __DATA__ 777 9 8 5 8 36 9 00 7265 830 08 669 82 847 36 765 760 08 7726 +96 976 77 79 858 36 90 0726 5830072798 27390 7978 84 65 76 00 8772 69 +69 76 7 7 7 98583 69 0 0 66 8 58 4847 97 8830 0658 26900 83 876 58080 + 6968 73 8 30 08 4 726 90 080 670 073 78 006 8 79 67 756 96 80 077 796 + 869 74 85 8 3 84006 67 9798 4007378 007 065 7376 1383 6570 69 007779 +6869 89 798 500 808 5840 08 0670 079 78 0 08 37 6 6 58 4 69 0 07 779 6 +869 72798 70077 65788 9007 77 97873 84798283 0068790089798 500726 58 +669 87726584078 3008472690087736884 720079700070738 28384008367 826969 +78 8772658407830084726900726973717 284007970007073 8283840083678269697 +8

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re: die if lie! fun with Win32
by null recurrent (Novice) on Nov 13, 2018 at 04:51 UTC

    I don't actually have a proper Windows Perl, but with a little help it even works from Cygwin's bash:

    perl -e 'BEGIN{ $^O = "MSWin32"; } require("./die_if_lie.pl")'

    Cygwin doesn't know CLS, so the system() does nothing and I just don't lose my scrollback.

    Pretty cool!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (13)
As of 2019-10-18 13:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?