Advertisement
Guest User

Untitled

a guest
Mar 12th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.26 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.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  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['cidrs'] ) && isset( $_SESSION['ports'] ) )) {
  55. return false;
  56. }
  57.  
  58. $cidrs = $_SESSION['cidrs'];
  59. $ports = $_SESSION['ports'];
  60. $IPS = array( );
  61. foreach ($cidrs as $data) {
  62. $key = ;
  63. $cidr = $data['cidr'];
  64. $hosts = $data['hosts'];
  65. $hostmin = $data['hostmin'];
  66. $hostmax = $data['hostmax'];
  67. $host_min = explode( '.', $hostmin );
  68. $host_max = explode( '.', $hostmax );
  69. $HOST_MIN_A = $host_min[0];
  70. $HOST_MIN_B = $host_min[1];
  71. $HOST_MIN_C = $host_min[2];
  72. $HOST_MIN_D = $host_min[3];
  73. $HOST_MAX_A = $host_max[0];
  74. $HOST_MAX_B = $host_max[1];
  75. $HOST_MAX_C = $host_max[2];
  76. $HOST_MAX_D = $host_max[3];
  77.  
  78. if (( ( $HOST_MIN_A == $HOST_MAX_A && $HOST_MIN_B == $HOST_MAX_B ) && $HOST_MIN_C == $HOST_MAX_C )) {
  79. $START = $HOST_MIN_A . '.' . $HOST_MIN_B . '.' . $HOST_MIN_C . '.';
  80. for ($i = 1; $i <= 254; $i++) {
  81. $IP = $START . $i;
  82. $IPS[] = $IP;
  83. }
  84. } else {
  85. if (( ( $HOST_MIN_A == $HOST_MAX_A && $HOST_MIN_B == $HOST_MAX_B ) && $HOST_MIN_C != $HOST_MAX_C )) {
  86. $START = $HOST_MIN_A . '.' . $HOST_MIN_B . '.';
  87. $HOST_MAX_C++;
  88.  
  89. while ($HOST_MIN_C != $HOST_MAX_C) {
  90. for ($i = 1; $i <= 254; $i++) {
  91. $IP = $START . $HOST_MIN_C . '.' . $i;
  92. $IPS[] = $IP;
  93. }
  94.  
  95. $HOST_MIN_C++;
  96. }
  97. } else {
  98. if (( $HOST_MIN_A == $HOST_MAX_A && $HOST_MIN_B != $HOST_MAX_B )) {
  99. $START = $HOST_MIN_A . '.';
  100. $HOST_MAX_B++;
  101. $PARTS = array( );
  102.  
  103. while ($HOST_MIN_B != $HOST_MAX_B) {
  104. for ($i = 1; $i <= 255; $i++) {
  105. $PART = $START . $HOST_MIN_B . '.' . $i;
  106. $PARTS[] = $PART;
  107. }
  108.  
  109. $HOST_MIN_B++;
  110. }
  111.  
  112. foreach ($PARTS as $PART) {
  113. $key = ;
  114. for ($i = 1; $i <= 254; $i++) {
  115. $IP = $PART . '.' . $i;
  116. $IPS[] = $IP;
  117. }
  118. }
  119. } else {
  120. continue;
  121. }
  122. }
  123. }
  124. }
  125.  
  126. $proxies = array( );
  127. foreach ($ports as $port) {
  128. foreach ($IPS as $IP) {
  129. $proxy = $IP . ':' . $port;
  130. $proxies[] = $proxy;
  131. }
  132. }
  133.  
  134. return $proxies;
  135. }
  136.  
  137. function checked_ago($myseconds, $myweeks = false, $myyears = false) {
  138. $str = null;
  139.  
  140. if ($myyears == true) {
  141. $years = floor( $myseconds / ( 86400 * 365 ) );
  142. $myseconds %= 86400 * 365;
  143. }
  144.  
  145.  
  146. if ($myweeks == true) {
  147. $weeks = floor( $myseconds / ( 86400 * 7 ) );
  148. $myseconds %= 86400 * 7;
  149. }
  150.  
  151. $days = floor( $myseconds / 86400 );
  152. $myseconds %= 86400;
  153. $hours = sprintf( '%02d', floor( $myseconds / 3600 ) );
  154. $myseconds %= 3600;
  155. $mins = sprintf( '%02d', floor( $myseconds / 60 ) );
  156. $secs = $myseconds % 60;
  157. $secs = sprintf( '%02d', $secs );
  158.  
  159. if (( ( 1 <= $days || 1 <= $weeks ) || 1 <= $years )) {
  160. $str .= . $days . ' DAY(S) ';
  161. } else {
  162. $str .= '00:';
  163. }
  164.  
  165. $str .= $hours . ':';
  166. $str .= $mins . ':';
  167. $str .= $secs;
  168. return $str;
  169. }
  170.  
  171. function process_id() {
  172. $length = 10;
  173. $seeds = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  174. $pid = null;
  175. $seeds_count = strlen( $seeds ) - 1;
  176. $i = 0;
  177.  
  178. while ($i < $length) {
  179. $pid .= $seeds[rand( 0, $seeds_count )];
  180. ++$i;
  181. }
  182.  
  183. return $pid;
  184. }
  185.  
  186. function microtime_float() {
  187. list( $usec, $sec ) = explode( ' ', microtime( ) );
  188. return (double)$usec + (double)$sec;
  189. }
  190.  
  191. function sanitize($str) {
  192. $str = preg_replace( '/[\x80-\xFF]/', '', $str );
  193. $str = strip_tags( $str );
  194. $str = stripslashes( $str );
  195. $str = trim( $str, '' );
  196. return $str;
  197. }
  198.  
  199. function check_login() {
  200. if (( !isset( $_SESSION['logged'] ) && $_SESSION['logged'] != 'true' )) {
  201. return false;
  202. } else {
  203. return true;
  204. }
  205.  
  206. }
  207.  
  208. function remove_array_empty_values($array = '') {
  209. if (!is_array( $array )) {
  210. return $array = array( );
  211. }
  212.  
  213. $empty_elements = array_keys( $array, '' );
  214. foreach ($empty_elements as $key) {
  215. unset( $array[$key] );
  216. }
  217.  
  218. return $array;
  219. }
  220.  
  221. function hl_string($string = '', $substring = '') {
  222. if (( !empty( $string ) && !empty( $substring ) )) {
  223. if (strpos( $string, $substring ) !== false) {
  224. $string = str_replace( $substring, '<span style="color: #AE0103;">' . $substring . '</span>', $string );
  225. }
  226. }
  227.  
  228. return $string;
  229. }
  230.  
  231. function insert_query($table, $array) {
  232. $query = '' . 'INSERT INTO ' . $table . ' ';
  233. $fieldnamelist = null;
  234. $fieldvaluelist = null;
  235. foreach ($array as $value) {
  236. $key = ;
  237. $fieldnamelist .= '' . '`' . $key . '`,';
  238.  
  239. if ($value == 'now()') {
  240. $fieldvaluelist .= 'now(),';
  241. continue;
  242. } else {
  243. $fieldvaluelist .= '\'' . $value . '\',';
  244. continue;
  245. }
  246. }
  247.  
  248. $fieldnamelist = substr( $fieldnamelist, 0, 0 - 1 );
  249. $fieldvaluelist = substr( $fieldvaluelist, 0, 0 - 1 );
  250. $query .= '' . '(' . $fieldnamelist . ') VALUES (' . $fieldvaluelist . ')';
  251. $result = mysql_query( $query );
  252. $rows = mysql_affected_rows( );
  253. $mysql_query = array( );
  254.  
  255. if (!$result) {
  256. $mysql_query['error'] = mysql_error( );
  257. }
  258.  
  259. $mysql_query['rows'] = $rows;
  260. return $mysql_query;
  261. }
  262. ..................................................................
  263. .........................
  264. ........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement