Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for SourceGuardian & phpSHIELD)
- *
- * @ Version : 1.1.5.0
- * @ Author : DeZender
- * @ Release on : 09.06.2012
- * @ Official site : http://DeZender.Net
- *
- */
- function valid_ip($ipaddr = '') {
- if (preg_match( '/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/', $ipaddr )) {
- $parts = explode( '.', $ipaddr );
- foreach ($parts as $part) {
- if (( 255 < intval( $part ) || intval( $part ) < 0 )) {
- return false;
- }
- }
- return true;
- } else {
- return false;
- }
- }
- function valid_port($port) {
- if (( ( is_numeric( $port ) && 0 < $port ) && $port <= 65535 )) {
- return true;
- } else {
- return false;
- }
- }
- function md5crypt($password) {
- if (( CRYPT_MD5 != 1 || CRYPT_SALT_LENGTH < 12 )) {
- exit( 'Error: CRYPT_MD5' );
- }
- $base64_alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
- $salt = '$1$';
- for ($i = 0; $i < 9; $i++) {
- $salt .= $base64_alphabet[rand( 0, 63 )];
- }
- return crypt( $password, $salt . '$' );
- }
- function generate_proxies() {
- if (!( isset( $_SESSION['cidrs'] ) && isset( $_SESSION['ports'] ) )) {
- return false;
- }
- $cidrs = $_SESSION['cidrs'];
- $ports = $_SESSION['ports'];
- $IPS = array( );
- foreach ($cidrs as $data) {
- $key = ;
- $cidr = $data['cidr'];
- $hosts = $data['hosts'];
- $hostmin = $data['hostmin'];
- $hostmax = $data['hostmax'];
- $host_min = explode( '.', $hostmin );
- $host_max = explode( '.', $hostmax );
- $HOST_MIN_A = $host_min[0];
- $HOST_MIN_B = $host_min[1];
- $HOST_MIN_C = $host_min[2];
- $HOST_MIN_D = $host_min[3];
- $HOST_MAX_A = $host_max[0];
- $HOST_MAX_B = $host_max[1];
- $HOST_MAX_C = $host_max[2];
- $HOST_MAX_D = $host_max[3];
- if (( ( $HOST_MIN_A == $HOST_MAX_A && $HOST_MIN_B == $HOST_MAX_B ) && $HOST_MIN_C == $HOST_MAX_C )) {
- $START = $HOST_MIN_A . '.' . $HOST_MIN_B . '.' . $HOST_MIN_C . '.';
- for ($i = 1; $i <= 254; $i++) {
- $IP = $START . $i;
- $IPS[] = $IP;
- }
- } else {
- if (( ( $HOST_MIN_A == $HOST_MAX_A && $HOST_MIN_B == $HOST_MAX_B ) && $HOST_MIN_C != $HOST_MAX_C )) {
- $START = $HOST_MIN_A . '.' . $HOST_MIN_B . '.';
- $HOST_MAX_C++;
- while ($HOST_MIN_C != $HOST_MAX_C) {
- for ($i = 1; $i <= 254; $i++) {
- $IP = $START . $HOST_MIN_C . '.' . $i;
- $IPS[] = $IP;
- }
- $HOST_MIN_C++;
- }
- } else {
- if (( $HOST_MIN_A == $HOST_MAX_A && $HOST_MIN_B != $HOST_MAX_B )) {
- $START = $HOST_MIN_A . '.';
- $HOST_MAX_B++;
- $PARTS = array( );
- while ($HOST_MIN_B != $HOST_MAX_B) {
- for ($i = 1; $i <= 255; $i++) {
- $PART = $START . $HOST_MIN_B . '.' . $i;
- $PARTS[] = $PART;
- }
- $HOST_MIN_B++;
- }
- foreach ($PARTS as $PART) {
- $key = ;
- for ($i = 1; $i <= 254; $i++) {
- $IP = $PART . '.' . $i;
- $IPS[] = $IP;
- }
- }
- } else {
- continue;
- }
- }
- }
- }
- $proxies = array( );
- foreach ($ports as $port) {
- foreach ($IPS as $IP) {
- $proxy = $IP . ':' . $port;
- $proxies[] = $proxy;
- }
- }
- return $proxies;
- }
- function checked_ago($myseconds, $myweeks = false, $myyears = false) {
- $str = null;
- if ($myyears == true) {
- $years = floor( $myseconds / ( 86400 * 365 ) );
- $myseconds %= 86400 * 365;
- }
- if ($myweeks == true) {
- $weeks = floor( $myseconds / ( 86400 * 7 ) );
- $myseconds %= 86400 * 7;
- }
- $days = floor( $myseconds / 86400 );
- $myseconds %= 86400;
- $hours = sprintf( '%02d', floor( $myseconds / 3600 ) );
- $myseconds %= 3600;
- $mins = sprintf( '%02d', floor( $myseconds / 60 ) );
- $secs = $myseconds % 60;
- $secs = sprintf( '%02d', $secs );
- if (( ( 1 <= $days || 1 <= $weeks ) || 1 <= $years )) {
- $str .= . $days . ' DAY(S) ';
- } else {
- $str .= '00:';
- }
- $str .= $hours . ':';
- $str .= $mins . ':';
- $str .= $secs;
- return $str;
- }
- function process_id() {
- $length = 10;
- $seeds = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
- $pid = null;
- $seeds_count = strlen( $seeds ) - 1;
- $i = 0;
- while ($i < $length) {
- $pid .= $seeds[rand( 0, $seeds_count )];
- ++$i;
- }
- return $pid;
- }
- function microtime_float() {
- list( $usec, $sec ) = explode( ' ', microtime( ) );
- return (double)$usec + (double)$sec;
- }
- function sanitize($str) {
- $str = preg_replace( '/[\x80-\xFF]/', '', $str );
- $str = strip_tags( $str );
- $str = stripslashes( $str );
- $str = trim( $str, '' );
- return $str;
- }
- function check_login() {
- if (( !isset( $_SESSION['logged'] ) && $_SESSION['logged'] != 'true' )) {
- return false;
- } else {
- return true;
- }
- }
- function remove_array_empty_values($array = '') {
- if (!is_array( $array )) {
- return $array = array( );
- }
- $empty_elements = array_keys( $array, '' );
- foreach ($empty_elements as $key) {
- unset( $array[$key] );
- }
- return $array;
- }
- function hl_string($string = '', $substring = '') {
- if (( !empty( $string ) && !empty( $substring ) )) {
- if (strpos( $string, $substring ) !== false) {
- $string = str_replace( $substring, '<span style="color: #AE0103;">' . $substring . '</span>', $string );
- }
- }
- return $string;
- }
- function insert_query($table, $array) {
- $query = '' . 'INSERT INTO ' . $table . ' ';
- $fieldnamelist = null;
- $fieldvaluelist = null;
- foreach ($array as $value) {
- $key = ;
- $fieldnamelist .= '' . '`' . $key . '`,';
- if ($value == 'now()') {
- $fieldvaluelist .= 'now(),';
- continue;
- } else {
- $fieldvaluelist .= '\'' . $value . '\',';
- continue;
- }
- }
- $fieldnamelist = substr( $fieldnamelist, 0, 0 - 1 );
- $fieldvaluelist = substr( $fieldvaluelist, 0, 0 - 1 );
- $query .= '' . '(' . $fieldnamelist . ') VALUES (' . $fieldvaluelist . ')';
- $result = mysql_query( $query );
- $rows = mysql_affected_rows( );
- $mysql_query = array( );
- if (!$result) {
- $mysql_query['error'] = mysql_error( );
- }
- $mysql_query['rows'] = $rows;
- return $mysql_query;
- }
- ..................................................................
- .........................
- ........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement