Client File: packet.h Find typedef struct command_login3 { BYTE header; char name[ID_MAX_NUM + 1]; char pwd[PASS_MAX_NUM + 1]; DWORD adwClientKey[4]; } TPacketCGLogin3; Replace with typedef struct command_login3 { BYTE header; char name[ID_MAX_NUM + 1]; char pwd[PASS_MAX_NUM + 1]; DWORD adwClientKey[4]; char hwid[255]; // <----- } TPacketCGLogin3; File: AccountConnector.cpp Find TPacketCGLogin3 LoginPacket; LoginPacket.header = HEADER_CG_LOGIN3; strncpy(LoginPacket.name, m_strID.c_str(), ID_MAX_NUM); strncpy(LoginPacket.pwd, m_strPassword.c_str(), PASS_MAX_NUM); LoginPacket.name[ID_MAX_NUM] = '\0'; LoginPacket.pwd[PASS_MAX_NUM] = '\0'; Add under HW_PROFILE_INFO hwProfileInfo; GetCurrentHwProfile(&hwProfileInfo); Tracef("hwid %s\n", hwProfileInfo.szHwProfileGuid); strncpy(LoginPacket.hwid, hwProfileInfo.szHwProfileGuid, 254); Server File: packet.h Find typedef struct command_login3 { BYTE header; char login[LOGIN_MAX_LEN + 1]; char passwd[PASSWD_MAX_LEN + 1]; DWORD adwClientKey[4]; } TPacketCGLogin3; Replace with typedef struct command_login3 { BYTE header; char login[LOGIN_MAX_LEN + 1]; char passwd[PASSWD_MAX_LEN + 1]; DWORD adwClientKey[4]; char hwid[255]; } TPacketCGLogin3; File: input_auth.cpp Find char login[LOGIN_MAX_LEN + 1]; trim_and_lower(pinfo->login, login, sizeof(login)); char passwd[PASSWD_MAX_LEN + 1]; strlcpy(passwd, pinfo->passwd, sizeof(passwd)); add under char hwid[255]; strlcpy(hwid, pinfo->hwid, sizeof(hwid)); Find char szPasswd[PASSWD_MAX_LEN * 2 + 1]; DBManager::instance().EscapeString(szPasswd, sizeof(szPasswd), passwd, strlen(passwd)); char szLogin[LOGIN_MAX_LEN * 2 + 1]; DBManager::instance().EscapeString(szLogin, sizeof(szLogin), login, strlen(login)); Add under char szHWID[255]; DBManager::instance().EscapeString(szHWID, sizeof(szHWID), hwid, strlen(hwid)); // ENABLE_HWID_BAN // update client hwid // DBManager::instance().DirectQuery("UPDATE account.account SET hwid = '%s' WHERE login = '%s'", szHWID, szLogin); std::auto_ptr pUpdateMsg("UPDATE account.account SET hwid = '%s' WHERE login = '%s'", szHWID, szLogin); // check if client hwid is banned std::auto_ptr pMsg(DBManager::instance().DirectQuery("SELECT * FROM account.hwid_ban WHERE hwid = '%s'", szHWID)); if (pMsg->Get()->uiNumRows > 0) { LoginFailure(d, "BLOCK"); printf("Account %s HWID ban - tried to login\n", szLogin); sys_log(0, "Account %s HWID ban - tried to login\n", szLogin); return; } // end HWID BAN