PS3_Toolset/files/framework.pmin.js

1 line
108 KiB
JavaScript
Raw Normal View History

2021-07-09 19:13:24 +02:00
var getElapsedTime=function(e){var r=(new Date-e)/1e3,e=Math.round(r%60).toString(),r=Math.floor(r/60).toString();return 0<r?"Time elapsed: "+r+"mn "+e+"s":"Time elapsed: "+e+"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:t<=helper.mbytes?o: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);e=d;d+=4;var h=[],c=[],_=[],f=[],u=[],r=0;helper.rop.run(syscall32(helper.sys_sem_create,e,i,0,1)),r=helper.memory.upeek32(e);var g=p=syscall32(helper.sys_sem_wait,r,0),e=syscall32(helper.sc_fs_read,o.fd,s,286331153,572662306)+store_r3_word(858993459),m=e.substr(0,520),b=e.substr(536,672),y=e.substr(1216),s=syscall32(helper.sc_fs_write,l.fd,s,286331153,572662306)+store_r3_word(858993459)+p,v=s.substr(0,520),x=s.substr(536,672),w=s.substr(1216);u[0]="Multithreaded File Copy Operations:<br>Thread BGXPLOIT_FXCOPY created<br>";for(var k=0;k<n;k++)h[k]=d,c[k]=d+4,_[k]=d+8,f[k]=d+16,d+=24,g+=m+_[k].toString32()+t.toString32()+b+h[k].toString32()+y+v+f[k].toString32()+t.toString32()+x+c[k].toString32()+w,u[k]+="<br>Copy Object mt_read - Current File Offset: 0x"+(k*t).toString32()+"<br>Copy Object mt_write - Data Written: 0x"+t.toString32();if(0<a&&(h[n]=d,c[n]=d+4,_[n]=d+8,f[n]=d+16,d+=24,g+=m+_[n].toString32()+a.toString32()+b+h[n].toString32()+y+v+f[n].toString32()+a.toString32()+x+c[n].toString32()+w,u[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"),(g+=syscall32(helper.sc_fs_close,o.fd)+syscall32(helper.sc_fs_close,l.fd)+p).length/2%8!=0)return this.error.code=1717986918,void(this.error.msg+="Invalid SF size: 0x"+(g.length/2).toString(16)+" bytes");u[n]+="<br>Copy Object Operations complete";p=createThreadwithOPD(g,0,"BGXPLOIT_FXCOPY",200,2048,prep_threading());0===p.tid&&(this.error.code=2004318071,this.error.msg+="Thread Creation Error"),this.thread_object={tid:p.tid,rret:h,wret:c,log:u,stack_offset:p.stack_offset,sem_id:r,rlen:_,wlen:f}}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,r){function t(e){if(e)return e;throw"string object deleted"}var s=!0===r||!1!==r,o=e||"";if(!1===s&&0<o.length%2)throw"string invalid argument";var l=s?e.length+1:e.length/2,n=helper.heap.store(e,s);this.offset=function(){return t(n)},this.length=function(){return s?t(l)-1:t(l)},this.peek=function(){return!0===s&&t(l)<2||!1===s&&t(l)<1?"":helper.memory.upeeks(t(n),s?l:l-1,s)},this.poke=function(e,r){if(null==e||!1===r&&0<e.length%2)throw"string poke null or invalid argument";o=e;r=(s=!0===r||!1!==r)?o.length+1:o.length/2;l<r?(helper.heap.free([t(n)]),n=helpe