破解Discuz! 4.0.0 20051001的方法
演示:
http://newbbs.dothome.co.kr/vip/index.php
打开
include\validate.class.php
替换
程序代码
1
<?php
2
class licensestuff
3
{
4
var $data = '';
5
var $key = array ();
6
var $env = array ();
7
function readfile ()
8
{
9
if ($fp = fopen ((DISCUZ_ROOT.'./discuz_license.php'), 'r'))
10
{
11
$this->data = fread ($fp, 9999);
12
fclose ($fp);
13
}
14
15
}
16
17
function initialize ()
18
{
19
$this->readfile ();
20
if ($this->data)
21
{
22
foreach (explode ('
23
', $this->data) as $string)
24
{
25
if (strpos ($string, ' = '))
26
{
27
eval (preg_replace (((((((((((((''.'/^(').'[').'a-z0-9').'\\-').']').'+)').'\\s').'\\=').'\\s').'(.+?)').'$').'/i'), '$this->key[\'\\1\'] = \'\\2\';', trim (str_replace ('\'', '\\\'', $string))));
28
}
29
else
30
{
31
if (preg_match ('/\\<\\?\'.+\'\\?\\>/', $string))
32
{
33
$this->key['Validation-code'] = $this->decrypt (preg_replace ('/\\<\\?\'(.+)\'\\?\\>/', '\\1', $string), 'I love my father, mother, my Grace, and my self, I am working hard', '##@Crossday Studio@##');
34
}
35
}
36
}
37
38
$this->getenvinfo ();
39
return 1;
40
}
41
/* else
42
{
43
if (((strtoupper (substr (PHP_OS, 0, 3)) == 'WIN') AND in_array ($GLOBALS['_SERVER']['HTTP_HOST'], array ('localhost', '127.0.0.1'))))
44
{
45
return 2;
46
}
47
else
48
{
49
return 0;
50
}
51
}*/
52
53
}
54
55
function checkinfo ()
56
{
57
if ((substr ($this->key['Validation-code'], 16, 8) == substr (md5 (preg_replace (((((((((((((''.'/^(.+?)').'\\s').'*').'\\<').'\\?').'\\\'').'.+').'\\\'').'\\?').'\\>').'$').'/s'), '\\1', $this->data)), 0, 8)))
58
{
59
return TRUE;
60
}
61
else
62
{
63
return TRUE;
64
}
65
66
}
67
68
function checkdate ()
69
{
70
if ((!$this->key['License-expires'] OR (time () < strtotime ($this->key['License-expires']))))
71
{
72
return TRUE;
73
}
74
else
75
{
76
return TRUE;
77
}
78
79
}
80
81
function checkkey ()
82
{
83
if ((substr ($this->key['Validation-code'], 8, 8) == substr (md5 ((((((((($this->env['os'].'|').$this->env['ip']).'|').$this->env['sapi']).'|').$this->env['cpu']).'|').$this->env['name'])), 0, 8)))
84
{
85
return TRUE;
86
}
87
else
88
{
89
return TRUE;
90
}
91
92
}
93
94
function checkhostpath ()
95
{
96
if ((((substr ($this->key['Validation-code'], 24, 6) == ((dechex (ord ('d')).dechex (ord ('z'))).dechex (ord ('k')))) OR (substr ($this->key['Validation-code'], 0, 8) == substr (md5 ($this->env['host']), 0, 8))) OR (substr ($this->key['Validation-code'], 24, 8) == substr (md5 ($this->env['path']), 0, 8))))
97
{
98
return TRUE;
99
}
100
else
101
{
102
return TRUE;
103
}
104
105
}
106
107
function getenvinfo ()
108
{
109
global $_SERVER;
110
global $_POST;
111
global $_ENV;
112
$env['time'] = gmdate ('d-M-Y', time ());
113
$env['os'] = PHP_OS;
114
$env['ip'] = getenv ('SERVER_ADDR');
115
$env['sapi'] = php_sapi_name ();
116
$env['host'] = (getenv ('HTTP_HOST') ? getenv ('HTTP_HOST') : $_SERVER['HTTP_HOST']);
117
// $env['path'] = dirname (('validate.class.php.LkuQHr' ? dirname ('validate.class.php.LkuQHr') : getenv ('SCRIPT_FILENAME')));//********
118
$env['cpu'] = (($_ENV['PROCESSOR_IDENTIFIER'].'/').$_ENV['PROCESSOR_REVISION']);
119
$env['name'] = $_ENV['COMPUTERNAME'];
120
$this->env = $env;
121
}
122
123
function decrypt ($txt, $key, $owner = '')
124
{
125
$txt = $this->keyED (base64_decode ($txt), (($owner == '##@Crossday Studio@##') ? $key : ''));
126
$tmp = '';
127
for ($i = 0; ($i < strlen ($txt)); $i++)
128
{
129
$md5 = $txt[$i];
130
$i++;
131
($tmp .= ($txt[$i] ^ $md5));
132
}
133
134
return $tmp;
135
}
136
137
function keyed ($txt, $encrypt_key)
138
{
139
$encrypt_key = md5 ($encrypt_key);
140
$ctr = 0;
141
$tmp = '';
142
for ($i = 0; ($i < strlen ($txt)); $i++)
143
{
144
if (($ctr == strlen ($encrypt_key)))
145
{
146
$ctr = 0;
147
}
148
149
($tmp .= ($txt[$i] ^ $encrypt_key[$ctr]));
150
$ctr++;
151
}
152
153
return $tmp;
154
}
155
156
function validate ()
157
{
158
$init = $this->initialize ();
159
if ((($init == 2) OR ((((($init == 1) AND $this->checkinfo ()) AND $this->checkdate ()) AND $this->checkkey ()) AND $this->checkhostpath ())))
160
{
161
if (($init == 2))
162
{
163
define ('DISCUZ_LICENSE_KEY', md5 ((base64_decode ('ISgqISEpQCZfRGlzY3V6IV9pc19SdW5uaW5nX3VuZGVyX0xvY2FsaG9zdA').md5 (((('#19811027_'.'DZK_').'WROTE_Discuz!_').substr (time (), 0, (0 - 2)))))));
164
}
165
else
166
{
167
define ('DISCUZ_LICENSE_KEY', md5 ((base64_decode ('ISgqISEpQCZfRGlzY3V6IV9XSUxMX1dJTl9USEVfRlVUVVJFX0ZST01fTk9XX09O').md5 (((('#19811027_'.'DZK_').'WROTE_Discuz!_').substr (time (), 0, (0 - 2)))))));
168
}
169
}
170
else
171
{
172
/* echo '<html>
173
<head>
174
<title>Invalid License File</title>
175
</head>
176
<body bgcolor="#FFFFFF">
177
<table cellpadding="0" cellspacing="0" border="0" width="600" align="center" height="85%">
178
<tr align="center" valign="middle">
179
<td>
180
<table cellpadding="10" cellspacing="0" border="0" width="80%" align="center" style="font-family: Verdana, Tahoma; color: #666666; font-size: 12px">
181
<tr>
182
<td valign="m';
183
echo 'iddle" bgcolor="#EBEBEB">
184
<br><b style="font-size: 20px">Your License was Invalid</b>
185
<br><br>License expiring, shifting to a new server, changing server IP, hardware, OS, PHP SAPI module, or, changing both host name and absolute directory on your disk, may invalidate your license. If you have trouble in activation, please visit <a href="http://www.discuz.com/license/" target="_blank">';
186
echo 'http://www.discuz.com/license/</a> for more information.
187
<br><br>您的密匙不存在、超过有效期、更换新的服务器空间、更改 IP 地址、硬件、操作系统、PHP 安装模&';
188
echo '#x5F0F;,或同时改变绝对路径或访问域名,都可能导致密匙失效。请访问 <a href="http://www.discuz.com/license/" target="_blank">http://www.discuz.com/license/</a> 重新生成密匙。
189
<br><b';
190
echo 'r>
191
</td>
192
</tr>
193
</table>
194
</td>
195
</tr>
196
</table>
197
</body>
198
</html>
199
';
200
exit ();
201
return TRUE;*/
202
}
203
204
}
205
}
206
207
if (!defined ('IN_DISCUZ'))
208
{
209
exit ('Access Denied');
210
}
211
212
$license = new licensestuff ();
213
$license->validate ();
214
unset ($license);
215
?>
<?php2
class licensestuff3
{4
var $data = '';5
var $key = array ();6
var $env = array ();7
function readfile ()8
{9
if ($fp = fopen ((DISCUZ_ROOT.'./discuz_license.php'), 'r'))10
{11
$this->data = fread ($fp, 9999);12
fclose ($fp);13
}14

15
}16

17
function initialize ()18
{19
$this->readfile ();20
if ($this->data)21
{22
foreach (explode ('23
', $this->data) as $string)24
{25
if (strpos ($string, ' = '))26
{27
eval (preg_replace (((((((((((((''.'/^(').'[').'a-z0-9').'\\-').']').'+)').'\\s').'\\=').'\\s').'(.+?)').'$').'/i'), '$this->key[\'\\1\'] = \'\\2\';', trim (str_replace ('\'', '\\\'', $string))));28
}29
else30
{31
if (preg_match ('/\\<\\?\'.+\'\\?\\>/', $string))32
{33
$this->key['Validation-code'] = $this->decrypt (preg_replace ('/\\<\\?\'(.+)\'\\?\\>/', '\\1', $string), 'I love my father, mother, my Grace, and my self, I am working hard', '##@Crossday Studio@##');34
}35
}36
}37

38
$this->getenvinfo ();39
return 1;40
}41
/* else42
{43
if (((strtoupper (substr (PHP_OS, 0, 3)) == 'WIN') AND in_array ($GLOBALS['_SERVER']['HTTP_HOST'], array ('localhost', '127.0.0.1'))))44
{45
return 2;46
}47
else48
{49
return 0;50
}51
}*/52

53
}54

55
function checkinfo ()56
{57
if ((substr ($this->key['Validation-code'], 16, 8) == substr (md5 (preg_replace (((((((((((((''.'/^(.+?)').'\\s').'*').'\\<').'\\?').'\\\'').'.+').'\\\'').'\\?').'\\>').'$').'/s'), '\\1', $this->data)), 0, 8)))58
{59
return TRUE;60
}61
else62
{63
return TRUE;64
}65

66
}67

68
function checkdate ()69
{70
if ((!$this->key['License-expires'] OR (time () < strtotime ($this->key['License-expires']))))71
{72
return TRUE;73
}74
else75
{76
return TRUE;77
}78

79
}80

81
function checkkey ()82
{83
if ((substr ($this->key['Validation-code'], 8, 8) == substr (md5 ((((((((($this->env['os'].'|').$this->env['ip']).'|').$this->env['sapi']).'|').$this->env['cpu']).'|').$this->env['name'])), 0, 8)))84
{85
return TRUE;86
}87
else88
{89
return TRUE;90
}91

92
}93

94
function checkhostpath ()95
{96
if ((((substr ($this->key['Validation-code'], 24, 6) == ((dechex (ord ('d')).dechex (ord ('z'))).dechex (ord ('k')))) OR (substr ($this->key['Validation-code'], 0, 8) == substr (md5 ($this->env['host']), 0, 8))) OR (substr ($this->key['Validation-code'], 24, 8) == substr (md5 ($this->env['path']), 0, 8))))97
{98
return TRUE;99
}100
else101
{102
return TRUE;103
}104

105
}106

107
function getenvinfo ()108
{109
global $_SERVER;110
global $_POST;111
global $_ENV;112
$env['time'] = gmdate ('d-M-Y', time ());113
$env['os'] = PHP_OS;114
$env['ip'] = getenv ('SERVER_ADDR');115
$env['sapi'] = php_sapi_name ();116
$env['host'] = (getenv ('HTTP_HOST') ? getenv ('HTTP_HOST') : $_SERVER['HTTP_HOST']);117
// $env['path'] = dirname (('validate.class.php.LkuQHr' ? dirname ('validate.class.php.LkuQHr') : getenv ('SCRIPT_FILENAME')));//********118
$env['cpu'] = (($_ENV['PROCESSOR_IDENTIFIER'].'/').$_ENV['PROCESSOR_REVISION']);119
$env['name'] = $_ENV['COMPUTERNAME'];120
$this->env = $env;121
}122

123
function decrypt ($txt, $key, $owner = '')124
{125
$txt = $this->keyED (base64_decode ($txt), (($owner == '##@Crossday Studio@##') ? $key : ''));126
$tmp = '';127
for ($i = 0; ($i < strlen ($txt)); $i++)128
{129
$md5 = $txt[$i];130
$i++;131
($tmp .= ($txt[$i] ^ $md5));132
}133

134
return $tmp;135
}136

137
function keyed ($txt, $encrypt_key)138
{139
$encrypt_key = md5 ($encrypt_key);140
$ctr = 0;141
$tmp = '';142
for ($i = 0; ($i < strlen ($txt)); $i++)143
{144
if (($ctr == strlen ($encrypt_key)))145
{146
$ctr = 0;147
}148

149
($tmp .= ($txt[$i] ^ $encrypt_key[$ctr]));150
$ctr++;151
}152

153
return $tmp;154
}155

156
function validate ()157
{158
$init = $this->initialize ();159
if ((($init == 2) OR ((((($init == 1) AND $this->checkinfo ()) AND $this->checkdate ()) AND $this->checkkey ()) AND $this->checkhostpath ())))160
{161
if (($init == 2))162
{163
define ('DISCUZ_LICENSE_KEY', md5 ((base64_decode ('ISgqISEpQCZfRGlzY3V6IV9pc19SdW5uaW5nX3VuZGVyX0xvY2FsaG9zdA').md5 (((('#19811027_'.'DZK_').'WROTE_Discuz!_').substr (time (), 0, (0 - 2)))))));164
}165
else166
{167
define ('DISCUZ_LICENSE_KEY', md5 ((base64_decode ('ISgqISEpQCZfRGlzY3V6IV9XSUxMX1dJTl9USEVfRlVUVVJFX0ZST01fTk9XX09O').md5 (((('#19811027_'.'DZK_').'WROTE_Discuz!_').substr (time (), 0, (0 - 2)))))));168
}169
}170
else171
{172
/* echo '<html>173
<head>174
<title>Invalid License File</title>175
</head>176
<body bgcolor="#FFFFFF">177
<table cellpadding="0" cellspacing="0" border="0" width="600" align="center" height="85%">178
<tr align="center" valign="middle">179
<td>180
<table cellpadding="10" cellspacing="0" border="0" width="80%" align="center" style="font-family: Verdana, Tahoma; color: #666666; font-size: 12px">181
<tr>182
<td valign="m';183
echo 'iddle" bgcolor="#EBEBEB">184
<br><b style="font-size: 20px">Your License was Invalid</b>185
<br><br>License expiring, shifting to a new server, changing server IP, hardware, OS, PHP SAPI module, or, changing both host name and absolute directory on your disk, may invalidate your license. If you have trouble in activation, please visit <a href="http://www.discuz.com/license/" target="_blank">';186
echo 'http://www.discuz.com/license/</a> for more information.187
<br><br>您的密匙不存在、超过有效期、更换新的服务器空间、更改 IP 地址、硬件、操作系统、PHP 安装模&';188
echo '#x5F0F;,或同时改变绝对路径或访问域名,都可能导致密匙失效。请访问 <a href="http://www.discuz.com/license/" target="_blank">http://www.discuz.com/license/</a> 重新生成密匙。189
<br><b';190
echo 'r>191
</td>192
</tr>193
</table>194
</td>195
</tr>196
</table>197
</body>198
</html>199
';200
exit ();201
return TRUE;*/202
}203

204
}205
}206

207
if (!defined ('IN_DISCUZ'))208
{209
exit ('Access Denied');210
}211

212
$license = new licensestuff ();213
$license->validate ();214
unset ($license);215
?>再在根目录新建个 discuz_license.php
内容为
程序代码
1
# !ATTENTION! PLEASE DO NOT OPEN FOR EDITING
2
# ANY MODIFICATION WILL INVALIDATE THIS LICENSE
3
4
Product-name = Discuz! Board Retail
5
License-issued = 16-Jul-2005
6
7
Registered-to = Tkz
8
Registered-URL = http://127.0.0.1/
9
# !ATTENTION! PLEASE DO NOT OPEN FOR EDITING2
# ANY MODIFICATION WILL INVALIDATE THIS LICENSE3

4
Product-name = Discuz! Board Retail5
License-issued = 16-Jul-20056

7
Registered-to = Tkz8
Registered-URL = http://127.0.0.1/9

posted on
浙公网安备 33010602011771号