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.6.0
- * @ Author : DeZender
- * @ Release on : 02.06.2013
- * @ 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['ipranges'] ) && isset( $_SESSION['ports'] ) )) {
- return false;
- }
- $ipranges = $_SESSION['ipranges'];
- $ports = $_SESSION['ports'];
- $ipaddrs = array( );
- foreach ($ipranges as $str) {
- $parts = explode( ' ', $str );
- $startip = $parts[0];
- $endip = $parts[1];
- $startlong = sprintf( '%u', ip2long( $startip ) );
- $endlong = sprintf( '%u', ip2long( $endip ) );
- for ($i = $startlong; $i <= $endlong; $i += 1) {
- $ip = long2ip( $i );
- if (( ( $i & 255 ) == 0 || ( $i & 255 ) == 255 )) {
- continue;
- }
- $ipaddrs[] = $ip;
- }
- }
- $proxies = array( );
- foreach ($ports as $port) {
- foreach ($ipaddrs as $ipaddr) {
- $proxies[] = $ipaddr . ':' . $port;
- }
- }
- 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 . ' ';
- ......................................................................
- .................................
- ..............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement