diff options
author | Hercules.ws <dev@herc.ws> | 2017-12-17 23:35:55 +0100 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2017-12-17 23:35:55 +0100 |
commit | 7761f8e9f9c5db58ac8b12eb0a44059fe7c1ae63 (patch) | |
tree | 4ea274eb7ef5aee37c56e87a226ecaf4e6d970d8 | |
parent | f385274cb59e251bc5aa3dc2fc918697523f7312 (diff) | |
download | hercules-7761f8e9f9c5db58ac8b12eb0a44059fe7c1ae63.tar.gz hercules-7761f8e9f9c5db58ac8b12eb0a44059fe7c1ae63.tar.bz2 hercules-7761f8e9f9c5db58ac8b12eb0a44059fe7c1ae63.tar.xz hercules-7761f8e9f9c5db58ac8b12eb0a44059fe7c1ae63.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
-rw-r--r-- | src/common/HPMDataCheck.h | 1 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 4 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc | 8 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc | 2 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.Hooks.inc | 54 |
5 files changed, 69 insertions, 0 deletions
diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index e8135b6d1..a8524bdda 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -325,6 +325,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "packet_CA_LOGIN3", sizeof(struct packet_CA_LOGIN3), SERVER_TYPE_LOGIN }, { "packet_CA_LOGIN4", sizeof(struct packet_CA_LOGIN4), SERVER_TYPE_LOGIN }, { "packet_CA_LOGIN_HAN", sizeof(struct packet_CA_LOGIN_HAN), SERVER_TYPE_LOGIN }, + { "packet_CA_LOGIN_OTP", sizeof(struct packet_CA_LOGIN_OTP), SERVER_TYPE_LOGIN }, { "packet_CA_LOGIN_PCBANG", sizeof(struct packet_CA_LOGIN_PCBANG), SERVER_TYPE_LOGIN }, { "packet_CA_SSO_LOGIN_REQ", sizeof(struct packet_CA_SSO_LOGIN_REQ), SERVER_TYPE_LOGIN }, { "packet_SC_NOTIFY_BAN", sizeof(struct packet_SC_NOTIFY_BAN), SERVER_TYPE_LOGIN }, diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 4204be2e4..b0c2d5fbc 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -3562,6 +3562,8 @@ typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_LOGIN_HAN) (int typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_LOGIN_HAN) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd); typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_SSO_LOGIN_REQ) (int *fd, struct login_session_data **sd); typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_SSO_LOGIN_REQ) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd); +typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_LOGIN_OTP) (int *fd, struct login_session_data **sd); +typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_LOGIN_OTP) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd); typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_REQ_HASH) (int *fd, struct login_session_data **sd); typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_REQ_HASH) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd); typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_CHARSERVERCONNECT) (int *fd, struct login_session_data **sd); @@ -3842,6 +3844,8 @@ typedef void (*HPMHOOK_pre_login_auth_failed) (struct login_session_data **sd, i typedef void (*HPMHOOK_post_login_auth_failed) (struct login_session_data *sd, int result); typedef bool (*HPMHOOK_pre_login_client_login) (int *fd, struct login_session_data **sd); typedef bool (*HPMHOOK_post_login_client_login) (bool retVal___, int fd, struct login_session_data *sd); +typedef bool (*HPMHOOK_pre_login_client_login_otp) (int *fd, struct login_session_data **sd); +typedef bool (*HPMHOOK_post_login_client_login_otp) (bool retVal___, int fd, struct login_session_data *sd); typedef void (*HPMHOOK_pre_login_char_server_connection_status) (int *fd, struct login_session_data **sd, uint8 *status); typedef void (*HPMHOOK_post_login_char_server_connection_status) (int fd, struct login_session_data *sd, uint8 status); typedef void (*HPMHOOK_pre_login_parse_request_connection) (int *fd, struct login_session_data **sd, const char **ip, uint32 *ipl); diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc index 9c38c0c4c..0cbce8b7d 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc @@ -138,6 +138,8 @@ struct { struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN_HAN_post; struct HPMHookPoint *HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ_pre; struct HPMHookPoint *HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ_post; + struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN_OTP_pre; + struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN_OTP_post; struct HPMHookPoint *HP_PRIV__lclif_parse_CA_REQ_HASH_pre; struct HPMHookPoint *HP_PRIV__lclif_parse_CA_REQ_HASH_post; struct HPMHookPoint *HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_pre; @@ -368,6 +370,8 @@ struct { struct HPMHookPoint *HP_login_auth_failed_post; struct HPMHookPoint *HP_login_client_login_pre; struct HPMHookPoint *HP_login_client_login_post; + struct HPMHookPoint *HP_login_client_login_otp_pre; + struct HPMHookPoint *HP_login_client_login_otp_post; struct HPMHookPoint *HP_login_char_server_connection_status_pre; struct HPMHookPoint *HP_login_char_server_connection_status_post; struct HPMHookPoint *HP_login_parse_request_connection_pre; @@ -837,6 +841,8 @@ struct { int HP_PRIV__lclif_parse_CA_LOGIN_HAN_post; int HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ_pre; int HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ_post; + int HP_PRIV__lclif_parse_CA_LOGIN_OTP_pre; + int HP_PRIV__lclif_parse_CA_LOGIN_OTP_post; int HP_PRIV__lclif_parse_CA_REQ_HASH_pre; int HP_PRIV__lclif_parse_CA_REQ_HASH_post; int HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_pre; @@ -1067,6 +1073,8 @@ struct { int HP_login_auth_failed_post; int HP_login_client_login_pre; int HP_login_client_login_post; + int HP_login_client_login_otp_pre; + int HP_login_client_login_otp_post; int HP_login_char_server_connection_status_pre; int HP_login_char_server_connection_status_post; int HP_login_parse_request_connection_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc index ba4b941a9..a6a907806 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc @@ -90,6 +90,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(lclif->p->parse_CA_LOGIN_PCBANG, HP_PRIV__lclif_parse_CA_LOGIN_PCBANG) }, { HP_POP(lclif->p->parse_CA_LOGIN_HAN, HP_PRIV__lclif_parse_CA_LOGIN_HAN) }, { HP_POP(lclif->p->parse_CA_SSO_LOGIN_REQ, HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ) }, + { HP_POP(lclif->p->parse_CA_LOGIN_OTP, HP_PRIV__lclif_parse_CA_LOGIN_OTP) }, { HP_POP(lclif->p->parse_CA_REQ_HASH, HP_PRIV__lclif_parse_CA_REQ_HASH) }, { HP_POP(lclif->p->parse_CA_CHARSERVERCONNECT, HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT) }, /* libconfig_interface */ @@ -207,6 +208,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(login->auth_ok, HP_login_auth_ok) }, { HP_POP(login->auth_failed, HP_login_auth_failed) }, { HP_POP(login->client_login, HP_login_client_login) }, + { HP_POP(login->client_login_otp, HP_login_client_login_otp) }, { HP_POP(login->char_server_connection_status, HP_login_char_server_connection_status) }, { HP_POP(login->parse_request_connection, HP_login_parse_request_connection) }, { HP_POP(login->config_set_defaults, HP_login_config_set_defaults) }, diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 0dbf2e5ae..6071c472b 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -1526,6 +1526,33 @@ enum parsefunc_rcode HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ(int fd, struct login_ } return retVal___; } +enum parsefunc_rcode HP_PRIV__lclif_parse_CA_LOGIN_OTP(int fd, struct login_session_data *sd) { + int hIndex = 0; + enum parsefunc_rcode retVal___ = PACKET_UNKNOWN; + if (HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_OTP_pre > 0) { + enum parsefunc_rcode (*preHookFunc) (int *fd, struct login_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_OTP_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_LOGIN_OTP_pre[hIndex].func; + retVal___ = preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.PRIV__lclif.parse_CA_LOGIN_OTP(fd, sd); + } + if (HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_OTP_post > 0) { + enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_OTP_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_LOGIN_OTP_post[hIndex].func; + retVal___ = postHookFunc(retVal___, fd, sd); + } + } + return retVal___; +} enum parsefunc_rcode HP_PRIV__lclif_parse_CA_REQ_HASH(int fd, struct login_session_data *sd) { int hIndex = 0; enum parsefunc_rcode retVal___ = PACKET_UNKNOWN; @@ -4611,6 +4638,33 @@ bool HP_login_client_login(int fd, struct login_session_data *sd) { } return retVal___; } +bool HP_login_client_login_otp(int fd, struct login_session_data *sd) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_login_client_login_otp_pre > 0) { + bool (*preHookFunc) (int *fd, struct login_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_login_client_login_otp_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_login_client_login_otp_pre[hIndex].func; + retVal___ = preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.login.client_login_otp(fd, sd); + } + if (HPMHooks.count.HP_login_client_login_otp_post > 0) { + bool (*postHookFunc) (bool retVal___, int fd, struct login_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_login_client_login_otp_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_login_client_login_otp_post[hIndex].func; + retVal___ = postHookFunc(retVal___, fd, sd); + } + } + return retVal___; +} void HP_login_char_server_connection_status(int fd, struct login_session_data *sd, uint8 status) { int hIndex = 0; if (HPMHooks.count.HP_login_char_server_connection_status_pre > 0) { |