-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathscript.php
91 lines (82 loc) · 3.47 KB
/
script.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/****************************************************************************************
* LiveZilla script.php
*
* Improper changes to this file may cause critical errors.
***************************************************************************************/
define("IN_LIVEZILLA",true);
//header('X-Content-Type-Options: nosniff');
header('Content-Type: application/javascript;charset=utf-8');
if(!defined("LIVEZILLA_PATH"))
define("LIVEZILLA_PATH","./");
require(LIVEZILLA_PATH . "_definitions/definitions.inc.php");
require(LIVEZILLA_PATH . "_lib/functions.global.inc.php");
require(LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php");
require(LIVEZILLA_PATH . "_definitions/definitions.protocol.inc.php");
@set_error_handler("handleError");
if(Server::InitDataProvider())
{
Server::DefineURL("script.php");
if(!empty($_GET["id"]))
{
if($_GET["id"] != "lzdefsc")
{
$code = utf8_decode(Configuration::GetCodeById($_GET["id"]));
if($code == null)
exit("document.write('Error: LiveZilla code does not exist');");
}
else
{
$_GET["hfk"] = true;
require(LIVEZILLA_PATH . "_lib/functions.external.inc.php");
$code = OverlayChat::GetDefaultScript(false,$_GET["id"]);
$code = str_replace("<!--ptdata-->","",$code);
}
}
else
exit();
}
else
exit();
$code = str_replace("<!--server-->",LIVEZILLA_URL."server.php",$code);
?>
function scrb64d(r){var e,n,a,t,f,d,h,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="",c=0;for(r=r.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<r.length;)t=i.indexOf(r.charAt(c++)),f=i.indexOf(r.charAt(c++)),d=i.indexOf(r.charAt(c++)),h=i.indexOf(r.charAt(c++)),e=t<<2|f>>4,n=(15&f)<<4|d>>2,a=(3&d)<<6|h,o+=String.fromCharCode(e),64!=d&&(o+=String.fromCharCode(n)),64!=h&&(o+=String.fromCharCode(a));return o=o}
var scrttze = function (_sid,_script){
var container = document.createElement("div");
container.innerHTML = scrb64d(_script);
if(document.getElementById(_sid))
document.getElementById(_sid).parentNode.appendChild(container);
else
document.body.appendChild(container);
if(document.getElementById('lz_r_scr_'+_sid)!=null)
eval(document.getElementById('lz_r_scr_'+_sid).innerHTML);
//comp
else if(document.getElementById('lz_r_scr')!=null)
eval(document.getElementById('lz_r_scr').innerHTML);
if(document.getElementById('lz_textlink')!=null){
var newScript = document.createElement("script");
newScript.src = document.getElementById('lz_textlink').src;
newScript.async = true;
document.head.appendChild(newScript);
}
var links = document.getElementsByClassName('lz_text_link');
for(var i=0;i<links.length;i++)
if(links[i].className == 'lz_text_link'){
var newScript = document.createElement("script");
newScript.src = links[i].src;
newScript.async = true;
if(document.getElementById('es_'+links[i].id)==null)
{
newScript.id = 'es_'+links[i].id;
document.head.appendChild(newScript);
}
}
};
function ssc(sid,script)
{
if(window.addEventListener)
window.addEventListener('load',function() {scrttze(sid,script);});
else
window.attachEvent('onload',function() {scrttze(sid,script);});
}
ssc('<?php echo $_GET["id"]; ?>','<?php echo base64_encode($code); ?>');