md5 check on node webkit

Get help using Construct 2

Post » Mon Aug 19, 2013 2:26 am

Hi,

So, I was messing with a demo I exported on Node-Webkit and I noticed that the package.nw file is just a .zip with all the images/code/music/sounds inside of it.

Since C2 does a good job obfuscating the code, I'm not worried with it.. however I'm a bit worried that people can change the images of my game, put it in the "zip" file, and run it. I tested it here, and the game run perfectly, even with the modified package.nw file.

I asked this question in the node-webkit group on google, but I'll also ask here.. is there a good way to protect that file from anyone modifying it ?

Maybe check the md5 hash of the file to compare it in-game, and give an error if it doesn't match? I know there's a plugin around but I couldn't find a way to retrieve the hash out of the package.nw file at the beggining of the game to compare it..

Thanks!
B
123
S
43
G
41
Posts: 847
Reputation: 28,206

Post » Thu Aug 29, 2013 6:16 pm

Curious about this as well - noticed I can see everything including base txt files that are being AJAX'd into the game simply by unzipping the package.nw file. If I recall, previous versions had the package grouped into the exe which I assume made it harder to just unzip? Is there a way to enable this?
B
9
S
3
Posts: 58
Reputation: 1,566

Post » Thu Aug 29, 2013 6:19 pm

Hey @Agni

I posted about this on the node-webkit google group and someone recommended me this:

http://enigmaprotector.com/en/aboutvb.html

It's free to use commercially, too! I haven't tested it yet though.
B
123
S
43
G
41
Posts: 847
Reputation: 28,206

Post » Thu Aug 29, 2013 6:31 pm

Wow, thank so much for the quick response. This looks pretty cool, will test. :)
B
9
S
3
Posts: 58
Reputation: 1,566

Post » Thu Aug 29, 2013 7:33 pm

Haha, okay so this doesn't seem to work very well. I can just rename the boxed exe file to zip and then unzip it to see all the files.
B
9
S
3
Posts: 58
Reputation: 1,566

Post » Thu Aug 29, 2013 7:48 pm

@Agni weird, I just tried it out and it worked! I renamed it to .zip and it didn't extract, I even tried using a software called "UniExtract" which usually extracts whatever it cans from .exe files, and all it extracted were some weird files.

And the game still runs perfectly!

Did you do it right? You have to add the files at the bottom, then pick the exe at the top and click process.

Like this:

B
123
S
43
G
41
Posts: 847
Reputation: 28,206

Post » Thu Aug 29, 2013 8:02 pm

I went into file options and checked 'compress files' and it worked after that! With default settings it extracted the file as .enigma1 (which I could then extract again to see everything)
B
9
S
3
Posts: 58
Reputation: 1,566

Post » Thu Aug 29, 2013 10:58 pm

@andreyin Wondering if you have found anything similar for webstorage protection? Just enough so you can't edit with notepad++ would be nice since that seems a bit silly. Searching through forums I saw some crc32 stuff with Construct Classic but not sure how to use that with C2.
B
9
S
3
Posts: 58
Reputation: 1,566

Post » Fri Aug 30, 2013 2:52 am

@Agni sorry, what do you mean? I haven't tested saving with webstorage yet, what happens when you do it? It creates a file in the game's folder?
B
123
S
43
G
41
Posts: 847
Reputation: 28,206

Post » Fri Aug 30, 2013 3:02 am

Sent you a PM but this appears to be a reasonable fix:
http://www.scirra.com/forum/plugincb-hash-md5-sha1-and-sha256_topic43824.html
B
9
S
3
Posts: 58
Reputation: 1,566

Next

Return to How do I....?

Who is online

Users browsing this forum: Kermad, yiuyiu6666 and 20 guests