PS3_Toolset/files/xframework.min.js

1 line
200 KiB
JavaScript
Raw Normal View History

var bgjsf_version="4.2",getElapsedTime=function(e){var t=(new Date-e)/1e3,r=Math.round(t%60).toString(),s=Math.floor(t/60).toString();return s>0?"Time elapsed: "+s+"mn "+r+"s":"Time elapsed: "+r+"s"};function getMaxAvailableBuffer(){var e=helper.swf.getMaxAvailableBufferAllocSize();return helper.buffer.create(e-e%65536)}function processJobList(e){var t=[],r=[];$.each(e,function(e,s){"file"===s.type?t.push(s):"folder"===s.type&&r.push(s)}),r.length>0&&makeDirectories(r),t.length>0&&copyDispatcher(t)}function deleteFiles(e){for(var t=0;t<e.length;t++)deleteFile(e[t])}function removeDirectories(e){for(var t=0;t<e.length;t++)removeDir(e[t])}function makeDirectories(e){for(var t=0;t<e.length;t++)makeDir(e[t])}function copyDispatcher(e){getMaxAvailableBuffer();var t={no_thread:[],one_thread:[],n_thread:[],errors:[]};$.each(e,function(e,r){r.error={code:0,msg:""};var s=fsitem_getsize(r.src);return 0===s?(r.error.code=2415919103,r.error.msg+="File Object in mode RO - no data to copy",t.errors.push(r),!0):s>4294967295?(r.error.code=2415919103,r.error.msg+="File Object in mode RO - supports file up to 4Gb max",t.errors.push(r),!0):void(s<=8192?t.no_thread.push(r):s<=helper.mbytes?t.one_thread.push(r):t.n_thread.push(r))}),setTimeout(function r(){t.errors.length+t.no_thread.length+t.one_thread.length+t.n_thread.length===e.length||setTimeout(r,500)},500)}function copyObject(e,t,r,s){this.error={code:0,msg:""};var o=new fileObject(e);if(0===o.size)return this.error.code=2415919103,void(this.error.msg+="File Object in mode RO - no data to copy");if(o.size>4294967295)return this.error.code=2415919103,void(this.error.msg+="File Object in mode RO - supports file up to 4Gb max");if(this.error.code=o.open(),0===this.error.code){var l=new fileObject(t);if(this.error.code=l.open(helper.fs_flag_create_append_rw),0===this.error.code){var n=Math.floor(o.size/r),i=o.size-n*r,a=helper.heap.store(helper.sem_attr_fifo),p=4+24*(n+1),c=helper.heap.store(p);stdc.memset(c,255,p);var d=c;c+=4;var u,h,g=[],f=[],_=[],m=[],x=[];helper.rop.run(syscall32(helper.sys_sem_create,d,a,0,1)),u=helper.memory.upeek32(d);var b=h=syscall32(helper.sys_sem_wait,u,0),y=syscall32(helper.sc_fs_read,o.fd,s,286331153,572662306)+store_r3_word(858993459),v=y.substr(0,520),C=y.substr(536,672),D=y.substr(1216),F=syscall32(helper.sc_fs_write,l.fd,s,286331153,572662306)+store_r3_word(858993459)+h,S=F.substr(0,520),k=F.substr(536,672),w=F.substr(1216);x[0]="Multithreaded File Copy Operations:<br>Thread BGXPLOIT_FXCOPY created<br>";for(var E=0;E<n;E++)g[E]=c,f[E]=c+4,_[E]=c+8,m[E]=c+16,c+=24,b+=v+_[E].toString32()+r.toString32()+C+g[E].toString32()+D+S+m[E].toString32()+r.toString32()+k+f[E].toString32()+w,x[E]+="<br>Copy Object mt_read - Current File Offset: 0x"+(E*r).toString32()+"<br>Copy Object mt_write - Data Written: 0x"+r.toString32();if(i>0&&(g[n]=c,f[n]=c+4,_[n]=c+8,m[n]=c+16,c+=24,b+=v+_[n].toString32()+i.toString32()+C+g[n].toString32()+D+S+m[n].toString32()+i.toString32()+k+f[n].toString32()+w,x[n]+="<br>Copy Object mt_read - Current File Offset: 0x"+(n*r+i).toString32()+"<br>Copy Object mt_write - Data Copied: 0x"+i.toString32()+" bytes"),(b+=syscall32(helper.sc_fs_close,o.fd)+syscall32(helper.sc_fs_close,l.fd)+h).length/2%8!=0)return this.error.code=1717986918,void(this.error.msg+="Invalid SF size: 0x"+(b.length/2).toString(16)+" bytes");x[n]+="<br>Copy Object Operations complete";var B=createThreadwithOPD(b,0,"BGXPLOIT_FXCOPY",200,2048,prep_threading());0===B.tid&&(this.error.code=2004318071,this.error.msg+="Thread Creation Error"),this.thread_object={tid:B.tid,rret:g,wret:f,log:x,stack_offset:B.stack_offset,sem_id:u,rlen:_,wlen:m}}else this.error.msg+="File Object in mode RW cannot open"}else this.error.msg+="File Object in mode RO cannot open"}var string=function(e,t){var r=function(e){if(e)return e;throw Error("string object deleted")},s=!0===t||!1!==t,o=e||"";if(!1===s&&o.length%2>0)throw Error("string invalid argument");var l=s?e.length+1:e.length/2,n=helper.heap.store(e,s);this.offset=function(){return r(n)},this.length=function(){return s?r(l)-1:r(l)},this.pee