GPWiki.org
GPWiki.org
It is currently Fri May 24, 2013 5:42 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Closed Source Java Games
PostPosted: Tue Jun 12, 2012 2:58 pm 
Level 1 Cleric

Joined: Wed Jan 25, 2012 10:52 pm
Posts: 11
Hello guys! I've just started work on a basic 2D Java game (only a player moving around on a screen), which I will be releasing soon along with a text based riddle game.

But, when it came to compiling it into the .jar file, I found that I could easily take the class out of it, and go to a website called ShowMyCode, and basically de-compile the class into the code. At first I thought it was just something I did wrong. Then I took out a class from my Minecraft jar, and it worked to, I could see the source of a Minecraft class.

Are there ways to overcome this to prevent code from being stolen? Because when I start to get good in Java and make some nice software applications with them, how will I prevent my code from being stolen?

Regards,
- Bicentic


Top
 Profile  
 
PostPosted: Tue Jun 12, 2012 4:12 pm 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1552
Location: burrowed
Usually you dont have to bother about it. If your game is not the next angry birds, nobody will bother looking at your code. Those who really want to take a look at your code will be able to one way or the other. (Those who are able to do that wont have the need to steal your code anyways).

A simple countermeasure you can take is obfuscation. Not sure if it is available in java, but it basically obfuscates all your classes and members with arbitrary names.

Code:
class a
{
int a_;
float b_;
}


etc.

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
PostPosted: Tue Jun 12, 2012 4:36 pm 
Level 1 Cleric

Joined: Wed Jan 25, 2012 10:52 pm
Posts: 11
weezl wrote:
Usually you dont have to bother about it. If your game is not the next angry birds, nobody will bother looking at your code. Those who really want to take a look at your code will be able to one way or the other. (Those who are able to do that wont have the need to steal your code anyways).

A simple countermeasure you can take is obfuscation. Not sure if it is available in java, but it basically obfuscates all your classes and members with arbitrary names.

Code:
class a
{
int a_;
float b_;
}


etc.


That's just how Minecraft has all their classes laid out. But what if I make I game which gets popular like RuneScape. I know RuneScape is browser based so they don't need to download the jar files etc...

but, I'm not a fan of that. And what if someone finds a part of code to do with money? Then they can create hacks and just ruin the game.


Top
 Profile  
 
PostPosted: Wed Jun 13, 2012 2:31 am 
Harmlessness does no harm
User avatar

Joined: Tue Sep 14, 2004 8:37 pm
Posts: 3809
Location: Ferriday, LA, US
Bicentric wrote:
I know RuneScape is browser based so they don't need to download the jar files etc...

RuneScape is distributed via Jar files. The only difference is that it is done automatically by the browser, but it's trivial finding the cached jar on your hard drive if you want to extract it (a Jar file is just a .zip file with a different extension) and view the code.

Bicentric wrote:
but, I'm not a fan of that. And what if someone finds a part of code to do with money? Then they can create hacks and just ruin the game.

You would handle anything important on the server end of the game. That doesn't automatically make things secure of course, but handling important stuff on the client side is more or less an open invitation to cheating/hacking.

_________________
What most people don't understand about "enlightenment" is that it is not an end-goal; but where you find yourself just before taking a new "first step."


Top
 Profile  
 
PostPosted: Wed Jun 13, 2012 7:30 am 
Level 1 Cleric

Joined: Wed Jan 25, 2012 10:52 pm
Posts: 11
Hmm, this idea may seem stupid, and probably wont work but...

What if I make a small C++ application and run the Java in there. And when I compile it I can hide the jar file somehow or have it converted into some file which is un-readable by the computer. I doubt this is possible tho :L


Top
 Profile  
 
PostPosted: Wed Jun 13, 2012 10:58 am 
Harmlessness does no harm
User avatar

Joined: Tue Sep 14, 2004 8:37 pm
Posts: 3809
Location: Ferriday, LA, US
Bicentric wrote:
Hmm, this idea may seem stupid, and probably wont work but...

What if I make a small C++ application and run the Java in there. And when I compile it I can hide the jar file somehow or have it converted into some file which is un-readable by the computer. I doubt this is possible tho :L

Well, in order to run Java code, you will need to have the standard jar. I suppose you could encrypt that jar and decrypt it at run-time, but that's not going to prevent anything.

Like weezl said, this is more or less a non-issue. But, if you're that worried about someone stealing your code, the best option is to abandon Java altogether and go for a native-compiled language like C++. The only way to get any sort of code security whatsoever is to not use a language that is compiled into bytecode and run by interpreter, and instead opt for native compilation. Note that, even then, it is possible to reverse-engineer software written in *any* language. C++ would do little more than make it more difficult.

_________________
What most people don't understand about "enlightenment" is that it is not an end-goal; but where you find yourself just before taking a new "first step."


Top
 Profile  
 
PostPosted: Thu Jun 14, 2012 2:35 pm 
Shake'n'Baker
User avatar

Joined: Mon Jun 14, 2010 3:51 pm
Posts: 62
A determined reverse engineer....society calls 'em cracker :doh
Neither Bytecode nor Executable distribution is save from the crackers.

Crackers arsenal:
Bytecode > Well they are just easily decompilable...
Executable > They are too though takes time. Eg. IDA

But for Java try ProGuard, how it works is beyond me. But they claim so.

And be afraid masters do it with assembly language :evil


Top
 Profile  
 
PostPosted: Thu Jun 14, 2012 2:48 pm 
Bibliotherapist
User avatar

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 6717
Location: Oxford, Englandshire
IDA was nice. Haven't been near it for years. Assembler knowledge definitely required.

I did find a C de-compiler years ago. I wrote a "Hello World" console app with Borland Turbo C and ran the resulting .exe through the de-compiler expecting to see reasonable output from a simple program. However, the result was 25 pages of garbage.

_________________
10 PRINT "Bad Monkey ";
20 GOTO 10


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group