12-04-2018, 04:25 PM
(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: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.
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.