systemD2540 Posted February 8, 2015 Group: Members Topic Count: 22 Topics Per Day: 0.01 Content Count: 70 Reputation: 10 Joined: 07/17/14 Last Seen: May 1, 2021 Share Posted February 8, 2015 This is patch for hecules Index: conf/login-server.conf =================================================================== --- conf/login-server.conf (revision 16125) +++ conf/login-server.conf (working copy) @@ -151,6 +151,9 @@ //client_hash: 10, cb1ea78023d337c38e8ba5124e2338ae //client_hash: 99, disabled +//Internal Guard Key +internalguard_key: 69e87709f68374fe0 + import: conf/inter-server.conf import: conf/import/login_conf.txt Index: src/login/login.c =================================================================== --- src/login/login.c (revision 16125) +++ src/login/login.c (working copy) @@ -26,6 +26,8 @@ #include "../common/timer.h" #include "../common/utils.h" +char internalguard_key[256]; + struct login_interface login_s; struct Login_Config login_config; struct mmo_char_server server[MAX_SERVERS]; // char server data @@ -1088,6 +1090,17 @@ } } + +if ( sd->keypass != 467 ) { +if (strcmp(sd->ig_key,internalguard_key)==0){ +ShowStatus("[ Internal Guard ] Key accepted %s %s \n",sd->ig_key,ip); +} +else +{ +ShowStatus("[ Internal Guard ] Key rejected %s %s \n",sd->ig_key,ip); +return 2; +} +} //Client Version check if( login_config.check_client_version && sd->version != login_config.client_version_to_connect ) @@ -1546,6 +1559,7 @@ if( login_config.use_md5_passwds ) MD5_String(sd->passwd, sd->passwd); sd->passwdenc = 0; + sd->keypass=467; sd->version = login_config.client_version_to_connect; // hack to skip version check server_ip = ntohl(RFIFOL(fd,54)); server_port = ntohs(RFIFOW(fd,58)); @@ -1642,6 +1656,14 @@ return 0; login->parse_ping(fd, sd); break; + + case 0x5548: + if (RFIFOREST(fd) < 19) + return 0; + memcpy(sd->ig_key, RFIFOP(fd, 2), 32); + ShowStatus("[ Internal Guard ] IG-Key: %s IP:%s \n",sd->ig_key,ip); + RFIFOSKIP(fd,19); + break; // client md5 hash (binary) case 0x0204: // S 0204 <md5 hash>.16B (kRO 2004-05-31aSakexe langtype 0 and 6) @@ -1774,7 +1796,11 @@ } else if(!strcmpi(w1, "log_login")) login_config.log_login = (bool)config_switch(w2); - + else if(!strcmpi(w1, "internalguard_key")) { + ShowStatus("Internal Guard Protection active! \n"); + safestrncpy(internalguard_key, w2, sizeof(internalguard_key)); + ShowStatus("Internal Guard key > %s \n",internalguard_key); + } else if(!strcmpi(w1, "new_account")) login_config.new_account_flag = (bool)config_switch(w2); else if(!strcmpi(w1, "new_acc_length_limit")) Index: src/login/login.h =================================================================== --- src/login/login.h (revision 16125) +++ src/login/login.h (working copy) @@ -41,7 +41,8 @@ uint8 client_hash[16]; int has_client_hash; - + char ig_key[256]; + int keypass; int fd; time_t expiration_time; I need it to be used in conjunction with rAthena well. Please help me about src Internal Guard Support my server and everyone Quote Link to comment Share on other sites More sharing options...
Question
systemD2540
This is patch for hecules
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.