Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2015
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.23 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for SourceGuardian & phpSHIELD)
  6. *
  7. * @ Version : 1.1.6.0
  8. * @ Author : DeZender
  9. * @ Release on : 02.06.2013
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function valid_ip($ipaddr = '') {
  15. if (preg_match( '/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/', $ipaddr )) {
  16. $parts = explode( '.', $ipaddr );
  17. foreach ($parts as $part) {
  18. if (( 255 < intval( $part ) || intval( $part ) < 0 )) {
  19. return false;
  20. }
  21. }
  22.  
  23. return true;
  24. } else {
  25. return false;
  26. }
  27.  
  28. }
  29.  
  30. function valid_port($port) {
  31. if (( ( is_numeric( $port ) && 0 < $port ) && $port <= 65535 )) {
  32. return true;
  33. } else {
  34. return false;
  35. }
  36.  
  37. }
  38.  
  39. function md5crypt($password) {
  40. if (( CRYPT_MD5 != 1 || CRYPT_SALT_LENGTH < 12 )) {
  41. exit( 'Error: CRYPT_MD5' );
  42. }
  43.  
  44. $base64_alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  45. $salt = '$1$';
  46. for ($i = 0; $i < 9; $i++) {
  47. $salt .= $base64_alphabet[rand( 0, 63 )];
  48. }
  49.  
  50. return crypt( $password, $salt . '$' );
  51. }
  52.  
  53. function generate_proxies() {
  54. if (!( isset( $_SESSION['ipranges'] ) && isset( $_SESSION['ports'] ) )) {
  55. return false;
  56. }
  57.  
  58. $ipranges = $_SESSION['ipranges'];
  59. $ports = $_SESSION['ports'];
  60. $ipaddrs = array( );
  61. foreach ($ipranges as $str) {
  62. $parts = explode( ' ', $str );
  63. $startip = $parts[0];
  64. $endip = $parts[1];
  65. $startlong = sprintf( '%u', ip2long( $startip ) );
  66. $endlong = sprintf( '%u', ip2long( $endip ) );
  67. for ($i = $startlong; $i <= $endlong; $i += 1) {
  68. $ip = long2ip( $i );
  69.  
  70. if (( ( $i & 255 ) == 0 || ( $i & 255 ) == 255 )) {
  71. continue;
  72. }
  73.  
  74. $ipaddrs[] = $ip;
  75. }
  76. }
  77.  
  78. $proxies = array( );
  79. foreach ($ports as $port) {
  80. foreach ($ipaddrs as $ipaddr) {
  81. $proxies[] = $ipaddr . ':' . $port;
  82. }
  83. }
  84.  
  85. return $proxies;
  86. }
  87.  
  88. function checked_ago($myseconds, $myweeks = false, $myyears = false) {
  89. $str = null;
  90.  
  91. if ($myyears == true) {
  92. $years = floor( $myseconds / ( 86400 * 365 ) );
  93. $myseconds %= 86400 * 365;
  94. }
  95.  
  96.  
  97. if ($myweeks == true) {
  98. $weeks = floor( $myseconds / ( 86400 * 7 ) );
  99. $myseconds %= 86400 * 7;
  100. }
  101.  
  102. $days = floor( $myseconds / 86400 );
  103. $myseconds %= 86400;
  104. $hours = sprintf( '%02d', floor( $myseconds / 3600 ) );
  105. $myseconds %= 3600;
  106. $mins = sprintf( '%02d', floor( $myseconds / 60 ) );
  107. $secs = $myseconds % 60;
  108. $secs = sprintf( '%02d', $secs );
  109.  
  110. if (( ( 1 <= $days || 1 <= $weeks ) || 1 <= $years )) {
  111. $str .= . $days . ' DAY(S) ';
  112. } else {
  113. $str .= '00:';
  114. }
  115.  
  116. $str .= $hours . ':';
  117. $str .= $mins . ':';
  118. $str .= $secs;
  119. return $str;
  120. }
  121.  
  122. function process_id() {
  123. $length = 10;
  124. $seeds = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  125. $pid = null;
  126. $seeds_count = strlen( $seeds ) - 1;
  127. $i = 0;
  128.  
  129. while ($i < $length) {
  130. $pid .= $seeds[rand( 0, $seeds_count )];
  131. ++$i;
  132. }
  133.  
  134. return $pid;
  135. }
  136.  
  137. function microtime_float() {
  138. list( $usec, $sec ) = explode( ' ', microtime( ) );
  139. return (double)$usec + (double)$sec;
  140. }
  141.  
  142. function sanitize($str) {
  143. $str = preg_replace( '/[\x80-\xFF]/', '', $str );
  144. $str = strip_tags( $str );
  145. $str = stripslashes( $str );
  146. $str = trim( $str, '' );
  147. return $str;
  148. }
  149.  
  150. function check_login() {
  151. if (( !isset( $_SESSION['logged'] ) && $_SESSION['logged'] != 'true' )) {
  152. return false;
  153. } else {
  154. return true;
  155. }
  156.  
  157. }
  158.  
  159. function remove_array_empty_values($array = '') {
  160. if (!is_array( $array )) {
  161. return $array = array( );
  162. }
  163.  
  164. $empty_elements = array_keys( $array, '' );
  165. foreach ($empty_elements as $key) {
  166. unset( $array[$key] );
  167. }
  168.  
  169. return $array;
  170. }
  171.  
  172. function hl_string($string = '', $substring = '') {
  173. if (( !empty( $string ) && !empty( $substring ) )) {
  174. if (strpos( $string, $substring ) !== false) {
  175. $string = str_replace( $substring, '<span style="color: #AE0103;">' . $substring . '</span>', $string );
  176. }
  177. }
  178.  
  179. return $string;
  180. }
  181.  
  182. function insert_query($table, $array) {
  183. $query = '' . 'INSERT INTO ' . $table . ' ';
  184. ......................................................................
  185. .................................
  186. ..............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement