· 7 years ago · Jun 14, 2018, 09:52 PM
1<?php
2/**
3*
4* @ This file is created by http://DeZender.Net
5* @ deZender (PHP5 Decoder for ionCube Encoder)
6*
7* @ Version : 3.0.8.0
8* @ Author : DeZender
9* @ Release on : 25.09.2017
10* @ Official site : http://DeZender.Net
11*
12*/
13
14class Protect
15{
16 public $status = false;
17 public $errors = false;
18 public $activation_key = '';
19 public $activation_key_expires = null;
20 public $secret_key = '';
21 public $server = '';
22 public $remote_port = 80;
23 public $remote_timeout = 20;
24 public $local_ua = 'PHP code protect';
25 public $use_localhost = false;
26 public $use_expires = true;
27 public $local_key_storage = 'filesystem';
28 public $local_key_path = './';
29 public $local_key_name = 'license.lic';
30 public $local_key_transport_order = 'scf';
31 public $local_key_delay_period = 7;
32 public $local_key_last = null;
33 public $release_date = '2014-10-24';
34 public $user_name = '';
35 public $status_messages = array(
36 'status_1' => 'This activation key is active.',
37 'status_2' => 'Error: This activation key has expired.',
38 'status_3' => 'Activation key republished. Awaiting reactivation.',
39 'status_4' => 'Error: This activation key has been suspended.',
40 'localhost' => 'This activation key is active (localhost).',
41 'pending' => 'Error: This activation key is pending review.',
42 'download_access_expired' => 'Error: This version of the software was released after your download access expired. Please downgrade software or contact support for more information.',
43 'missing_activation_key' => 'Error: The activation key variable is empty.',
44 'could_not_obtain_local_key' => 'Error: I could not obtain a new local key.',
45 'maximum_delay_period_expired' => 'Error: The maximum local key delay period has expired.',
46 'local_key_tampering' => 'Error: The local key has been tampered with or is invalid.',
47 'local_key_invalid_for_location' => 'Error: The local key is invalid for this location.',
48 'missing_license_file' => 'Error: Please create the following file (and directories if they dont exist already): ',
49 'license_file_not_writable' => 'Error: Please make the following path writable: ',
50 'invalid_local_key_storage' => 'Error: I could not determine the local key storage on clear.',
51 'could_not_save_local_key' => 'Error: I could not save the local key.',
52 'activation_key_string_mismatch' => 'Error: The local key is invalid for this activation key.'
53 );
54 private $trigger_delay_period = null;
55
56 public function __construct()
57 {
58 }
59
60 public function validate()
61 {
62 if ($this->use_localhost && $this->getIpLocal( ) && $this->isWindows( ) && !(file_exists( $this->local_key_path . $this->local_key_name ))) {
63 $this->status = true;
64 return $this->errors = $this->status_messages['localhost'];
65 }
66
67 if (!($this->activation_key)) {
68 return $this->errors = $this->status_messages['missing_activation_key'];
69 }
70
71 switch ($this->local_key_storage) {
72 case 'filesystem':
73 $local_key = $this->readLocalKey( );
74 break;
75 }
76
77 return $this->errors = $this->status_messages['missing_activation_key'];
78
79 $this->trigger_delay_period = $this->status_messages['could_not_obtain_local_key'];
80
81 if (($this->errors == $this->trigger_delay_period) && $this->local_key_delay_period) {
82 $delay = $this->processDelayPeriod( $this->local_key_last );
83
84 if ($delay['write']) {
85 if ($this->local_key_storage == 'filesystem') {
86 $this->writeLocalKey( $delay['local_key'], $this->local_key_path . $this->local_key_name );
87 }
88 }
89
90 if ($delay['errors']) {
91 return $this->errors = $delay['errors'];
92 }
93
94 $this->errors = false;
95 return $this;
96 }
97
98 if ($this->errors) {
99 return $this->errors;
100 }
101
102 return $this->validateLocalKey( $local_key );
103 }
104
105 private function calcMaxDelay($local_key_expires, $delay)
106 {
107 return (int) $local_key_expires + ((int) $delay * 86400);
108 }
109
110 private function processDelayPeriod($local_key)
111 {
112 $local_key_src = $this->decodeLocalKey( $local_key );
113 $parts = $this->splitLocalKey( $local_key_src );
114 $key_data = unserialize( $parts[0] );
115 $local_key_expires = (int) $key_data['local_key_expires'];
116 unset( $parts, $key_data );
117 $write_new_key = false;
118 $parts = explode( "\n\n", $local_key );
119 $local_key = $parts[0];
120
121 foreach ($local_key_delay_period = explode( ',', $this->local_key_delay_period ) as $key => $delay) {
122 if (!($key)) {
123..............................................................
124....................................
125...............