Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ Power Decoder
- * @ vv456
- * @ www.waraxe.us/forum-userprofile-8669.html
- */
- ?><?php if(!class_exists('ubam_dpdemon_url_protector')) { class ubam_dpdemon_url_protector { var $master; function ubam_dpdemon_url_protector($masterclass) { $this->master = $masterclass; } function secureUrl($text) { $mlpBase = $this->master; $SEC_GEN_KEY = $mlpBase->options['ubam_dpdemon_gen_key']; $SEC_GEN_SECRET = $mlpBase->options['ubam_dpdemon_gen_secret']; $expires = time()+ $mlpBase->options['ubam_dpdemon_expire_seconds']; $text = $this->create_link($text, $SEC_GEN_KEY, $SEC_GEN_SECRET, $expires); return $text; } function create_link($text, $SEC_GEN_KEY, $SEC_GEN_SECRET, $expires) { $mlpBase = $this->master; $tag_pattern = '/(SECURE(.*?):(.*))/i'; if (preg_match($tag_pattern, $text, $matches)) { require_once dirname(__FILE__) . '/includes/Secrypt.class.inc.php'; $attr_array = $this->parse_attributes($matches[2]); $link_expires = $expires; if ($attr_array['seconds'] && is_numeric($attr_array['seconds'])) { if($attr_array['seconds'] > 0) { $link_expires = time() + $attr_array['seconds']; } else if ($attr_array['seconds'] == 0) { $link_expires = time() + (3650 * 24 * 60 * 60); } } if (($attr_array['hotlink']) && is_numeric($attr_array['hotlink'])) { $hotlink = $attr_array['hotlink'] <= 0 ? 0 : 1 ; } $secure_resource = trim($matches[3]); $sug_string_to_sign = "{$SEC_GEN_KEY}GET\n\n\n$link_expires\n$SEC_GEN_SECRET"; $sug_signature = urlencode($this->pct_encode(md5($sug_string_to_sign))); $sugout_secrypt = new ubam_dpdemon_Secrypt(FALSE); $secure_link = urlencode($this->pct_encode($sugout_secrypt->Encrypt( $secure_resource, $SEC_GEN_KEY, $SEC_GEN_SECRET ))); $secure_hotlink = urlencode($this->pct_encode($sugout_secrypt->Encrypt( $hotlink == 0 ? "000" : "111", $SEC_GEN_KEY, $SEC_GEN_SECRET ))); $sug_authentication_params = "_L-N-KP_$link_expires"; $sug_authentication_params.= "_L-N-KP_$sug_signature"; $sug_authentication_params.= "_L-N-KP_$secure_hotlink"; $secure_destination = rtrim(get_option('siteurl'), '/') . '/lnk-pr0t?seclnk=' . $secure_link . "$sug_authentication_params"; $text = $secure_destination; } return $text; } function parse_attributes($attrib_string){ $regex='@([^\s=]+)\s*=\s*(\'[^<\']*\'|"[^<"]*"|\S*)@'; preg_match_all($regex, $attrib_string, $matches); $attr=array(); for ($i=0; $i< count($matches[0]); $i++) { if ( ! empty($matches[0][$i]) && ! empty($matches[1][$i])) { if (preg_match("/^'(.*)'$/",$matches[2][$i],$vmatch)) { $value=$vmatch[1]; }else if (preg_match('/^"(.*)"$/',$matches[2][$i],$vmatch)) { $value=$vmatch[1]; }else{ $value=$matches[2][$i]; } $key=strtolower($matches[1][$i]); $attr[$key]= $value ; } } return $attr; } function pct_encode($text_to_encode) { $out_text = rawurlencode(base64_encode($text_to_encode)); return preg_replace("/%/", "_BF_R_", $out_text); } } } ?>
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement