Jump to content
  • 0

Protect the game core ?


deadman

Question

8 answers to this question

Recommended Posts

  • 0
  • 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

  • 0

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

  • 0
  • 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

  • 0

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Activity

    1. 7

      Metin2 2003 Beta Client!!!!!

    2. 32

      Boss Effect Over Head

    3. 0

      Open Source API for Metin2 Server Management - Early Development

    4. 0

      Official Item Combination [18.4]

    5. 2

      Proper SIGNAL management for Windows

    6. 2

      Proper SIGNAL management for Windows

    7. 4

      syserr erorr ( not working OK button on client )

    8. 2

      Proper SIGNAL management for Windows

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.