PS3_Toolset/files/framework.pmin.js

1 line
106 KiB
JavaScript
Raw Normal View History

2021-05-23 22:48:48 +02:00
var getElapsedTime=function(e){var r=(new Date-e)/1e3,t=Math.round(r%60).toString(),s=Math.floor(r/60).toString();return 0<s?"Time elapsed: "+s+"mn "+t+"s":"Time elapsed: "+t+"s"};function getMaxAvailableBuffer(){var e=helper.swf.getMaxAvailableBufferAllocSize();return helper.buffer.create(e-e%65536)}function processJobList(e){var t=[],s=[];$.each(e,function(e,r){"file"===r.type?t.push(r):"folder"===r.type&&s.push(r)}),0<s.length&&makeDirectories(s),0<t.length&&copyDispatcher(t)}function deleteFiles(e){for(var r=0;r<e.length;r++)deleteFile(e[r])}function removeDirectories(e){for(var r=0;r<e.length;r++)removeDir(e[r])}function makeDirectories(e){for(var r=0;r<e.length;r++)makeDir(e[r])}function copyDispatcher(e){getMaxAvailableBuffer();var s=[],o=[],l=[];$.each(e,function(e,r){r.error={code:0,msg:""};new fileObject(fp1);var t=fsitem_getsize(r.src);return 0===t?(r.error.code=2415919103,r.error.msg+="File Object in mode RO - no data to copy",!0):4294967295<t?(r.error.code=2415919103,r.error.msg+="File Object in mode RO - supports file up to 4Gb max",!0):void(t<=8192?s.push(r):t<=helper.mbytes?o.push(r):l.push(r))})}function copyObject(e,r,t,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(4294967295<o.size)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(r);if(this.error.code=l.open(helper.fs_flag_create_append_rw),0===this.error.code){var n=Math.floor(o.size/t),a=o.size-n*t,i=helper.heap.store(helper.sem_attr_fifo),p=4+24*(n+1),d=helper.heap.store(p);libc.memset(d,255,p);var h=d;d+=4;var c,_,f=[],u=[],g=[],m=[],b=[];helper.rop.run(syscall32(helper.sys_sem_create,h,i,0,1)),c=helper.memory.upeek32(h);var y=_=syscall32(helper.sys_sem_wait,c,0),v=syscall32(helper.sc_fs_read,o.fd,s,286331153,572662306)+store_r3_word(858993459),x=v.substr(0,520),w=v.substr(536,672),k=v.substr(1216),S=syscall32(helper.sc_fs_write,l.fd,s,286331153,572662306)+store_r3_word(858993459)+_,F=S.substr(0,520),O=S.substr(536,672),L=S.substr(1216);b[0]="Multithreaded File Copy Operations:<br>Thread BGXPLOIT_FXCOPY created<br>";for(var D=0;D<n;D++)f[D]=d,u[D]=d+4,g[D]=d+8,m[D]=d+16,d+=24,y+=x+g[D].toString32()+t.toString32()+w+f[D].toString32()+k+F+m[D].toString32()+t.toString32()+O+u[D].toString32()+L,b[D]+="<br>Copy Object mt_read - Current File Offset: 0x"+(D*t).toString32()+"<br>Copy Object mt_write - Data Written: 0x"+t.toString32();if(0<a&&(f[n]=d,u[n]=d+4,g[n]=d+8,m[n]=d+16,d+=24,y+=x+g[n].toString32()+a.toString32()+w+f[n].toString32()+k+F+m[n].toString32()+a.toString32()+O+u[n].toString32()+L,b[n]+="<br>Copy Object mt_read - Current File Offset: 0x"+(n*t+a).toString32()+"<br>Copy Object mt_write - Data Copied: 0x"+a.toString32()+" bytes"),(y+=syscall32(helper.sc_fs_close,o.fd)+syscall32(helper.sc_fs_close,l.fd)+_).length/2%8!=0)return this.error.code=1717986918,void(this.error.msg+="Invalid SF size: 0x"+(y.length/2).toString(16)+" bytes");b[n]+="<br>Copy Object Operations complete";var E=createThreadwithOPD(y,0,"BGXPLOIT_FXCOPY",200,2048,prep_threading());0===E.tid&&(this.error.code=2004318071,this.error.msg+="Thread Creation Error"),this.thread_object={tid:E.tid,rret:f,wret:u,log:b,stack_offset:E.stack_offset,sem_id:c,rlen:g,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 u32=function(e){var r=e||0,t=helper.heap.store(parseInt(r).toString32());this.offset=function(){return t},this.value=function(e){return e?(r=e,helper.memory.upoke32(t,parseInt(r)),0):helper.memory.upeek32(t)}},u64=function(e){var r=e?bigInt.isUInt64(e)?e:Uint64(e):Uint64(0),t=helper.heap.store(r.toString64());this.offset=function(){return t},this.value=function(e){return e?(r=bigInt.isUInt64(e)?e:Uint64(e),helper.memory.upokes(t,r.toString64()),0):Uint64(helper.memory.upeeks(t,8))}},regexTester=function(e){var r=e;this.filename_notchar=function(){retur