Jump to content

Protect the game core ?


Recommended Posts

  • Honorable Member

Well, dev actually, im trying to add a block to the core like this:

 

i put a IP for example: 5.5.5.5 and if the server dont have the same ip of the core don't start.

 

any idea of how i do this?

It could be put at the end of this function inside config.cpp

void config_init(const string& st_localeServiceName)

	if (strcmp(g_szPublicIP, "5.5.5.5"))
	{
		fprintf(stderr, "Illegal IPn");
		exit(1);
	}
Link to comment
Share on other sites

martysama, as i see in your code, if i put the same ip of the dedicated machine, the game never starts.

 

so, i think we need to put the ! for put a diference in the condition im right ?

 

Regards

 

Akroma

 

PD: As i see in the first comment, deadman, is trying to block other IPS not, the ip of the dedicated.

 

PD2: my fault, as i see the strcmp, is for compare, btw i don't understand why this dont run.

 

 

:D

Link to comment
Share on other sites

  • Honorable Member

But martys code looks like working.

Read about strcmp here: http://www.cplusplus.com/reference/cstring/strcmp/

 

Maybe try with this code:

if (strcmp(g_szPublicIP, "5.5.5.5") != 0)
{
    fprintf(stderr, "Illegal IPn");
    exit(1);
}

However if your protected core will be publicly these things easily bypassable.

Link to comment
Share on other sites

Don't waste your time with silly protections like that one. In general, don't waste your time protecting your server binary from use (it's just going to bite you back at some point). Protect the server its stored at! If it's interesting enough that people will want to steal it, anyone can easily bypass stuff like this.

 

And no, the != 0 is not going to change a lot besides removing a warning if you have them on a high level.

 

Nevertheless, the problem is that you are placing the code in the wrong place. It has to be at any point after GetIPInfo().

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.