diff options
Diffstat (limited to 'src/plugins/HPMHooking')
13 files changed, 204 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index b6a0a28c0..3ee1f1b3d 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -2271,6 +2271,12 @@ typedef void (*HPMHOOK_post_DB_init) (void); typedef void (*HPMHOOK_pre_DB_final) (void); typedef void (*HPMHOOK_post_DB_final) (void); #endif // COMMON_DB_H +#ifdef COMMON_DES_H /* des */ +typedef void (*HPMHOOK_pre_des_decrypt_block) (struct des_bit64 **block); +typedef void (*HPMHOOK_post_des_decrypt_block) (struct des_bit64 *block); +typedef void (*HPMHOOK_pre_des_decrypt) (unsigned char **data, size_t *size); +typedef void (*HPMHOOK_post_des_decrypt) (unsigned char *data, size_t size); +#endif // COMMON_DES_H #ifdef MAP_DUEL_H /* duel */ typedef int (*HPMHOOK_pre_duel_create) (struct map_session_data **sd, const unsigned int *maxpl); typedef int (*HPMHOOK_post_duel_create) (int retVal___, struct map_session_data *sd, const unsigned int maxpl); diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index 3477a58a7..38dd2a7a0 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc @@ -408,6 +408,10 @@ struct { struct HPMHookPoint *HP_DB_init_post; struct HPMHookPoint *HP_DB_final_pre; struct HPMHookPoint *HP_DB_final_post; + struct HPMHookPoint *HP_des_decrypt_block_pre; + struct HPMHookPoint *HP_des_decrypt_block_post; + struct HPMHookPoint *HP_des_decrypt_pre; + struct HPMHookPoint *HP_des_decrypt_post; struct HPMHookPoint *HP_geoip_getcountry_pre; struct HPMHookPoint *HP_geoip_getcountry_post; struct HPMHookPoint *HP_geoip_final_pre; @@ -1813,6 +1817,10 @@ struct { int HP_DB_init_post; int HP_DB_final_pre; int HP_DB_final_post; + int HP_des_decrypt_block_pre; + int HP_des_decrypt_block_post; + int HP_des_decrypt_pre; + int HP_des_decrypt_post; int HP_geoip_getcountry_pre; int HP_geoip_getcountry_post; int HP_geoip_final_pre; @@ -2842,6 +2850,7 @@ struct { struct console_interface console; struct core_interface core; struct db_interface DB; + struct des_interface des; struct geoip_interface geoip; struct inter_auction_interface inter_auction; struct inter_elemental_interface inter_elemental; diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index 9844e61b6..a50d1e847 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc @@ -223,6 +223,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(DB->data2ptr, HP_DB_data2ptr) }, { HP_POP(DB->init, HP_DB_init) }, { HP_POP(DB->final, HP_DB_final) }, +/* des_interface */ + { HP_POP(des->decrypt_block, HP_des_decrypt_block) }, + { HP_POP(des->decrypt, HP_des_decrypt) }, /* geoip_interface */ { HP_POP(geoip->getcountry, HP_geoip_getcountry) }, { HP_POP(geoip->final, HP_geoip_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index b1f2f58b7..df995eee9 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -5100,6 +5100,59 @@ void HP_DB_final(void) { } return; } +/* des_interface */ +void HP_des_decrypt_block(struct des_bit64 *block) { + int hIndex = 0; + if( HPMHooks.count.HP_des_decrypt_block_pre ) { + void (*preHookFunc) (struct des_bit64 **block); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_des_decrypt_block_pre[hIndex].func; + preHookFunc(&block); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.des.decrypt_block(block); + } + if( HPMHooks.count.HP_des_decrypt_block_post ) { + void (*postHookFunc) (struct des_bit64 *block); + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_des_decrypt_block_post[hIndex].func; + postHookFunc(block); + } + } + return; +} +void HP_des_decrypt(unsigned char *data, size_t size) { + int hIndex = 0; + if( HPMHooks.count.HP_des_decrypt_pre ) { + void (*preHookFunc) (unsigned char **data, size_t *size); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_des_decrypt_pre[hIndex].func; + preHookFunc(&data, &size); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.des.decrypt(data, size); + } + if( HPMHooks.count.HP_des_decrypt_post ) { + void (*postHookFunc) (unsigned char *data, size_t size); + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_des_decrypt_post[hIndex].func; + postHookFunc(data, size); + } + } + return; +} /* geoip_interface */ const char* HP_geoip_getcountry(uint32 ipnum) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_char.sources.inc b/src/plugins/HPMHooking/HPMHooking_char.sources.inc index 21d1f6531..569936c97 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.sources.inc @@ -31,6 +31,7 @@ memcpy(&HPMHooks.source.cmdline, cmdline, sizeof(struct cmdline_interface)); memcpy(&HPMHooks.source.console, console, sizeof(struct console_interface)); memcpy(&HPMHooks.source.core, core, sizeof(struct core_interface)); memcpy(&HPMHooks.source.DB, DB, sizeof(struct db_interface)); +memcpy(&HPMHooks.source.des, des, sizeof(struct des_interface)); memcpy(&HPMHooks.source.geoip, geoip, sizeof(struct geoip_interface)); memcpy(&HPMHooks.source.inter_auction, inter_auction, sizeof(struct inter_auction_interface)); memcpy(&HPMHooks.source.inter_elemental, inter_elemental, sizeof(struct inter_elemental_interface)); diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc index 3e63de124..393794c71 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc @@ -92,6 +92,10 @@ struct { struct HPMHookPoint *HP_DB_init_post; struct HPMHookPoint *HP_DB_final_pre; struct HPMHookPoint *HP_DB_final_post; + struct HPMHookPoint *HP_des_decrypt_block_pre; + struct HPMHookPoint *HP_des_decrypt_block_post; + struct HPMHookPoint *HP_des_decrypt_pre; + struct HPMHookPoint *HP_des_decrypt_post; struct HPMHookPoint *HP_lclif_init_pre; struct HPMHookPoint *HP_lclif_init_post; struct HPMHookPoint *HP_lclif_final_pre; @@ -725,6 +729,10 @@ struct { int HP_DB_init_post; int HP_DB_final_pre; int HP_DB_final_post; + int HP_des_decrypt_block_pre; + int HP_des_decrypt_block_post; + int HP_des_decrypt_pre; + int HP_des_decrypt_post; int HP_lclif_init_pre; int HP_lclif_init_post; int HP_lclif_final_pre; @@ -1297,6 +1305,7 @@ struct { struct console_interface console; struct core_interface core; struct db_interface DB; + struct des_interface des; struct lclif_interface lclif; struct lclif_interface_private PRIV__lclif; struct libconfig_interface libconfig; diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc index cd846840b..93c838c46 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc @@ -64,6 +64,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(DB->data2ptr, HP_DB_data2ptr) }, { HP_POP(DB->init, HP_DB_init) }, { HP_POP(DB->final, HP_DB_final) }, +/* des_interface */ + { HP_POP(des->decrypt_block, HP_des_decrypt_block) }, + { HP_POP(des->decrypt, HP_des_decrypt) }, /* lclif_interface */ { HP_POP(lclif->init, HP_lclif_init) }, { HP_POP(lclif->final, HP_lclif_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 23e2e2c90..7771ca05d 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -911,6 +911,59 @@ void HP_DB_final(void) { } return; } +/* des_interface */ +void HP_des_decrypt_block(struct des_bit64 *block) { + int hIndex = 0; + if( HPMHooks.count.HP_des_decrypt_block_pre ) { + void (*preHookFunc) (struct des_bit64 **block); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_des_decrypt_block_pre[hIndex].func; + preHookFunc(&block); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.des.decrypt_block(block); + } + if( HPMHooks.count.HP_des_decrypt_block_post ) { + void (*postHookFunc) (struct des_bit64 *block); + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_des_decrypt_block_post[hIndex].func; + postHookFunc(block); + } + } + return; +} +void HP_des_decrypt(unsigned char *data, size_t size) { + int hIndex = 0; + if( HPMHooks.count.HP_des_decrypt_pre ) { + void (*preHookFunc) (unsigned char **data, size_t *size); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_des_decrypt_pre[hIndex].func; + preHookFunc(&data, &size); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.des.decrypt(data, size); + } + if( HPMHooks.count.HP_des_decrypt_post ) { + void (*postHookFunc) (unsigned char *data, size_t size); + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_des_decrypt_post[hIndex].func; + postHookFunc(data, size); + } + } + return; +} /* lclif_interface */ void HP_lclif_init(void) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_login.sources.inc b/src/plugins/HPMHooking/HPMHooking_login.sources.inc index 10558043c..df0092691 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.sources.inc @@ -30,6 +30,7 @@ memcpy(&HPMHooks.source.cmdline, cmdline, sizeof(struct cmdline_interface)); memcpy(&HPMHooks.source.console, console, sizeof(struct console_interface)); memcpy(&HPMHooks.source.core, core, sizeof(struct core_interface)); memcpy(&HPMHooks.source.DB, DB, sizeof(struct db_interface)); +memcpy(&HPMHooks.source.des, des, sizeof(struct des_interface)); memcpy(&HPMHooks.source.lclif, lclif, sizeof(struct lclif_interface)); memcpy(&HPMHooks.source.PRIV__lclif, lclif->p, sizeof(struct lclif_interface_private)); memcpy(&HPMHooks.source.libconfig, libconfig, sizeof(struct libconfig_interface)); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 591c6b147..383517175 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -1928,6 +1928,10 @@ struct { struct HPMHookPoint *HP_DB_init_post; struct HPMHookPoint *HP_DB_final_pre; struct HPMHookPoint *HP_DB_final_post; + struct HPMHookPoint *HP_des_decrypt_block_pre; + struct HPMHookPoint *HP_des_decrypt_block_post; + struct HPMHookPoint *HP_des_decrypt_pre; + struct HPMHookPoint *HP_des_decrypt_post; struct HPMHookPoint *HP_duel_create_pre; struct HPMHookPoint *HP_duel_create_post; struct HPMHookPoint *HP_duel_invite_pre; @@ -7885,6 +7889,10 @@ struct { int HP_DB_init_post; int HP_DB_final_pre; int HP_DB_final_post; + int HP_des_decrypt_block_pre; + int HP_des_decrypt_block_post; + int HP_des_decrypt_pre; + int HP_des_decrypt_post; int HP_duel_create_pre; int HP_duel_create_post; int HP_duel_invite_pre; @@ -11953,6 +11961,7 @@ struct { struct console_interface console; struct core_interface core; struct db_interface DB; + struct des_interface des; struct duel_interface duel; struct elemental_interface elemental; struct guild_interface guild; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 014497ae2..aeb76be5b 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -990,6 +990,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(DB->data2ptr, HP_DB_data2ptr) }, { HP_POP(DB->init, HP_DB_init) }, { HP_POP(DB->final, HP_DB_final) }, +/* des_interface */ + { HP_POP(des->decrypt_block, HP_des_decrypt_block) }, + { HP_POP(des->decrypt, HP_des_decrypt) }, /* duel_interface */ { HP_POP(duel->create, HP_duel_create) }, { HP_POP(duel->invite, HP_duel_invite) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 850c54f80..62ce7d41f 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -25109,6 +25109,59 @@ void HP_DB_final(void) { } return; } +/* des_interface */ +void HP_des_decrypt_block(struct des_bit64 *block) { + int hIndex = 0; + if( HPMHooks.count.HP_des_decrypt_block_pre ) { + void (*preHookFunc) (struct des_bit64 **block); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_des_decrypt_block_pre[hIndex].func; + preHookFunc(&block); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.des.decrypt_block(block); + } + if( HPMHooks.count.HP_des_decrypt_block_post ) { + void (*postHookFunc) (struct des_bit64 *block); + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_des_decrypt_block_post[hIndex].func; + postHookFunc(block); + } + } + return; +} +void HP_des_decrypt(unsigned char *data, size_t size) { + int hIndex = 0; + if( HPMHooks.count.HP_des_decrypt_pre ) { + void (*preHookFunc) (unsigned char **data, size_t *size); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_des_decrypt_pre[hIndex].func; + preHookFunc(&data, &size); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.des.decrypt(data, size); + } + if( HPMHooks.count.HP_des_decrypt_post ) { + void (*postHookFunc) (unsigned char *data, size_t size); + for(hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_des_decrypt_post[hIndex].func; + postHookFunc(data, size); + } + } + return; +} /* duel_interface */ int HP_duel_create(struct map_session_data *sd, const unsigned int maxpl) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_map.sources.inc b/src/plugins/HPMHooking/HPMHooking_map.sources.inc index f98330b88..50e83206a 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.sources.inc @@ -38,6 +38,7 @@ memcpy(&HPMHooks.source.cmdline, cmdline, sizeof(struct cmdline_interface)); memcpy(&HPMHooks.source.console, console, sizeof(struct console_interface)); memcpy(&HPMHooks.source.core, core, sizeof(struct core_interface)); memcpy(&HPMHooks.source.DB, DB, sizeof(struct db_interface)); +memcpy(&HPMHooks.source.des, des, sizeof(struct des_interface)); memcpy(&HPMHooks.source.duel, duel, sizeof(struct duel_interface)); memcpy(&HPMHooks.source.elemental, elemental, sizeof(struct elemental_interface)); memcpy(&HPMHooks.source.guild, guild, sizeof(struct guild_interface)); |