PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Sep 30, 2020 4:06 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 82 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject:
PostPosted: Sat Sep 09, 2006 1:11 pm 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5978
Location: Odessa, Ukraine


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 09, 2006 1:31 pm 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5978
Location: Odessa, Ukraine
Feyd, I have a question regarding this part:
Syntax: [ Download ] [ Hide ]
 
function func($arg) { // decodes html page using filename as a key
// te_lBO0A3obw-GYX5hknqCFKu94vdsHD7cJQPLETfSg6R2IZUmVWMpia1rxNy8jz.php
    list($filename) = explode('.',basename(__FILE__));
    $ret = false;
    $str = null;
    for($i = 0, $l = strlen($arg); $i < $l; ++$i) {
        $str .= str_pad(
            /*input*/decbin(
                strlen($filename)-strrpos($filename,$arg[$i]) % strlen($filename)-1 // offset of the current character
                                                                                    // from the end of the filename
            ),
            /*pad length*/6, // 6 (why 6, shouldn't it be 8?)
            /*pad string*/0, // 0 (zero)
            /*pad type*/STR_PAD_LEFT // STR_PAD_LEFT
        );
 
        while(strlen($str) >= <!-- s8) --><img src=\"{SMILIES_PATH}/icon_cool.gif\" alt=\"8)\" title=\"Cool\" /><!-- s8) --> {
            $ret .= chr( bindec( substr($str, 0, <!-- s8) --><img src=\"{SMILIES_PATH}/icon_cool.gif\" alt=\"8)\" title=\"Cool\" /><!-- s8) --> ) );
            $str = substr($str, <!-- s8) --><img src=\"{SMILIES_PATH}/icon_cool.gif\" alt=\"8)\" title=\"Cool\" /><!-- s8) -->;
        }
 
    }
    return $ret;
}
 

why did you use 6 as pad length?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 09, 2006 4:58 pm 
Offline
DevNet Resident
User avatar

Joined: Sun Sep 03, 2006 5:19 am
Posts: 1579
Location: Sofia, Bulgaria
I haven't had time to check the actual code, so not knowing what is passed as $arg, I'm not sure of the purpose of this snippet.

At first glance I thought "Wait, we've seen that" (infolock's code), but then the 6 is out of place ;)

What is really happening is that you get a stream of magic numbers ("offset of the current character from the end of the filename" according to your comments) and pack them in a bit stream, but only taking 6 bits of each. The while() loop waits for a whole 8-bit character in this stream, and gets it out. I hope my blabber is clear enough ;)

P.S. Think of it as a machine for exporting beer from USA to Ukraine ;) On the input you have American sixpacks, but since they all know how much you ex-Soviets guys drink, they repack it by eights ;)

(Чтобы ответить на твой вопрос в этот трэд с jmut - да мы Болгары, случайно понял это и поздравил :) )


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 09, 2006 6:35 pm 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5978
Location: Odessa, Ukraine


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 09, 2006 7:59 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
Correct, it is my own construct of base64. I added the reversal to add a tiny twist in the mix and make it a bit more interesting. :) Same with the shifts, string lookups, use of the filename and such.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 10, 2006 6:31 am 
Offline
Jedi Mod
User avatar

Joined: Tue Dec 21, 2004 6:03 pm
Posts: 5263
Location: usrlab.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 13, 2006 7:50 am 
Offline
Forum Regular

Joined: Wed Aug 09, 2006 8:36 am
Posts: 748
Location: Staffordshire, UK
Here goes for the shortest:

Syntax: [ Download ] [ Hide ]
 
$a = $_REQUEST["a"];
echo strrev($a);
 




Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 13, 2006 8:17 am 
Offline
DevNet Resident
User avatar

Joined: Sun Sep 03, 2006 5:19 am
Posts: 1579
Location: Sofia, Bulgaria


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 21, 2006 1:40 pm 
Offline
BeerMod
User avatar

Joined: Tue Jan 13, 2004 5:58 pm
Posts: 2170
Location: Jax FL & Spokane WA USA


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 21, 2006 2:06 pm 
Offline
Jedi Mod
User avatar

Joined: Tue Dec 21, 2004 6:03 pm
Posts: 5263
Location: usrlab.com


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 21, 2006 2:37 pm 
Offline
DevNet Resident
User avatar

Joined: Sun Sep 03, 2006 5:19 am
Posts: 1579
Location: Sofia, Bulgaria


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 21, 2006 4:39 pm 
Offline
Jedi Mod
User avatar

Joined: Tue Dec 21, 2004 6:03 pm
Posts: 5263
Location: usrlab.com


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 22, 2006 8:48 am 
Offline
Forum Commoner

Joined: Mon Aug 07, 2006 6:05 pm
Posts: 89


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 22, 2006 1:17 pm 
Offline
Forum Regular
User avatar

Joined: Fri Feb 10, 2006 5:53 pm
Posts: 543


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 22, 2006 4:31 pm 
Offline
Site Administrator
User avatar

Joined: Tue Sep 09, 2003 6:04 pm
Posts: 14293
Location: Fremont, CA, USA


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 82 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group