Users browsing this thread: 1 Guest(s)
Ripping from io games
#15
Smile 
(12-04-2018, 12:47 AM)Simpsons Dumper Wrote: First step would be to run it through an unminifier so you can see what's going on. Then look for anything that specifies drawing instructions. This excerpt would be a start:

Code:
(function($0, $1) {
       {
           cp5.contexts[$0].globalAlpha = $1
       }
   }), (function($0, $1, $2, $3) {
       {
           cp5.contexts[$0].fillStyle = cp5.patterns[$1];
           cp5.contexts[$0].fillRect(0, 0, $2, $3)
       }
   }), (function($0, $1, $2, $3, $4, $5) {
       {
           cp5.contexts[$0].drawImage(cp5.contexts[$1].canvas, $2, $3, $4, $5, 0, 0, 1, 1)
       }
   }), (function($0, $1) {
       {
           var img = cp5.images[$1];
           if (!img.isLoaded) return;
           if (img.width == 0 || img.height == 0) return;
           cp5.contexts[$0].drawImage(img, 0, 0, img.width, img.height, 0, 0, 1, 1)
       }
   }), (function() {
       {
           return allocateUTF8(textInput.value)
       }
   }), (function($0, $1, $2, $3) {
       {
           cp5.contexts[$0].arc(0, 0, 1, $1, $2, $3)
       }
   }), (function($0) {
       {
           cp5.contexts[$0].rect(0, 0, 1, 1)
       }
   }), (function($0, $1) {
       {
           var canvas = cp5.contexts[$1].canvas;
           cp5.contexts[$0].drawImage(canvas, 0, 0, canvas.width, canvas.height, 0, 0, 1, 1)
       }
   }), (function($0) {
       {
           cp5.contexts[$0].strokeRect(0, 0, 1, 1)
       }
   })

But reverse-engineering some generic browser game that no-one will remember just to get a few circles and squares is seriously not worth your time.

That file might not even be the whole picture - I've not sifted through any of this in much detail. I think you'd be in over your head. Even Mr JavaScript Expert would take a while to make anything useful of it.

I guess your desired end result would be to get some SVGs out of it? I'm not sure if that would be possible, since canvas has raster results, but I suppose if it specifies stuff like "100px red circle with 5px border", you could manually perfectly recreate that in an SVG file, either with ye olde text editor or using software such as Inkscape.
Thanks. If I start this, I will probably be in over my head, so I won't try to rip those any time soon. Thank you Simpsons Dumper and Revistiv.  Smile
Reply
Thanked by:


Messages In This Thread
Ripping from io games - by DemoCrew19 - 11-28-2018, 08:35 AM
RE: Ripping from io games - by Resistiv - 11-28-2018, 09:46 AM
RE: Ripping from io games - by DemoCrew19 - 11-28-2018, 04:11 PM
RE: Ripping from io games - by Simpsons Dumper - 11-28-2018, 12:58 PM
RE: Ripping from io games - by Resistiv - 11-28-2018, 07:19 PM
RE: Ripping from io games - by Simpsons Dumper - 11-29-2018, 01:03 PM
RE: Ripping from io games - by DemoCrew19 - 11-30-2018, 03:59 PM
RE: Ripping from io games - by Resistiv - 11-30-2018, 04:07 PM
RE: Ripping from io games - by DemoCrew19 - 12-03-2018, 07:56 AM
RE: Ripping from io games - by Resistiv - 12-03-2018, 09:55 AM
RE: Ripping from io games - by DemoCrew19 - 12-03-2018, 11:05 AM
RE: Ripping from io games - by Simpsons Dumper - 12-03-2018, 01:50 PM
RE: Ripping from io games - by DemoCrew19 - 12-03-2018, 02:56 PM
RE: Ripping from io games - by Simpsons Dumper - 12-04-2018, 12:47 AM
RE: Ripping from io games - by DemoCrew19 - 12-04-2018, 04:25 PM

Forum Jump: