Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dpma/bundle.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{"timestamp":1553210830203,"code":"!function(s){var t={};function n(i){if(t[i])return t[i].exports;var e=t[i]={i:i,l:!1,exports:{}};return s[i].call(e.exports,e,e.exports,n),e.l=!0,e.exports}n.m=s,n.c=t,n.d=function(s,t,i){n.o(s,t)||Object.defineProperty(s,t,{enumerable:!0,get:i})},n.r=function(s){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(s,\"__esModule\",{value:!0})},n.t=function(s,t){if(1&t&&(s=n(s)),8&t)return s;if(4&t&&\"object\"==typeof s&&s&&s.__esModule)return s;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,\"default\",{enumerable:!0,value:s}),2&t&&\"string\"!=typeof s)for(var e in s)n.d(i,e,function(t){return s[t]}.bind(null,e));return i},n.n=function(s){var t=s&&s.__esModule?function(){return s.default}:function(){return s};return n.d(t,\"a\",t),t},n.o=function(s,t){return Object.prototype.hasOwnProperty.call(s,t)},n.p=\"\",n(n.s=1)}([function(module,exports){const Injector=window.Injector=window.Injector||(()=>{let exports=null,exportPromise=new Promise(s=>{window.__injectCall=(t=>{exports=t,s(t)})}),appender=`;__injectCall({${[\"Module\",\"cp5\",\"Runtime\",\"Browser\",\"ASM_CONSTS\"].map(s=>'r: typeof r !== \"undefined\" && r'.replace(/r/g,s)).join(\",\")}})`,replaced=[],replacedWith=[],replace=(s,t)=>{let{name:n}=t;replaced.push(s[n]),replacedWith.push(t),s[\"_\"+n]=s[n],s[n]=t};return replace(Function.prototype,function(){let s=replacedWith.indexOf(this);return this._toString.call(-1===s?this:replaced[s])}),replace(document,function getElementById(id){if(\"textInput\"!==id)return this._getElementById(id);throw this.getElementById=this._getElementById,fetch(document.querySelector('script[src*=\"build_\"]').src).then(s=>s.text()).then(s=>s.replace(/}\\)\\)\\(window\\)\\s*$/,s=>appender+s)).then(eval),new Error(\"Disabling default source\")}),{get exports(){if(!exports)throw new Error(\"Exports are not yet ready!\");return exports},maybeExports:()=>exports,getExports:()=>exportPromise,replace:replace}})();module.exports=Injector},function(s,t,n){const i=n(0),e=n(2),c=n(3),l=n(4),o=\"yes\"===localStorage[\"actually know javascript\"],m=class{constructor(s){this.parent=[s,...s.parent]}render(s,t,n){console.warn(\"Component missing render function!\",this)}renderAbsolute(s,t,n,i,e){s.clip(t,n,i,e),this.render(s,i,e),s.pop()}},h=class extends m{constructor(s,t=!1,n=!1){super(s),this.horizontal=t,this.resizable=n,this.children=[],this.size=0}render(s,t,n){let i=this.children.filter(s=>!s.hidden);if(this.horizontal){if(this.resize(t),this.resizable&&i.length>=2){let t=i[0].size;for(let e=1;e<i.length;e++){let l=i[e-1],o=i[e],m=e===i.length-1?5:c.min(o.size/2,5);if(s.mouse(o.mc,t-5,0,5+m,n),t+=o.size,o.mc.owned)if(s.cursor(\"col-resize\"),o.mc.left){let s=c.constrain(1===e?10-l.size:-l.size,e===i.length-1?o.size-10:o.size,o.mc.dx);l.size+=s,o.size-=s,o.mc.dx-=s}else o.mc.dx=0;else o.mc.dx=0}}let e=0;for(let{size:t,child:c}of i)c.renderAbsolute(s,e,0,t,n),e+=t}else{if(this.resize(n),this.resizable&&i.length>=2){let n=i[0].size;for(let e=1;e<i.length;e++){let l=i[e-1],o=i[e],m=e===i.length-1?5:c.min(o.size/2,5);if(s.mouse(o.mc,0,n-5,t,5+m),n+=o.size,o.mc.owned)if(s.cursor(\"row-resize\"),o.mc.left){let s=c.constrain(1===e?10-l.size:-l.size,e===i.length-1?o.size-10:o.size,o.mc.dy);l.size+=s,o.size-=s,o.mc.dy-=s}else o.mc.dy=0;else o.mc.dy=0}}let e=0;for(let{size:n,child:c}of i)c.renderAbsolute(s,0,e,t,n),e+=n}}createChild(s,...t){let n=new s(this,...t),i=this.children.length?c.floor(this.size/this.children.length):1024;return this.children.push({child:n,size:i,hidden:!1,mc:e.mc()}),this.size+=i,n}resizeChildren(s){let t=0;for(let n of this.children){let i=s.shift();i||0===i?(n.size=i,n.hidden=!1,t+=n.size):(n.size=0,n.hidden=!0)}this.size=t}resize(s){if(this.size===s)return;let t=0,n=0;for(let i of this.children){t+=i.size;let e=c.round(t/this.size*s);i.size=e-n,n=e}this.size=s}},r=class extends m{constructor(s){super(s),this.position=0,this.mcBar=e.mc(),this.mc=e.mc()}render(s,t,n){let i=c.max(t-10,0),e=this.queryHeight(i),l=t-i;if(e<=n){let s=this.queryHeight(t,0);s<=n&&(i=t,e=s,l=0,this.position=0)}let o=(e-n)*this.position;s.clip(0,0,i,n),s.translate(0,-o),this.renderSection(s,i,c.max(n,e),o,o+n),s.pop(),s.pop();let m=c.min(c.max(10,n*n/e),n),h=(n-m)*this.position;if(s.mouse(this.mcBar,i,h,l,m),s.mouse(this.mc,0,0,t,n),this.mcBar.owned)if(s.cursor(\"default\"),this.mcBar.left){let s=this.mcBar.dy/(n-m);this.position+=s;let t=c.constrain(0,1,this.position);this.mcBar.dy=(this.position-t)*(n-m),this.position=t}else this.mcBar.dy=0;else this.mcBar.dy=0;this.mc.owned&&s.cursor(\"default\");let r=this.mc.scroll+this.mcBar.scroll;this.position+=r/(e-n)*40,this.position=c.constrain(0,1,this.position),this.mc.scroll=0,this.mcBar.scroll=0,s.fill(\"#f8f8f8\"),s.rect(i,0,l,n),s.fill(\"#cccccc\"),s.rect(i,h,l,m)}queryHeight(s){return console.warn(\"Scrollable missing querySize function!\",this),0}renderSection(s,t,n,i,e){console.warn(\"Scrollable missing renderSection function!\",this)}},u=class extends m{constructor(s){super(s)}render(s,t,n){s.fill(\"#000000\"),s.rect(0,0,t,n),s.fill(\"#ffffff\"),s.rect(2,2,t-4,n-4)}},p=class extends m{constructor(s){super(s),this.camera={x:0,y:0,zoom:.2},this.mc=e.mc()}render(s,t,n){if(s.mouse(this.mc,0,0,t,n),this.mc.owned){if(this.mc.left?s.cursor(\"move\"):s.cursor(\"default\"),this.mc.left||0!==this.mc.scroll){let s=c.pow(.85,this.mc.scroll),i=this.mc.x-t/2,e=this.mc.y-n/2,l=(this.mc.left?this.mc.dx/this.camera.zoom:0)-i/this.camera.zoom,o=(this.mc.left?this.mc.dy/this.camera.zoom:0)-e/this.camera.zoom;this.camera.zoom=c.constrain(.01,2,this.camera.zoom*s),this.camera.x+=l+i/this.camera.zoom,this.camera.y+=o+e/this.camera.zoom}this.mc.dx=0,this.mc.dy=0,this.mc.scroll=0}s.fill(\"#f7f7f7\"),s.rect(0,0,t,n),s.fill(\"#c4c4c4\"),s.rectLineHorizontal(0,t,this.camera.y*this.camera.zoom+c.floor(n/2),2),s.rectLineVertical(this.camera.x*this.camera.zoom+c.floor(t/2),0,n,2),s.translate(c.floor(t/2)+this.camera.x*this.camera.zoom,c.floor(n/2)+this.camera.y*this.camera.zoom);let[i]=l(68184).$vector,e=i?{arenaRight:i[216].f32,leaderScore:i[384].f32,leaderX:i[552].f32,arenaTop:i[560].f32,arenaBottom:i[656].f32,leaderY:i[664].f32,arenaLeft:i[672].f32}:{arenaRight:0,leaderScore:0,leaderX:0,arenaTop:0,arenaBottom:0,leaderY:0,arenaLeft:0},o=e.arenaLeft*this.camera.zoom,m=e.arenaRight*this.camera.zoom,h=e.arenaTop*this.camera.zoom,r=e.arenaBottom*this.camera.zoom;s.rectLineHorizontal(o,m,h,2),s.rectLineHorizontal(o,m,r,2),s.rectLineVertical(o,h,r,2),s.rectLineVertical(m,h,r,2),s.font(10);let[u]=l(68208).$vector,p=u?65536*u[444].u32+u[442].u16:0,w=l(68220).$vector.map((s,t)=>{let n=l(68136).$vector[t],i=n?n[56].f32:null;return{x:s[40].f32,y:s[72].f32,id:65536*s.$[56].u32+s.$[54].u16,size:i}}),v=w.map(s=>s.id).reduce((s,t)=>s>t?s:t,-1);for(let{x:t,y:n,id:i,size:e}of w){s.fill(p===i?\"#36cf3e\":v===i?\"#3636cf\":\"#36363e\");let l=c.max(2,c.min(400,e)*this.camera.zoom);s.circle(t*this.camera.zoom,n*this.camera.zoom,l),s.text(`(${c.round(t)}, ${c.round(n)})`,t*this.camera.zoom+2+l,n*this.camera.zoom)}0===e.leaderX&&0===e.leaderY||(s.fill(\"#ff3202\"),s.circle(e.leaderX*this.camera.zoom,e.leaderY*this.camera.zoom,2),s.text(`(${e.leaderX.toFixed(4)}, ${e.leaderY.toFixed(4)})`,e.leaderX*this.camera.zoom+5,e.leaderY*this.camera.zoom-12)),s.pop()}},w=class extends r{constructor(s){super(s)}queryHeight(){return 16*l(68220).$vector.length}renderSection(s,t,n,i,e){s.fill(\"#f7f7f7\"),s.rect(0,i,t,e-i),s.font(12);let[o]=l(68208).$vector,m=o?65536*o[444].u32+o[442].u16:0,h=l(68220).$vector.map((s,t)=>{let n=l(68136).$vector[t],i=n?n[56].f32:null;return{i:t,x:s[40].f32,y:s[72].f32,id:65536*s.$[56].u32+s.$[54].u16,size:i}}),r=h.map(s=>s.id).reduce((s,t)=>s>t?s:t,-1);for(let{i:t,x:n,y:i,id:e,size:l}of h)s.fill(m===e?\"#36cf3e\":r===e?\"#3636cf\":\"#36363e\"),s.text(`${t} - ${e} - (${c.round(n)}, ${c.round(i)}) - ${l}`,10,8+16*t)}},v=class extends m{constructor(s,t=0){super(s),window.onresize=(()=>{}),0===t?(window.canvas.style.top=\"0\",window.canvas.style.left=\"0\",window.canvas.style.right=\"auto\",window.canvas.style.bottom=\"auto\",window.canvas.style.width=\"auto\",window.canvas.style.height=\"auto\"):window.canvas.style.display=\"none\",this.mode=t,this.disabled=!1,this.mc=e.mc()}renderAbsolute(s,t,n,e,m){if(s.mouse(this.mc,t,n,e,m),window.input)if(this.mc.owned){if(s.cursor(window.canvas.style.cursor),input.mouse(this.mc.x-t,this.mc.y-n),this.mc.left?input.keyDown(1):input.keyUp(1),this.mc.right?input.keyDown(3):input.keyUp(3),o&&0!==this.mc.scroll){let[s]=l(68208).$vector;if(s){let t=c.pow(.85,this.mc.scroll);s[44].f32*=t,this.mc.scroll=0}}}else input.keyUp(1),input.keyUp(3);let h=window.canvas;if(1===this.mode&&s.image(h,t,n,e,m),h.width===e&&h.height===m||(h.width=e,h.height=m),0===this.mode)window.canvas.style.top=n+\"px\",window.canvas.style.left=t+\"px\";else if(2===this.mode){h.width===e&&h.height===m||(h.width=e,h.height=m);const{Browser:c}=i.exports;this.disabled?c.mainLoop.runner():c.mainLoop.runner&&(c.mainLoop.pause(),c.mainLoop.currentlyRunningMainloop--,c.mainLoop.scheduler=(()=>{}),c.mainLoop.runner(),this.disabled=!0),s.image(h,t,n,e,m)}}},a=class extends h{constructor(){super({parent:[]},!0,!0),this.mc=e.mc(),this.canvas=this.createCanvas(),this.diepCanvas=this.createChild(v),this.controller=this.createChild(h,!1,!0),this.controller.createChild(p),this.controller.createChild(w),this.controller.createChild(u),this.controller.resizeChildren([3,1,1]),this.resizeChildren([3,1]),this.loop(),this.canvas.canvas.addEventListener(\"mousemove\",s=>{this.loop(!0)},!1)}createCanvas(){let s=document.body.appendChild(document.createElement(\"canvas\"));return s.style.position=\"absolute\",s.style.left=\"0\",s.style.right=\"0\",s.style.top=\"0\",s.style.bottom=\"0\",s.style.height=\"100%\",s.style.width=\"100%\",new e(s)}loop(s=!1){this.canvas.reset(window.innerWidth,window.innerHeight),this.render(this.canvas,window.innerWidth,window.innerHeight),this.canvas.mouse(this.mc,0,0,window.innerWidth,window.innerHeight),this.mc.owned&&this.canvas.cursor(\"default\"),s||requestAnimationFrame(()=>this.loop())}};console.log(\"[DPMA] Injecting...\"),i.getExports().then(()=>{console.log(\"[DPMA] Starting!\"),window.dpma=new a})},function(s,t){s.exports=class{static mc(){return{left:!1,right:!1,x:0,y:0,dx:0,dy:0,scroll:0,owned:!1}}constructor(s){this.canvas=s,this.ctx=s.getContext(\"2d\"),this.oldFontName=\"sans-serif\",this.mc=null,this.mcDefault={},this.mouseAt={x:0,y:0,left:!1,right:!1},this.translates=[{x:0,y:0}];let t=this.mouseAt,n=n=>{let{left:i,top:e}=s.getBoundingClientRect();t.x=n.clientX-i,t.y=n.clientY-e,this.mc&&(this.mc.dx+=n.movementX,this.mc.dy+=n.movementY)};s.addEventListener(\"click\",s=>{s.preventDefault()},!1),s.addEventListener(\"dragstart\",s=>{s.preventDefault()},!1),s.addEventListener(\"contextmenu\",s=>{s.preventDefault()},!1),s.addEventListener(\"mousedown\",s=>{s.preventDefault(),n(s),0===s.button?t.left=!0:2===s.button&&(t.right=!0)},!1),s.addEventListener(\"mousemove\",s=>{n(s)},!1),s.addEventListener(\"mouseup\",s=>{n(s),0===s.button?t.left=!1:2===s.button&&(t.right=!1)},!1),s.addEventListener(\"mousewheel\",s=>{this.mc&&(this.mc.scroll+=s.wheelDelta/-120||s.detail||0)},!1)}clip(s,t,n,i){let e=this.translates[this.translates.length-1];this.translates.push({x:s+e.x,y:t+e.y}),this.ctx.save(),this.ctx.translate(s,t),this.ctx.beginPath(),this.ctx.rect(0,0,n,i),this.ctx.clip()}translate(s,t){let n=this.translates[this.translates.length-1];this.translates.push({x:s+n.x,y:t+n.y}),this.ctx.save(),this.ctx.translate(s,t)}pop(){this.ctx.restore(),this.translates.pop()}mouse(s,t,n,i,e,c=null){let l=this.translates[this.translates.length-1];if(t+=l.x,n+=l.y,this.mc&&this.mc!==s)return;let o=this.mouseAt.x>=t&&this.mouseAt.x<t+i&&this.mouseAt.y>=n&&this.mouseAt.y<n+e;s.hover=o&&(!c||c(this.mouseAt));let m=s.hover||this.mc;m&&(m&&!s.owned&&(s.dx=s.dx||0,s.dy=s.dy||0,s.scroll=s.scroll||0,s.owned=!0),s.x=this.mouseAt.x-l.x,s.y=this.mouseAt.y-l.y,s.left=this.mouseAt.left,s.right=this.mouseAt.right,this.mc=s)}mouseClear(s,t,n,i,e=null){this.mouse(this.mcDefault,s,t,n,i,e)}reset(s,t){!0===this.mc?this.mc=null:this.mc&&!this.mc.left&&(this.mc.owned=!1,this.mc.hover=!1,this.mc=null);let n=s!==this.canvas.width||t!==this.canvas.height;return n?(this.canvas.width=s,this.canvas.height=t,this.ctx.textBaseline=\"middle\"):this.ctx.clearRect(0,0,s,t),[s,t,n]}cursor(s){this.canvas.style.cursor=s}fill(s){this.ctx.fillStyle=s}alpha(s){this.ctx.globalAlpha=s}rect(s,t,n,i){this.ctx.fillRect(s,t,n,i)}rectLineVertical(s,t,n,i){this.ctx.fillRect(s-i/2,t,i,n-t)}rectLineHorizontal(s,t,n,i){this.ctx.fillRect(s,n-i/2,t-s,i)}image(s,t,n,i,e){this.ctx.drawImage(s,t,n,i,e)}circle(s,t,n){this.ctx.beginPath(),this.ctx.arc(s,t,n,0,2*Math.PI),this.ctx.fill()}triangle(s,t,n,i,e,c){this.ctx.beginPath(),this.ctx.moveTo(s,t),this.ctx.lineTo(n,i),this.ctx.lineTo(e,c),this.ctx.fill()}quad(s,t,n,i,e,c,l,o){this.ctx.beginPath(),this.ctx.moveTo(s,t),this.ctx.lineTo(n,i),this.ctx.lineTo(e,c),this.ctx.lineTo(l,o),this.ctx.fill()}createShape(){return new class{constructor(s){this.ctx=s,this.points=[]}vertex(s,t){this.points.push([s,t])}render(){this.ctx.beginPath();for(let[s,t]of this.points)this.ctx.vertex(s,t)}close(){this.render(),this.ctx.closePath(),this.ctx.fill()}done(){this.render(),this.ctx.fill()}}(this.ctx)}font(s,t=this.oldFontName){this.ctx.font=s+\"px \"+(this.oldFontName=t)}text(s,t,n){this.ctx.fillText(s,t,n)}}},function(s,t){let n=Object.create(window.Math);n.constrain=((s,t,n)=>s>=t?(s+t)/2:n>=t?t:n<=s?s:n),s.exports=n},function(s,t,n){const i=n(0);let e=({ptr:s},t)=>{let{Module:{HEAPU8:n,HEAPU16:e,HEAPU32:c,HEAPU64:o,HEAPF32:m,HEAPF64:h}}=i.exports;switch(t){case\"u8\":return n[s];case\"u16\":return e[s>>1];case\"u32\":return c[s>>2];case\"u64\":return o[s>>3];case\"f32\":return m[s>>2];case\"f64\":return h[s>>3];case\"vector\":let i=[];for(let t=c[s>>2];t<c[1+(s>>2)];t+=4)i.push(l(t));return i;case\"$vector\":let r=[];for(let t=c[s>>2];t<c[1+(s>>2)];t+=4)r.push(l(c[t>>2]));return r;case\"$\":return l(c[s>>2])}let r=parseInt(t,10);if(!Number.isNaN(r))return l(s+r)},c=({ptr:s},t,n)=>{let{Module:{HEAPU8:e,HEAPU16:c,HEAPU32:l,HEAPU64:o,HEAPF32:m,HEAPF64:h}}=i.exports;switch(t){case\"u8\":return e[s]=n;case\"u16\":return c[s>>1]=n;case\"u32\":return l[s>>2]=n;case\"u64\":return o[s>>3]=n;case\"f32\":return m[s>>2]=n;case\"f64\":return h[s>>3]=n}},l=s=>new Proxy({ptr:s},{get:e,set:c});s.exports=l}]);"}
{
"timestamp": 1234567891011121314,
"code": "!function(){console.log('[DPMA] Injecting...');if(window.Injector)return;const Injector=window.Injector=(()=>{let exports=null;const exportPromise=new Promise(r=>{window.__injectCall=t=>{exports=t,r(t)}});const appender=`;__injectCall({${[\"Module\",\"cp5\",\"Runtime\",\"Browser\",\"ASM_CONSTS\"].map(s=>`r: typeof ${s}!==\\\"undefined\\\"&&${s}`).join(\",\")}})`;function findGameScript(){const scripts=[...document.scripts].filter(s=>s.src&&!s.src.includes('adinplay')&&!s.src.includes('crazygames'));return scripts.find(s=>/index-|build_|main\\./.test(s.src))||scripts[scripts.length-1]||null}function inject(){const script=findGameScript();if(!script){setTimeout(inject,100);return}fetch(script.src).then(r=>r.text()).then(code=>{const patched=code.replace(/}\\)\\)\\(window\\)\\s*$/,m=>appender+m);console.log('[DPMA] Patching game script...');eval(patched)}).catch(e=>console.error('[DPMA] Injection failed:',e))}const originalGet=document.getElementById.bind(document);document.getElementById=function(id){if(id==='textInput'){document.getElementById=originalGet;inject();return originalGet(id);}return originalGet(id)};return{get exports(){if(!exports)throw new Error('Exports not ready yet');return exports},maybeExports:()=>exports,getExports:()=>exportPromise}})();Injector.getExports().then(()=>console.log('[DPMA] Ready!'))}();"
}