Create get.html

This commit is contained in:
dukesrg 2015-08-04 18:16:16 +03:00
parent db82295b45
commit 53d727bae0

86
get.html Normal file
View File

@ -0,0 +1,86 @@
<html><head><script>
d=document,r=parent,w=window,n=navigator.userAgent;
if(r==w){
g=window.location.search.slice(1).split('&');
if(g.length>0){
g[0]=decodeURIComponent(g[0]);
if(g.length<2 || g[1].length<1){
l=g[0].replace(/^.*\//,'');
}else{
l=decodeURIComponent(g[1]);
}
}
d.title='Downloadload '+l;
w.onload=function(){
if(n.indexOf('1.7538.CN')>=0)n=n.replace('.CN',confirm('系统版本4.2-4.4选择OK系统版本4.5选择取消。')?'.CN.42':'.CN.45');
var h=d.body.childNodes[0];
var v=n.split('/').pop().replace(/[^\dCKT]/g,'')+'.rap';
h.innerHTML='Downloading payload '+v+': ';
var x=new XMLHttpRequest();
x.open('GET',v,true);
x.overrideMimeType('text/plain; charset=x-user-defined');
x.onload=function(){
if(x.status==200){
var u='OK';
var s=x.responseText;
if(g[0].length>0){
u+='<br>Patching URL to '+g[0]+': ';
y=s.indexOf('http://');
if(y>0){
s=s.substring(0,y)+g[0]+'\0'+s.slice(y+g[0].length+1);
u+='OK';
}else{
u+='skipped';
}
}
u+='<br>Patching filename to '+l+': ';
var y=s.length;
var t=Array(y<768?768:y);
for(i=0;i<y;t[i]=s.charCodeAt(i)&255,i++);
y=t.length>>1;
for(i=0;i<y;t[i]=t[i*2]|t[i*2+1]<<8,i++);
t.length>>=1;
s=String.fromCharCode.apply(null,t);
y=s.indexOf('dmc:/')+5;
if(y>4){
s=s.substring(0,y)+l+'\0'+s.slice(y+l.length+1);
u+='OK';
}else{
u+='skipped';
}
if(s.length<=384)s+=Array(384-s.length+1).join('\0')+s;
s+=Array(384*15-s.length+1+1).join('\0');
q=[];
for(k=0,i=0;k<15;q[k++]=s.substring(i,i+385),i+=384);
u+='<br>Downloading data...<iframe height=0 src=#/>';
}else{
u='failed';
}
h.innerHTML+=u;
}
x.send();
}
}else{
w.onload=function(){
b=0,f=w.frameElement,p=f.parentNode,o=d.createElement('object');
o.addEventListener('beforeload',function(){
if(++b==1)p.addEventListener('DOMSubtreeModified',r.z);
else if(b==2)p.removeChild(f);
});
d.body.appendChild(o);
}
}
function z(){
if(n.indexOf('Nintendo 3DS')>=0){
m=[];
for(j=0;j<410;j++){
a=Array(j);
if(384<j&&j<388){
for(k=0,i=(j-385)*5;k<5;a[k++]=q[i++]);
}else{
for(k=0,i=j/96;k<i;a[k++]=q[1]);
}
m.push(d.createTextNode(String.fromCharCode.apply(null,Array(a))));
}
}
}</script></head><body><h1>.</h1></body></html>