Page 2 of 6

Posted: Wed Aug 09, 2006 3:39 pm
by hawleyjr
jayshields wrote:@hawley: I don't get it. Is this a variant of that brainf*ck language thing? I was gunna attempt something like that but it said pure PHP only. Your test page just shows a weird string. How do I reverse a string?
Oops. I hardcoded the string. I'll update my code...

Posted: Wed Aug 09, 2006 3:39 pm
by infolock
You have to seperate the IiIo stuff to see the string. If you take those out, you can read the script as there are just some comments around each variable declaration all jumbled on the same line.

Posted: Wed Aug 09, 2006 3:40 pm
by Chris Corbyn
Nice hawley, nice. How do you use it? I went to the page but just saw code.

Oh yeah....

?looc nikaerf os krowtenved tnsi

Posted: Wed Aug 09, 2006 3:46 pm
by hawleyjr
I updated the code to accept a variable. Also, changed the URL to:

http://jameshawley.com/forum/devnet.php?IO0=HAWLEYJR

Posted: Wed Aug 09, 2006 4:00 pm
by Weirdan
sorry, hawleyjr, according to the rules your script must accept $_GET parameter with string to reverse.
Image

Posted: Wed Aug 09, 2006 4:02 pm
by hawleyjr
Weirdan wrote:sorry, hawleyjr, according to the rules your script must accept $_GET parameter with string to reverse.
Image
I already fixed that Image
hawleyjr wrote:I updated the code to accept a variable. Also, changed the URL to:

http://jameshawley.com/forum/devnet.php?IO0=HAWLEYJR

Posted: Wed Aug 09, 2006 4:05 pm
by Weirdan
hawley's script deciphered (original version):

Code: Select all

 
<?php
$input = 'IIIi$oI1Io==1=' . 'Ii11io1ii1ioIOIo=';
echo $input;
$strlen = create_function ('$str','
    $length=0;
    for($i=0; $i < strlen($str); $i++) {
        $length++;
    }
    return $length;
')
;
for($index = $strlen($input); $index >= 0; $index--) {
    echo $input[$index];
}
?>
 

Posted: Wed Aug 09, 2006 4:09 pm
by Ollie Saunders
hawleyjr you script left my jaw gaping.
I am considering frameing it :D:D

Posted: Wed Aug 09, 2006 4:16 pm
by RobertGonzalez

Code: Select all

<?php 
/*****************************************************************************/
/************************************** **************************************/
/*************************************   *************************************/
/************************************     ************************************/
/***********************************       ***********************************/
/**********************************         **********************************/
/**********************************   (O)   **********************************/
/**********************************         **********************************/
/***********************************       ***********************************/
/************************************     ************************************/
/*************************************   *************************************/
/************************************** **************************************/
/*****************************************************************************/
/*<>-->*/$s=(isset($_GET['s']))/*<>-->?<--<>*/?/*!$$et*/$_GET['s']:'';/*<--<>*/ 
/*_-^-_()<-0o0->()*/$sd=/*== -&<=> ==*/(isset($_GET['s']));/*_-^-_()<-0o0->()*/
/*(/'"'\)while- >< -([A-Za-z0-9?])`field`!=`yesterday =date($doggie)phpspat__*/
/*(*)*/$sc=/*require(['@#']);$beersgonewild=*/strlen($s);/*&$hawley->drunk($u*/
/*file_get_contents($somerandomarbitrarytextstringtogetfromalongassvariable);*/
/*$string='itwasacolddayinweeweelandwhenheawoketosoakedsheetsandapandlaughing*/
/*//\\_--_//\\*/$sn=/*'anotherlongabitrarystring';*/'';/*$0->make=&new Me();-*/
/*()*\__e();*/$se=/*$october=coldweatherexceptforburrito;*/'';/*chr(5).chr(1)*/
/*function malbec() {*/$y=/*global $warming,$kills,$fish,$for,$bbq;*/$sc-1;/**/
/*['^@#\s\t\n\\/'"";'/\\]*/while/*$we->gosailing();*/($y >= 0)/*try($_sleep);*/
/*throw(Exception $vestibule)*/{/*becauseIcan*/$sn.=/*if($s)*/$s{$y};/*||$y  */
/*<-->kill($y);*/$y-=1;/*||$so-I-was-told;//butwhoreallyknowsthesthinganyway?*/
/*{*/}/*}--{*/if /*$y;>;<;str_replace(1,'1',$_1);*/($sd)/**/echo $sn;/*die();*/
/*$new_string='butikeptthepursuitforalongwhilethinkingthepimphaditcoming...';*/
/*****************************************************************************/
/************************************** **************************************/
/*****************************************************************************/
/*************************************   *************************************/
/**********************************         **********************************/
/*******************************               *******************************/
/*****************************        (O)        *****************************/
/**********************************         **********************************/
/***********************************       ***********************************/
/************************************     ************************************/
/*************************************   *************************************/
/************************************** **************************************/
/*****************************************************************************/
?>
EDIT | I know it goes against out rules, but using php tags gives it away. So it is wrapped in code tags. Sorry.

This one works. Thanks Hawley, love that style. I screwed the pooch on it, but it looks pretty. Anyhow, new one to try is at http://www.codecompare.com/sonew.php. Blank on load, reverse string on passing of ?s=stringtoreverse.

Posted: Wed Aug 09, 2006 4:24 pm
by hawleyjr
Weirdan wrote:hawley's script deciphered (original version):

Code: Select all

 
<?php
$input = 'IIIi$oI1Io==1=' . 'Ii11io1ii1ioIOIo=';
echo $input;
$strlen = create_function ('$str','
    $length=0;
    for($i=0; $i < strlen($str); $i++) {
        $length++;
    }
    return $length;
')
;
for($index = $strlen($input); $index >= 0; $index--) {
    echo $input[$index];
}
?>
 
lol, I could have given that to you if ya wanted ... :roll:

Posted: Wed Aug 09, 2006 4:29 pm
by hawleyjr
I’m starting to sense some criticism on the level of code I submitted. However, according to Wikipedia
Obfuscated code is source code that is (perhaps intentionally) very hard to read and understand.
Therefore, you don’t necessarily have to write a complex 3 page function when all you need to do is make code ‘Hard to Read’

Posted: Wed Aug 09, 2006 4:30 pm
by Weirdan
lol, I could have given that to you if ya wanted ...
That would be boring Image

Posted: Wed Aug 09, 2006 4:34 pm
by RobertGonzalez
His code lit up when run through the highlighter. I still love the layout though. That is some sweet stuff, as evidenced by my tribute to Hawley with my less than stellar copy cat version...

Posted: Wed Aug 09, 2006 4:45 pm
by ody

Code: Select all

<?php while($_=(!$_?72:($_==72?101:($_==101?108:($_==108?109:($_==109?111:
($_==111?44:($_==44?32:($_==32?87:($_==87?112:($_==112?114:($_==114?666:
($_==666?100:($_==100?33:($_==33?0:1)))))))))))))))echo chr($_==109?108:($_==112?
111:($_==666?108:($_))));?>
Every programmer starts with this little program.. ;)

I've noticed a lot of comment filler in other code.. does that even count?

EDIT: Sorry just read the thread as Obfuscated code.. didn't relise there was a spec untill I just read it completly :? Obfuscated spec?!

Posted: Wed Aug 09, 2006 4:53 pm
by RobertGonzalez
It just needs to be hard to read while still achieving the desired task. Comment filler can be used. I think.