Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsShowcase → Fake CD-Key generator
Fake CD-Key generator
2007-06-29, 4:10 PM #1
I get bored sometimes...
Attachment: 16648/FakeCDKEYGEN.zip (5,303 bytes)
2007-06-30, 12:51 AM #2
Were you planning on doing something with the eventOutput method or is that a relic left over for debugging purposes? :P

Also:

Code:
        public String key(){
    	String n1 = "";
    	String key = "";
    	for(int index = 0;index < 19;index++){
    		int character = rand.nextInt(15);
    		if(character == 0){
    			n1 = "A";
    		}
    		if(character == 10){
    			n1 = "B";
    		}
    		if(character == 11){
    			n1 = "C";
    		}
    		if(character == 12){
    			n1 = "D";
    		}
    		if(character == 13){
    			n1 = "E";
    		}
    		if(character == 14){
    			n1 = "F";
    		}
    		if(character == 1){
    			n1 = "1";
    		}
    		if(character == 2){
    			n1 = "2";
    		}
    		if(character == 3){
    			n1 = "3";
    		}
    		if(character == 4){
    			n1 = "4";
    		}
    		if(character == 5){
    			n1 = "5";
    		}
    		if(character == 6){
    			n1 = "6";
    		}
    		if(character == 7){
    			n1 = "7";
    		}
    		if(character == 8){
    			n1 = "8";
    		}
    		if(character == 9){
    			n1 = "9";
    		}
    		if(character == 15){
    			n1 = "0";
    		}
    		if(index == 4||index == 9||index == 14){
    			n1 = "-";
    		}
    		key += n1;
    	}
    	return (String) key;
    }


:psyduck:

Might I suggest:

Code:
public String key2()
{
    	String n1 = "";
    	String key = "";
    	for (int index = 1; index < 20; index++)
        {
    		int character = rand.nextInt(15);
    		if (index % 5 == 0)
    			n1 = "-";
    		else
                        n1 = Integer.toHexString(character);
    		key += n1;
    	}
    	return key;
}


Or, if you want to avoid library functions ('cept Random of course):

Code:
public String key3()
{
	String k = "";
	char c;
	for (int i = 1; i < 20; i++)
        {
		if (i % 5 == 0)
			c = '-';
		else
                {
    			c = (char)(rand.nextInt(15) + 48);
			if (c > 57)
				c += 8;
    		}
		k += c;
    	}
	return k;
}


Everything else looks really good. I like your GUI stuff.

Also, as a sidenote, when I double-click your jar, I get the error "Could not find the main class. Program will exit." Yet, when I run java -jar FakeCDKEYGEN.jar at the command line, it works. Your manifest file looks fine. Anyone have any idea why?
"it is time to get a credit card to complete my financial independance" — Tibby, Aug. 2009
2007-06-30, 5:20 PM #3
Thank you very much for the help!

I'm going to update it some more, I'll post v1.1 later :P..

↑ Up to the top!