diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking.c | 6 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 94 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc | 141 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc | 39 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.Hooks.inc | 903 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.sources.inc | 5 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc | 141 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc | 39 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.Hooks.inc | 903 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.sources.inc | 5 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 170 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 47 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 1091 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.sources.inc | 6 |
14 files changed, 3590 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking.c b/src/plugins/HPMHooking.c index 4fb7911c2..0b98ea99f 100644 --- a/src/plugins/HPMHooking.c +++ b/src/plugins/HPMHooking.c @@ -97,6 +97,7 @@ #include "map/storage.h" #include "map/trade.h" #include "map/unit.h" +#include "common/grfio.h" #include "common/mapindex.h" #else #define HPM_SERVER_TYPE SERVER_TYPE_UNKNOWN @@ -109,13 +110,18 @@ #include "common/conf.h" #include "common/console.h" #include "common/db.h" +#include "common/des.h" +#include "common/md5calc.h" #include "common/memmgr.h" +#include "common/mutex.h" #include "common/nullpo.h" +#include "common/random.h" #include "common/showmsg.h" #include "common/socket.h" #include "common/sql.h" #include "common/strlib.h" #include "common/sysinfo.h" +#include "common/thread.h" #include "common/timer.h" #include "common/utils.h" diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index b6a0a28c0..4f033ccaf 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); @@ -2365,6 +2371,22 @@ typedef void (*HPMHOOK_post_geoip_final) (bool shutdown); typedef void (*HPMHOOK_pre_geoip_init) (void); typedef void (*HPMHOOK_post_geoip_init) (void); #endif // CHAR_GEOIP_H +#ifdef COMMON_GRFIO_H /* grfio */ +typedef void (*HPMHOOK_pre_grfio_init) (const char **fname); +typedef void (*HPMHOOK_post_grfio_init) (const char *fname); +typedef void (*HPMHOOK_pre_grfio_final) (void); +typedef void (*HPMHOOK_post_grfio_final) (void); +typedef void* (*HPMHOOK_pre_grfio_reads) (const char **fname, int **size); +typedef void* (*HPMHOOK_post_grfio_reads) (void* retVal___, const char *fname, int *size); +typedef const char* (*HPMHOOK_pre_grfio_find_file) (const char **fname); +typedef const char* (*HPMHOOK_post_grfio_find_file) (const char* retVal___, const char *fname); +typedef unsigned long (*HPMHOOK_pre_grfio_crc32) (const unsigned char **buf, unsigned int *len); +typedef unsigned long (*HPMHOOK_post_grfio_crc32) (unsigned long retVal___, const unsigned char *buf, unsigned int len); +typedef int (*HPMHOOK_pre_grfio_decode_zip) (void **dest, unsigned long **dest_len, const void **source, unsigned long *source_len); +typedef int (*HPMHOOK_post_grfio_decode_zip) (int retVal___, void *dest, unsigned long *dest_len, const void *source, unsigned long source_len); +typedef int (*HPMHOOK_pre_grfio_encode_zip) (void **dest, unsigned long **dest_len, const void **source, unsigned long *source_len); +typedef int (*HPMHOOK_post_grfio_encode_zip) (int retVal___, void *dest, unsigned long *dest_len, const void *source, unsigned long source_len); +#endif // COMMON_GRFIO_H #ifdef MAP_GUILD_H /* guild */ typedef void (*HPMHOOK_pre_guild_init) (bool *minimal); typedef void (*HPMHOOK_post_guild_init) (bool minimal); @@ -4427,6 +4449,14 @@ typedef void (*HPMHOOK_post_mapreg_reload) (void); typedef bool (*HPMHOOK_pre_mapreg_config_read) (const char **w1, const char **w2); typedef bool (*HPMHOOK_post_mapreg_config_read) (bool retVal___, const char *w1, const char *w2); #endif // MAP_MAPREG_H +#ifdef COMMON_MD5CALC_H /* md5 */ +typedef void (*HPMHOOK_pre_md5_string) (const char **string, char **output); +typedef void (*HPMHOOK_post_md5_string) (const char *string, char *output); +typedef void (*HPMHOOK_pre_md5_binary) (const char **string, unsigned char **output); +typedef void (*HPMHOOK_post_md5_binary) (const char *string, unsigned char *output); +typedef void (*HPMHOOK_pre_md5_salt) (int *len, char **output); +typedef void (*HPMHOOK_post_md5_salt) (int len, char *output); +#endif // COMMON_MD5CALC_H #ifdef MAP_MERCENARY_H /* mercenary */ typedef void (*HPMHOOK_pre_mercenary_init) (bool *minimal); typedef void (*HPMHOOK_post_mercenary_init) (bool minimal); @@ -4687,6 +4717,28 @@ typedef void (*HPMHOOK_post_mob_clear_spawninfo) (void); typedef void (*HPMHOOK_pre_mob_destroy_mob_db) (int *index); typedef void (*HPMHOOK_post_mob_destroy_mob_db) (int index); #endif // MAP_MOB_H +#ifdef COMMON_MUTEX_H /* mutex */ +typedef struct mutex_data* (*HPMHOOK_pre_mutex_create) (void); +typedef struct mutex_data* (*HPMHOOK_post_mutex_create) (struct mutex_data* retVal___); +typedef void (*HPMHOOK_pre_mutex_destroy) (struct mutex_data **m); +typedef void (*HPMHOOK_post_mutex_destroy) (struct mutex_data *m); +typedef void (*HPMHOOK_pre_mutex_lock) (struct mutex_data **m); +typedef void (*HPMHOOK_post_mutex_lock) (struct mutex_data *m); +typedef bool (*HPMHOOK_pre_mutex_trylock) (struct mutex_data **m); +typedef bool (*HPMHOOK_post_mutex_trylock) (bool retVal___, struct mutex_data *m); +typedef void (*HPMHOOK_pre_mutex_unlock) (struct mutex_data **m); +typedef void (*HPMHOOK_post_mutex_unlock) (struct mutex_data *m); +typedef struct cond_data* (*HPMHOOK_pre_mutex_cond_create) (void); +typedef struct cond_data* (*HPMHOOK_post_mutex_cond_create) (struct cond_data* retVal___); +typedef void (*HPMHOOK_pre_mutex_cond_destroy) (struct cond_data **c); +typedef void (*HPMHOOK_post_mutex_cond_destroy) (struct cond_data *c); +typedef void (*HPMHOOK_pre_mutex_cond_wait) (struct cond_data **c, struct mutex_data **m, sysint *timeout_ticks); +typedef void (*HPMHOOK_post_mutex_cond_wait) (struct cond_data *c, struct mutex_data *m, sysint timeout_ticks); +typedef void (*HPMHOOK_pre_mutex_cond_signal) (struct cond_data **c); +typedef void (*HPMHOOK_post_mutex_cond_signal) (struct cond_data *c); +typedef void (*HPMHOOK_pre_mutex_cond_broadcast) (struct cond_data **c); +typedef void (*HPMHOOK_post_mutex_cond_broadcast) (struct cond_data *c); +#endif // COMMON_MUTEX_H #ifdef MAP_NPC_H /* npc_chat */ typedef int (*HPMHOOK_pre_npc_chat_sub) (struct block_list **bl, va_list ap); typedef int (*HPMHOOK_post_npc_chat_sub) (int retVal___, struct block_list *bl, va_list ap); @@ -5663,6 +5715,24 @@ typedef int (*HPMHOOK_post_quest_read_db) (int retVal___); typedef struct quest_db* (*HPMHOOK_pre_quest_read_db_sub) (struct config_setting_t **cs, int *n, const char **source); typedef struct quest_db* (*HPMHOOK_post_quest_read_db_sub) (struct quest_db* retVal___, struct config_setting_t *cs, int n, const char *source); #endif // MAP_QUEST_H +#ifdef COMMON_RANDOM_H /* rnd */ +typedef void (*HPMHOOK_pre_rnd_init) (void); +typedef void (*HPMHOOK_post_rnd_init) (void); +typedef void (*HPMHOOK_pre_rnd_final) (void); +typedef void (*HPMHOOK_post_rnd_final) (void); +typedef void (*HPMHOOK_pre_rnd_seed) (uint32 *seed); +typedef void (*HPMHOOK_post_rnd_seed) (uint32 seed); +typedef int32 (*HPMHOOK_pre_rnd_random) (void); +typedef int32 (*HPMHOOK_post_rnd_random) (int32 retVal___); +typedef uint32 (*HPMHOOK_pre_rnd_roll) (uint32 *dice_faces); +typedef uint32 (*HPMHOOK_post_rnd_roll) (uint32 retVal___, uint32 dice_faces); +typedef int32 (*HPMHOOK_pre_rnd_value) (int32 *min, int32 *max); +typedef int32 (*HPMHOOK_post_rnd_value) (int32 retVal___, int32 min, int32 max); +typedef double (*HPMHOOK_pre_rnd_uniform) (void); +typedef double (*HPMHOOK_post_rnd_uniform) (double retVal___); +typedef double (*HPMHOOK_pre_rnd_uniform53) (void); +typedef double (*HPMHOOK_post_rnd_uniform53) (double retVal___); +#endif // COMMON_RANDOM_H #ifdef MAP_SCRIPT_H /* script */ typedef void (*HPMHOOK_pre_script_init) (bool *minimal); typedef void (*HPMHOOK_post_script_init) (bool minimal); @@ -7009,6 +7079,30 @@ typedef void (*HPMHOOK_post_sysinfo_init) (void); typedef void (*HPMHOOK_pre_sysinfo_final) (void); typedef void (*HPMHOOK_post_sysinfo_final) (void); #endif // COMMON_SYSINFO_H +#ifdef COMMON_THREAD_H /* thread */ +typedef void (*HPMHOOK_pre_thread_init) (void); +typedef void (*HPMHOOK_post_thread_init) (void); +typedef void (*HPMHOOK_pre_thread_final) (void); +typedef void (*HPMHOOK_post_thread_final) (void); +typedef struct thread_handle* (*HPMHOOK_pre_thread_create) (threadFunc *entry_point, void **param); +typedef struct thread_handle* (*HPMHOOK_post_thread_create) (struct thread_handle* retVal___, threadFunc entry_point, void *param); +typedef struct thread_handle* (*HPMHOOK_pre_thread_create_opt) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); +typedef struct thread_handle* (*HPMHOOK_post_thread_create_opt) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); +typedef void (*HPMHOOK_pre_thread_destroy) (struct thread_handle **handle); +typedef void (*HPMHOOK_post_thread_destroy) (struct thread_handle *handle); +typedef struct thread_handle* (*HPMHOOK_pre_thread_self) (void); +typedef struct thread_handle* (*HPMHOOK_post_thread_self) (struct thread_handle* retVal___); +typedef int (*HPMHOOK_pre_thread_get_tid) (void); +typedef int (*HPMHOOK_post_thread_get_tid) (int retVal___); +typedef bool (*HPMHOOK_pre_thread_wait) (struct thread_handle **handle, void ***out_exit_code); +typedef bool (*HPMHOOK_post_thread_wait) (bool retVal___, struct thread_handle *handle, void **out_exit_code); +typedef void (*HPMHOOK_pre_thread_prio_set) (struct thread_handle **handle, enum thread_priority *prio); +typedef void (*HPMHOOK_post_thread_prio_set) (struct thread_handle *handle, enum thread_priority prio); +typedef enum thread_priority (*HPMHOOK_pre_thread_prio_get) (struct thread_handle **handle); +typedef enum thread_priority (*HPMHOOK_post_thread_prio_get) (enum thread_priority retVal___, struct thread_handle *handle); +typedef void (*HPMHOOK_pre_thread_yield) (void); +typedef void (*HPMHOOK_post_thread_yield) (void); +#endif // COMMON_THREAD_H #ifdef COMMON_TIMER_H /* timer */ typedef int64 (*HPMHOOK_pre_timer_gettick) (void); typedef int64 (*HPMHOOK_post_timer_gettick) (int64 retVal___); diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index 3477a58a7..f51ddcffc 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; @@ -1152,6 +1156,32 @@ struct { struct HPMHookPoint *HP_mapindex_id2name_post; struct HPMHookPoint *HP_mapindex_check_default_pre; struct HPMHookPoint *HP_mapindex_check_default_post; + struct HPMHookPoint *HP_md5_string_pre; + struct HPMHookPoint *HP_md5_string_post; + struct HPMHookPoint *HP_md5_binary_pre; + struct HPMHookPoint *HP_md5_binary_post; + struct HPMHookPoint *HP_md5_salt_pre; + struct HPMHookPoint *HP_md5_salt_post; + struct HPMHookPoint *HP_mutex_create_pre; + struct HPMHookPoint *HP_mutex_create_post; + struct HPMHookPoint *HP_mutex_destroy_pre; + struct HPMHookPoint *HP_mutex_destroy_post; + struct HPMHookPoint *HP_mutex_lock_pre; + struct HPMHookPoint *HP_mutex_lock_post; + struct HPMHookPoint *HP_mutex_trylock_pre; + struct HPMHookPoint *HP_mutex_trylock_post; + struct HPMHookPoint *HP_mutex_unlock_pre; + struct HPMHookPoint *HP_mutex_unlock_post; + struct HPMHookPoint *HP_mutex_cond_create_pre; + struct HPMHookPoint *HP_mutex_cond_create_post; + struct HPMHookPoint *HP_mutex_cond_destroy_pre; + struct HPMHookPoint *HP_mutex_cond_destroy_post; + struct HPMHookPoint *HP_mutex_cond_wait_pre; + struct HPMHookPoint *HP_mutex_cond_wait_post; + struct HPMHookPoint *HP_mutex_cond_signal_pre; + struct HPMHookPoint *HP_mutex_cond_signal_post; + struct HPMHookPoint *HP_mutex_cond_broadcast_pre; + struct HPMHookPoint *HP_mutex_cond_broadcast_post; struct HPMHookPoint *HP_nullpo_assert_report_pre; struct HPMHookPoint *HP_nullpo_assert_report_post; struct HPMHookPoint *HP_pincode_handle_pre; @@ -1174,6 +1204,22 @@ struct { struct HPMHookPoint *HP_pincode_check_post; struct HPMHookPoint *HP_pincode_config_read_pre; struct HPMHookPoint *HP_pincode_config_read_post; + struct HPMHookPoint *HP_rnd_init_pre; + struct HPMHookPoint *HP_rnd_init_post; + struct HPMHookPoint *HP_rnd_final_pre; + struct HPMHookPoint *HP_rnd_final_post; + struct HPMHookPoint *HP_rnd_seed_pre; + struct HPMHookPoint *HP_rnd_seed_post; + struct HPMHookPoint *HP_rnd_random_pre; + struct HPMHookPoint *HP_rnd_random_post; + struct HPMHookPoint *HP_rnd_roll_pre; + struct HPMHookPoint *HP_rnd_roll_post; + struct HPMHookPoint *HP_rnd_value_pre; + struct HPMHookPoint *HP_rnd_value_post; + struct HPMHookPoint *HP_rnd_uniform_pre; + struct HPMHookPoint *HP_rnd_uniform_post; + struct HPMHookPoint *HP_rnd_uniform53_pre; + struct HPMHookPoint *HP_rnd_uniform53_post; struct HPMHookPoint *HP_showmsg_init_pre; struct HPMHookPoint *HP_showmsg_init_post; struct HPMHookPoint *HP_showmsg_final_pre; @@ -1402,6 +1448,28 @@ struct { struct HPMHookPoint *HP_sysinfo_init_post; struct HPMHookPoint *HP_sysinfo_final_pre; struct HPMHookPoint *HP_sysinfo_final_post; + struct HPMHookPoint *HP_thread_init_pre; + struct HPMHookPoint *HP_thread_init_post; + struct HPMHookPoint *HP_thread_final_pre; + struct HPMHookPoint *HP_thread_final_post; + struct HPMHookPoint *HP_thread_create_pre; + struct HPMHookPoint *HP_thread_create_post; + struct HPMHookPoint *HP_thread_create_opt_pre; + struct HPMHookPoint *HP_thread_create_opt_post; + struct HPMHookPoint *HP_thread_destroy_pre; + struct HPMHookPoint *HP_thread_destroy_post; + struct HPMHookPoint *HP_thread_self_pre; + struct HPMHookPoint *HP_thread_self_post; + struct HPMHookPoint *HP_thread_get_tid_pre; + struct HPMHookPoint *HP_thread_get_tid_post; + struct HPMHookPoint *HP_thread_wait_pre; + struct HPMHookPoint *HP_thread_wait_post; + struct HPMHookPoint *HP_thread_prio_set_pre; + struct HPMHookPoint *HP_thread_prio_set_post; + struct HPMHookPoint *HP_thread_prio_get_pre; + struct HPMHookPoint *HP_thread_prio_get_post; + struct HPMHookPoint *HP_thread_yield_pre; + struct HPMHookPoint *HP_thread_yield_post; struct HPMHookPoint *HP_timer_gettick_pre; struct HPMHookPoint *HP_timer_gettick_post; struct HPMHookPoint *HP_timer_gettick_nocache_pre; @@ -1813,6 +1881,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; @@ -2557,6 +2629,32 @@ struct { int HP_mapindex_id2name_post; int HP_mapindex_check_default_pre; int HP_mapindex_check_default_post; + int HP_md5_string_pre; + int HP_md5_string_post; + int HP_md5_binary_pre; + int HP_md5_binary_post; + int HP_md5_salt_pre; + int HP_md5_salt_post; + int HP_mutex_create_pre; + int HP_mutex_create_post; + int HP_mutex_destroy_pre; + int HP_mutex_destroy_post; + int HP_mutex_lock_pre; + int HP_mutex_lock_post; + int HP_mutex_trylock_pre; + int HP_mutex_trylock_post; + int HP_mutex_unlock_pre; + int HP_mutex_unlock_post; + int HP_mutex_cond_create_pre; + int HP_mutex_cond_create_post; + int HP_mutex_cond_destroy_pre; + int HP_mutex_cond_destroy_post; + int HP_mutex_cond_wait_pre; + int HP_mutex_cond_wait_post; + int HP_mutex_cond_signal_pre; + int HP_mutex_cond_signal_post; + int HP_mutex_cond_broadcast_pre; + int HP_mutex_cond_broadcast_post; int HP_nullpo_assert_report_pre; int HP_nullpo_assert_report_post; int HP_pincode_handle_pre; @@ -2579,6 +2677,22 @@ struct { int HP_pincode_check_post; int HP_pincode_config_read_pre; int HP_pincode_config_read_post; + int HP_rnd_init_pre; + int HP_rnd_init_post; + int HP_rnd_final_pre; + int HP_rnd_final_post; + int HP_rnd_seed_pre; + int HP_rnd_seed_post; + int HP_rnd_random_pre; + int HP_rnd_random_post; + int HP_rnd_roll_pre; + int HP_rnd_roll_post; + int HP_rnd_value_pre; + int HP_rnd_value_post; + int HP_rnd_uniform_pre; + int HP_rnd_uniform_post; + int HP_rnd_uniform53_pre; + int HP_rnd_uniform53_post; int HP_showmsg_init_pre; int HP_showmsg_init_post; int HP_showmsg_final_pre; @@ -2807,6 +2921,28 @@ struct { int HP_sysinfo_init_post; int HP_sysinfo_final_pre; int HP_sysinfo_final_post; + int HP_thread_init_pre; + int HP_thread_init_post; + int HP_thread_final_pre; + int HP_thread_final_post; + int HP_thread_create_pre; + int HP_thread_create_post; + int HP_thread_create_opt_pre; + int HP_thread_create_opt_post; + int HP_thread_destroy_pre; + int HP_thread_destroy_post; + int HP_thread_self_pre; + int HP_thread_self_post; + int HP_thread_get_tid_pre; + int HP_thread_get_tid_post; + int HP_thread_wait_pre; + int HP_thread_wait_post; + int HP_thread_prio_set_pre; + int HP_thread_prio_set_post; + int HP_thread_prio_get_pre; + int HP_thread_prio_get_post; + int HP_thread_yield_pre; + int HP_thread_yield_post; int HP_timer_gettick_pre; int HP_timer_gettick_post; int HP_timer_gettick_nocache_pre; @@ -2842,6 +2978,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; @@ -2859,8 +2996,11 @@ struct { struct malloc_interface iMalloc; struct mapif_interface mapif; struct mapindex_interface mapindex; + struct md5_interface md5; + struct mutex_interface mutex; struct nullpo_interface nullpo; struct pincode_interface pincode; + struct rnd_interface rnd; struct showmsg_interface showmsg; struct socket_interface sockt; struct sql_interface SQL; @@ -2868,5 +3008,6 @@ struct { struct strlib_interface strlib; struct sv_interface sv; struct sysinfo_interface sysinfo; + struct thread_interface thread; struct timer_interface timer; } source; diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index 9844e61b6..4371cf81a 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) }, @@ -612,6 +615,21 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapindex->name2id, HP_mapindex_name2id) }, { HP_POP(mapindex->id2name, HP_mapindex_id2name) }, { HP_POP(mapindex->check_default, HP_mapindex_check_default) }, +/* md5_interface */ + { HP_POP(md5->string, HP_md5_string) }, + { HP_POP(md5->binary, HP_md5_binary) }, + { HP_POP(md5->salt, HP_md5_salt) }, +/* mutex_interface */ + { HP_POP(mutex->create, HP_mutex_create) }, + { HP_POP(mutex->destroy, HP_mutex_destroy) }, + { HP_POP(mutex->lock, HP_mutex_lock) }, + { HP_POP(mutex->trylock, HP_mutex_trylock) }, + { HP_POP(mutex->unlock, HP_mutex_unlock) }, + { HP_POP(mutex->cond_create, HP_mutex_cond_create) }, + { HP_POP(mutex->cond_destroy, HP_mutex_cond_destroy) }, + { HP_POP(mutex->cond_wait, HP_mutex_cond_wait) }, + { HP_POP(mutex->cond_signal, HP_mutex_cond_signal) }, + { HP_POP(mutex->cond_broadcast, HP_mutex_cond_broadcast) }, /* nullpo_interface */ { HP_POP(nullpo->assert_report, HP_nullpo_assert_report) }, /* pincode_interface */ @@ -625,6 +643,15 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pincode->compare, HP_pincode_compare) }, { HP_POP(pincode->check, HP_pincode_check) }, { HP_POP(pincode->config_read, HP_pincode_config_read) }, +/* rnd_interface */ + { HP_POP(rnd->init, HP_rnd_init) }, + { HP_POP(rnd->final, HP_rnd_final) }, + { HP_POP(rnd->seed, HP_rnd_seed) }, + { HP_POP(rnd->random, HP_rnd_random) }, + { HP_POP(rnd->roll, HP_rnd_roll) }, + { HP_POP(rnd->value, HP_rnd_value) }, + { HP_POP(rnd->uniform, HP_rnd_uniform) }, + { HP_POP(rnd->uniform53, HP_rnd_uniform53) }, /* showmsg_interface */ { HP_POP(showmsg->init, HP_showmsg_init) }, { HP_POP(showmsg->final, HP_showmsg_final) }, @@ -746,6 +773,18 @@ struct HookingPointData HookingPoints[] = { { HP_POP(sysinfo->is_superuser, HP_sysinfo_is_superuser) }, { HP_POP(sysinfo->init, HP_sysinfo_init) }, { HP_POP(sysinfo->final, HP_sysinfo_final) }, +/* thread_interface */ + { HP_POP(thread->init, HP_thread_init) }, + { HP_POP(thread->final, HP_thread_final) }, + { HP_POP(thread->create, HP_thread_create) }, + { HP_POP(thread->create_opt, HP_thread_create_opt) }, + { HP_POP(thread->destroy, HP_thread_destroy) }, + { HP_POP(thread->self, HP_thread_self) }, + { HP_POP(thread->get_tid, HP_thread_get_tid) }, + { HP_POP(thread->wait, HP_thread_wait) }, + { HP_POP(thread->prio_set, HP_thread_prio_set) }, + { HP_POP(thread->prio_get, HP_thread_prio_get) }, + { HP_POP(thread->yield, HP_thread_yield) }, /* timer_interface */ { HP_POP(timer->gettick, HP_timer_gettick) }, { HP_POP(timer->gettick_nocache, HP_timer_gettick_nocache) }, diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index b1f2f58b7..aecffbecd 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; @@ -15067,6 +15120,349 @@ bool HP_mapindex_check_default(void) { } return retVal___; } +/* md5_interface */ +void HP_md5_string(const char *string, char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_string_pre ) { + void (*preHookFunc) (const char **string, char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_string_pre[hIndex].func; + preHookFunc(&string, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.string(string, output); + } + if( HPMHooks.count.HP_md5_string_post ) { + void (*postHookFunc) (const char *string, char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_string_post[hIndex].func; + postHookFunc(string, output); + } + } + return; +} +void HP_md5_binary(const char *string, unsigned char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_binary_pre ) { + void (*preHookFunc) (const char **string, unsigned char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_binary_pre[hIndex].func; + preHookFunc(&string, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.binary(string, output); + } + if( HPMHooks.count.HP_md5_binary_post ) { + void (*postHookFunc) (const char *string, unsigned char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_binary_post[hIndex].func; + postHookFunc(string, output); + } + } + return; +} +void HP_md5_salt(int len, char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_salt_pre ) { + void (*preHookFunc) (int *len, char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_salt_pre[hIndex].func; + preHookFunc(&len, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.salt(len, output); + } + if( HPMHooks.count.HP_md5_salt_post ) { + void (*postHookFunc) (int len, char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_salt_post[hIndex].func; + postHookFunc(len, output); + } + } + return; +} +/* mutex_interface */ +struct mutex_data* HP_mutex_create(void) { + int hIndex = 0; + struct mutex_data* retVal___ = NULL; + if( HPMHooks.count.HP_mutex_create_pre ) { + struct mutex_data* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_create_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.create(); + } + if( HPMHooks.count.HP_mutex_create_post ) { + struct mutex_data* (*postHookFunc) (struct mutex_data* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +void HP_mutex_destroy(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_destroy_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_destroy_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.destroy(m); + } + if( HPMHooks.count.HP_mutex_destroy_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_destroy_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +void HP_mutex_lock(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_lock_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_lock_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.lock(m); + } + if( HPMHooks.count.HP_mutex_lock_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_lock_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +bool HP_mutex_trylock(struct mutex_data *m) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_mutex_trylock_pre ) { + bool (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_trylock_pre[hIndex].func; + retVal___ = preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.trylock(m); + } + if( HPMHooks.count.HP_mutex_trylock_post ) { + bool (*postHookFunc) (bool retVal___, struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_trylock_post[hIndex].func; + retVal___ = postHookFunc(retVal___, m); + } + } + return retVal___; +} +void HP_mutex_unlock(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_unlock_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_unlock_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.unlock(m); + } + if( HPMHooks.count.HP_mutex_unlock_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_unlock_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +struct cond_data* HP_mutex_cond_create(void) { + int hIndex = 0; + struct cond_data* retVal___ = NULL; + if( HPMHooks.count.HP_mutex_cond_create_pre ) { + struct cond_data* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_create_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.cond_create(); + } + if( HPMHooks.count.HP_mutex_cond_create_post ) { + struct cond_data* (*postHookFunc) (struct cond_data* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +void HP_mutex_cond_destroy(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_destroy_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_destroy_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_destroy(c); + } + if( HPMHooks.count.HP_mutex_cond_destroy_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_destroy_post[hIndex].func; + postHookFunc(c); + } + } + return; +} +void HP_mutex_cond_wait(struct cond_data *c, struct mutex_data *m, sysint timeout_ticks) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_wait_pre ) { + void (*preHookFunc) (struct cond_data **c, struct mutex_data **m, sysint *timeout_ticks); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_wait_pre[hIndex].func; + preHookFunc(&c, &m, &timeout_ticks); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_wait(c, m, timeout_ticks); + } + if( HPMHooks.count.HP_mutex_cond_wait_post ) { + void (*postHookFunc) (struct cond_data *c, struct mutex_data *m, sysint timeout_ticks); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_wait_post[hIndex].func; + postHookFunc(c, m, timeout_ticks); + } + } + return; +} +void HP_mutex_cond_signal(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_signal_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_signal_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_signal(c); + } + if( HPMHooks.count.HP_mutex_cond_signal_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_signal_post[hIndex].func; + postHookFunc(c); + } + } + return; +} +void HP_mutex_cond_broadcast(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_broadcast_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_broadcast(c); + } + if( HPMHooks.count.HP_mutex_cond_broadcast_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_post[hIndex].func; + postHookFunc(c); + } + } + return; +} /* nullpo_interface */ void HP_nullpo_assert_report(const char *file, int line, const char *func, const char *targetname, const char *title) { int hIndex = 0; @@ -15357,6 +15753,220 @@ bool HP_pincode_config_read(char *w1, char *w2) { } return retVal___; } +/* rnd_interface */ +void HP_rnd_init(void) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_init_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_init_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.init(); + } + if( HPMHooks.count.HP_rnd_init_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_rnd_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_final_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.final(); + } + if( HPMHooks.count.HP_rnd_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_rnd_seed(uint32 seed) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_seed_pre ) { + void (*preHookFunc) (uint32 *seed); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_seed_pre[hIndex].func; + preHookFunc(&seed); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.seed(seed); + } + if( HPMHooks.count.HP_rnd_seed_post ) { + void (*postHookFunc) (uint32 seed); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_seed_post[hIndex].func; + postHookFunc(seed); + } + } + return; +} +int32 HP_rnd_random(void) { + int hIndex = 0; + int32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_random_pre ) { + int32 (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_random_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.random(); + } + if( HPMHooks.count.HP_rnd_random_post ) { + int32 (*postHookFunc) (int32 retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_random_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +uint32 HP_rnd_roll(uint32 dice_faces) { + int hIndex = 0; + uint32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_roll_pre ) { + uint32 (*preHookFunc) (uint32 *dice_faces); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_roll_pre[hIndex].func; + retVal___ = preHookFunc(&dice_faces); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.roll(dice_faces); + } + if( HPMHooks.count.HP_rnd_roll_post ) { + uint32 (*postHookFunc) (uint32 retVal___, uint32 dice_faces); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_roll_post[hIndex].func; + retVal___ = postHookFunc(retVal___, dice_faces); + } + } + return retVal___; +} +int32 HP_rnd_value(int32 min, int32 max) { + int hIndex = 0; + int32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_value_pre ) { + int32 (*preHookFunc) (int32 *min, int32 *max); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_value_pre[hIndex].func; + retVal___ = preHookFunc(&min, &max); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.value(min, max); + } + if( HPMHooks.count.HP_rnd_value_post ) { + int32 (*postHookFunc) (int32 retVal___, int32 min, int32 max); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_value_post[hIndex].func; + retVal___ = postHookFunc(retVal___, min, max); + } + } + return retVal___; +} +double HP_rnd_uniform(void) { + int hIndex = 0; + double retVal___ = 0.; + if( HPMHooks.count.HP_rnd_uniform_pre ) { + double (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_uniform_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.uniform(); + } + if( HPMHooks.count.HP_rnd_uniform_post ) { + double (*postHookFunc) (double retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_uniform_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +double HP_rnd_uniform53(void) { + int hIndex = 0; + double retVal___ = 0.; + if( HPMHooks.count.HP_rnd_uniform53_pre ) { + double (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_uniform53_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.uniform53(); + } + if( HPMHooks.count.HP_rnd_uniform53_post ) { + double (*postHookFunc) (double retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_uniform53_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} /* showmsg_interface */ void HP_showmsg_init(void) { int hIndex = 0; @@ -18440,6 +19050,299 @@ void HP_sysinfo_final(void) { } return; } +/* thread_interface */ +void HP_thread_init(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_init_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_init_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.init(); + } + if( HPMHooks.count.HP_thread_init_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_thread_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_final_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.final(); + } + if( HPMHooks.count.HP_thread_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_create_pre ) { + struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_create_pre[hIndex].func; + retVal___ = preHookFunc(&entry_point, ¶m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.create(entry_point, param); + } + if( HPMHooks.count.HP_thread_create_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___, entry_point, param); + } + } + return retVal___; +} +struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_create_opt_pre ) { + struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_create_opt_pre[hIndex].func; + retVal___ = preHookFunc(&entry_point, ¶m, &stack_size, &prio); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.create_opt(entry_point, param, stack_size, prio); + } + if( HPMHooks.count.HP_thread_create_opt_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_create_opt_post[hIndex].func; + retVal___ = postHookFunc(retVal___, entry_point, param, stack_size, prio); + } + } + return retVal___; +} +void HP_thread_destroy(struct thread_handle *handle) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_destroy_pre ) { + void (*preHookFunc) (struct thread_handle **handle); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_destroy_pre[hIndex].func; + preHookFunc(&handle); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.destroy(handle); + } + if( HPMHooks.count.HP_thread_destroy_post ) { + void (*postHookFunc) (struct thread_handle *handle); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_destroy_post[hIndex].func; + postHookFunc(handle); + } + } + return; +} +struct thread_handle* HP_thread_self(void) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_self_pre ) { + struct thread_handle* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_self_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.self(); + } + if( HPMHooks.count.HP_thread_self_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_self_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +int HP_thread_get_tid(void) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_thread_get_tid_pre ) { + int (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_get_tid_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.get_tid(); + } + if( HPMHooks.count.HP_thread_get_tid_post ) { + int (*postHookFunc) (int retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_get_tid_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_thread_wait(struct thread_handle *handle, void **out_exit_code) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_thread_wait_pre ) { + bool (*preHookFunc) (struct thread_handle **handle, void ***out_exit_code); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_wait_pre[hIndex].func; + retVal___ = preHookFunc(&handle, &out_exit_code); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.wait(handle, out_exit_code); + } + if( HPMHooks.count.HP_thread_wait_post ) { + bool (*postHookFunc) (bool retVal___, struct thread_handle *handle, void **out_exit_code); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_wait_post[hIndex].func; + retVal___ = postHookFunc(retVal___, handle, out_exit_code); + } + } + return retVal___; +} +void HP_thread_prio_set(struct thread_handle *handle, enum thread_priority prio) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_prio_set_pre ) { + void (*preHookFunc) (struct thread_handle **handle, enum thread_priority *prio); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_prio_set_pre[hIndex].func; + preHookFunc(&handle, &prio); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.prio_set(handle, prio); + } + if( HPMHooks.count.HP_thread_prio_set_post ) { + void (*postHookFunc) (struct thread_handle *handle, enum thread_priority prio); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_prio_set_post[hIndex].func; + postHookFunc(handle, prio); + } + } + return; +} +enum thread_priority HP_thread_prio_get(struct thread_handle *handle) { + int hIndex = 0; + enum thread_priority retVal___ = THREADPRIO_NORMAL; + if( HPMHooks.count.HP_thread_prio_get_pre ) { + enum thread_priority (*preHookFunc) (struct thread_handle **handle); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_prio_get_pre[hIndex].func; + retVal___ = preHookFunc(&handle); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.prio_get(handle); + } + if( HPMHooks.count.HP_thread_prio_get_post ) { + enum thread_priority (*postHookFunc) (enum thread_priority retVal___, struct thread_handle *handle); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_prio_get_post[hIndex].func; + retVal___ = postHookFunc(retVal___, handle); + } + } + return retVal___; +} +void HP_thread_yield(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_yield_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_yield_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.yield(); + } + if( HPMHooks.count.HP_thread_yield_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_yield_post[hIndex].func; + postHookFunc(); + } + } + return; +} /* timer_interface */ int64 HP_timer_gettick(void) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_char.sources.inc b/src/plugins/HPMHooking/HPMHooking_char.sources.inc index 21d1f6531..54ae8f030 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)); @@ -48,8 +49,11 @@ memcpy(&HPMHooks.source.loginif, loginif, sizeof(struct loginif_interface)); memcpy(&HPMHooks.source.iMalloc, iMalloc, sizeof(struct malloc_interface)); memcpy(&HPMHooks.source.mapif, mapif, sizeof(struct mapif_interface)); memcpy(&HPMHooks.source.mapindex, mapindex, sizeof(struct mapindex_interface)); +memcpy(&HPMHooks.source.md5, md5, sizeof(struct md5_interface)); +memcpy(&HPMHooks.source.mutex, mutex, sizeof(struct mutex_interface)); memcpy(&HPMHooks.source.nullpo, nullpo, sizeof(struct nullpo_interface)); memcpy(&HPMHooks.source.pincode, pincode, sizeof(struct pincode_interface)); +memcpy(&HPMHooks.source.rnd, rnd, sizeof(struct rnd_interface)); memcpy(&HPMHooks.source.showmsg, showmsg, sizeof(struct showmsg_interface)); memcpy(&HPMHooks.source.sockt, sockt, sizeof(struct socket_interface)); memcpy(&HPMHooks.source.SQL, SQL, sizeof(struct sql_interface)); @@ -57,4 +61,5 @@ memcpy(&HPMHooks.source.StrBuf, StrBuf, sizeof(struct stringbuf_interface)); memcpy(&HPMHooks.source.strlib, strlib, sizeof(struct strlib_interface)); memcpy(&HPMHooks.source.sv, sv, sizeof(struct sv_interface)); memcpy(&HPMHooks.source.sysinfo, sysinfo, sizeof(struct sysinfo_interface)); +memcpy(&HPMHooks.source.thread, thread, sizeof(struct thread_interface)); memcpy(&HPMHooks.source.timer, timer, sizeof(struct timer_interface)); diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc index 3e63de124..b97b6ea7f 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; @@ -400,8 +404,50 @@ struct { struct HPMHookPoint *HP_iMalloc_post_shutdown_post; struct HPMHookPoint *HP_iMalloc_init_messages_pre; struct HPMHookPoint *HP_iMalloc_init_messages_post; + struct HPMHookPoint *HP_md5_string_pre; + struct HPMHookPoint *HP_md5_string_post; + struct HPMHookPoint *HP_md5_binary_pre; + struct HPMHookPoint *HP_md5_binary_post; + struct HPMHookPoint *HP_md5_salt_pre; + struct HPMHookPoint *HP_md5_salt_post; + struct HPMHookPoint *HP_mutex_create_pre; + struct HPMHookPoint *HP_mutex_create_post; + struct HPMHookPoint *HP_mutex_destroy_pre; + struct HPMHookPoint *HP_mutex_destroy_post; + struct HPMHookPoint *HP_mutex_lock_pre; + struct HPMHookPoint *HP_mutex_lock_post; + struct HPMHookPoint *HP_mutex_trylock_pre; + struct HPMHookPoint *HP_mutex_trylock_post; + struct HPMHookPoint *HP_mutex_unlock_pre; + struct HPMHookPoint *HP_mutex_unlock_post; + struct HPMHookPoint *HP_mutex_cond_create_pre; + struct HPMHookPoint *HP_mutex_cond_create_post; + struct HPMHookPoint *HP_mutex_cond_destroy_pre; + struct HPMHookPoint *HP_mutex_cond_destroy_post; + struct HPMHookPoint *HP_mutex_cond_wait_pre; + struct HPMHookPoint *HP_mutex_cond_wait_post; + struct HPMHookPoint *HP_mutex_cond_signal_pre; + struct HPMHookPoint *HP_mutex_cond_signal_post; + struct HPMHookPoint *HP_mutex_cond_broadcast_pre; + struct HPMHookPoint *HP_mutex_cond_broadcast_post; struct HPMHookPoint *HP_nullpo_assert_report_pre; struct HPMHookPoint *HP_nullpo_assert_report_post; + struct HPMHookPoint *HP_rnd_init_pre; + struct HPMHookPoint *HP_rnd_init_post; + struct HPMHookPoint *HP_rnd_final_pre; + struct HPMHookPoint *HP_rnd_final_post; + struct HPMHookPoint *HP_rnd_seed_pre; + struct HPMHookPoint *HP_rnd_seed_post; + struct HPMHookPoint *HP_rnd_random_pre; + struct HPMHookPoint *HP_rnd_random_post; + struct HPMHookPoint *HP_rnd_roll_pre; + struct HPMHookPoint *HP_rnd_roll_post; + struct HPMHookPoint *HP_rnd_value_pre; + struct HPMHookPoint *HP_rnd_value_post; + struct HPMHookPoint *HP_rnd_uniform_pre; + struct HPMHookPoint *HP_rnd_uniform_post; + struct HPMHookPoint *HP_rnd_uniform53_pre; + struct HPMHookPoint *HP_rnd_uniform53_post; struct HPMHookPoint *HP_showmsg_init_pre; struct HPMHookPoint *HP_showmsg_init_post; struct HPMHookPoint *HP_showmsg_final_pre; @@ -630,6 +676,28 @@ struct { struct HPMHookPoint *HP_sysinfo_init_post; struct HPMHookPoint *HP_sysinfo_final_pre; struct HPMHookPoint *HP_sysinfo_final_post; + struct HPMHookPoint *HP_thread_init_pre; + struct HPMHookPoint *HP_thread_init_post; + struct HPMHookPoint *HP_thread_final_pre; + struct HPMHookPoint *HP_thread_final_post; + struct HPMHookPoint *HP_thread_create_pre; + struct HPMHookPoint *HP_thread_create_post; + struct HPMHookPoint *HP_thread_create_opt_pre; + struct HPMHookPoint *HP_thread_create_opt_post; + struct HPMHookPoint *HP_thread_destroy_pre; + struct HPMHookPoint *HP_thread_destroy_post; + struct HPMHookPoint *HP_thread_self_pre; + struct HPMHookPoint *HP_thread_self_post; + struct HPMHookPoint *HP_thread_get_tid_pre; + struct HPMHookPoint *HP_thread_get_tid_post; + struct HPMHookPoint *HP_thread_wait_pre; + struct HPMHookPoint *HP_thread_wait_post; + struct HPMHookPoint *HP_thread_prio_set_pre; + struct HPMHookPoint *HP_thread_prio_set_post; + struct HPMHookPoint *HP_thread_prio_get_pre; + struct HPMHookPoint *HP_thread_prio_get_post; + struct HPMHookPoint *HP_thread_yield_pre; + struct HPMHookPoint *HP_thread_yield_post; struct HPMHookPoint *HP_timer_gettick_pre; struct HPMHookPoint *HP_timer_gettick_post; struct HPMHookPoint *HP_timer_gettick_nocache_pre; @@ -725,6 +793,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; @@ -1033,8 +1105,50 @@ struct { int HP_iMalloc_post_shutdown_post; int HP_iMalloc_init_messages_pre; int HP_iMalloc_init_messages_post; + int HP_md5_string_pre; + int HP_md5_string_post; + int HP_md5_binary_pre; + int HP_md5_binary_post; + int HP_md5_salt_pre; + int HP_md5_salt_post; + int HP_mutex_create_pre; + int HP_mutex_create_post; + int HP_mutex_destroy_pre; + int HP_mutex_destroy_post; + int HP_mutex_lock_pre; + int HP_mutex_lock_post; + int HP_mutex_trylock_pre; + int HP_mutex_trylock_post; + int HP_mutex_unlock_pre; + int HP_mutex_unlock_post; + int HP_mutex_cond_create_pre; + int HP_mutex_cond_create_post; + int HP_mutex_cond_destroy_pre; + int HP_mutex_cond_destroy_post; + int HP_mutex_cond_wait_pre; + int HP_mutex_cond_wait_post; + int HP_mutex_cond_signal_pre; + int HP_mutex_cond_signal_post; + int HP_mutex_cond_broadcast_pre; + int HP_mutex_cond_broadcast_post; int HP_nullpo_assert_report_pre; int HP_nullpo_assert_report_post; + int HP_rnd_init_pre; + int HP_rnd_init_post; + int HP_rnd_final_pre; + int HP_rnd_final_post; + int HP_rnd_seed_pre; + int HP_rnd_seed_post; + int HP_rnd_random_pre; + int HP_rnd_random_post; + int HP_rnd_roll_pre; + int HP_rnd_roll_post; + int HP_rnd_value_pre; + int HP_rnd_value_post; + int HP_rnd_uniform_pre; + int HP_rnd_uniform_post; + int HP_rnd_uniform53_pre; + int HP_rnd_uniform53_post; int HP_showmsg_init_pre; int HP_showmsg_init_post; int HP_showmsg_final_pre; @@ -1263,6 +1377,28 @@ struct { int HP_sysinfo_init_post; int HP_sysinfo_final_pre; int HP_sysinfo_final_post; + int HP_thread_init_pre; + int HP_thread_init_post; + int HP_thread_final_pre; + int HP_thread_final_post; + int HP_thread_create_pre; + int HP_thread_create_post; + int HP_thread_create_opt_pre; + int HP_thread_create_opt_post; + int HP_thread_destroy_pre; + int HP_thread_destroy_post; + int HP_thread_self_pre; + int HP_thread_self_post; + int HP_thread_get_tid_pre; + int HP_thread_get_tid_post; + int HP_thread_wait_pre; + int HP_thread_wait_post; + int HP_thread_prio_set_pre; + int HP_thread_prio_set_post; + int HP_thread_prio_get_pre; + int HP_thread_prio_get_post; + int HP_thread_yield_pre; + int HP_thread_yield_post; int HP_timer_gettick_pre; int HP_timer_gettick_post; int HP_timer_gettick_nocache_pre; @@ -1297,12 +1433,16 @@ 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; struct login_interface login; struct malloc_interface iMalloc; + struct md5_interface md5; + struct mutex_interface mutex; struct nullpo_interface nullpo; + struct rnd_interface rnd; struct showmsg_interface showmsg; struct socket_interface sockt; struct sql_interface SQL; @@ -1310,5 +1450,6 @@ struct { struct strlib_interface strlib; struct sv_interface sv; struct sysinfo_interface sysinfo; + struct thread_interface thread; struct timer_interface timer; } source; diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc index cd846840b..2d3e37bc3 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) }, @@ -223,8 +226,32 @@ struct HookingPointData HookingPoints[] = { { HP_POP(iMalloc->usage, HP_iMalloc_usage) }, { HP_POP(iMalloc->post_shutdown, HP_iMalloc_post_shutdown) }, { HP_POP(iMalloc->init_messages, HP_iMalloc_init_messages) }, +/* md5_interface */ + { HP_POP(md5->string, HP_md5_string) }, + { HP_POP(md5->binary, HP_md5_binary) }, + { HP_POP(md5->salt, HP_md5_salt) }, +/* mutex_interface */ + { HP_POP(mutex->create, HP_mutex_create) }, + { HP_POP(mutex->destroy, HP_mutex_destroy) }, + { HP_POP(mutex->lock, HP_mutex_lock) }, + { HP_POP(mutex->trylock, HP_mutex_trylock) }, + { HP_POP(mutex->unlock, HP_mutex_unlock) }, + { HP_POP(mutex->cond_create, HP_mutex_cond_create) }, + { HP_POP(mutex->cond_destroy, HP_mutex_cond_destroy) }, + { HP_POP(mutex->cond_wait, HP_mutex_cond_wait) }, + { HP_POP(mutex->cond_signal, HP_mutex_cond_signal) }, + { HP_POP(mutex->cond_broadcast, HP_mutex_cond_broadcast) }, /* nullpo_interface */ { HP_POP(nullpo->assert_report, HP_nullpo_assert_report) }, +/* rnd_interface */ + { HP_POP(rnd->init, HP_rnd_init) }, + { HP_POP(rnd->final, HP_rnd_final) }, + { HP_POP(rnd->seed, HP_rnd_seed) }, + { HP_POP(rnd->random, HP_rnd_random) }, + { HP_POP(rnd->roll, HP_rnd_roll) }, + { HP_POP(rnd->value, HP_rnd_value) }, + { HP_POP(rnd->uniform, HP_rnd_uniform) }, + { HP_POP(rnd->uniform53, HP_rnd_uniform53) }, /* showmsg_interface */ { HP_POP(showmsg->init, HP_showmsg_init) }, { HP_POP(showmsg->final, HP_showmsg_final) }, @@ -346,6 +373,18 @@ struct HookingPointData HookingPoints[] = { { HP_POP(sysinfo->is_superuser, HP_sysinfo_is_superuser) }, { HP_POP(sysinfo->init, HP_sysinfo_init) }, { HP_POP(sysinfo->final, HP_sysinfo_final) }, +/* thread_interface */ + { HP_POP(thread->init, HP_thread_init) }, + { HP_POP(thread->final, HP_thread_final) }, + { HP_POP(thread->create, HP_thread_create) }, + { HP_POP(thread->create_opt, HP_thread_create_opt) }, + { HP_POP(thread->destroy, HP_thread_destroy) }, + { HP_POP(thread->self, HP_thread_self) }, + { HP_POP(thread->get_tid, HP_thread_get_tid) }, + { HP_POP(thread->wait, HP_thread_wait) }, + { HP_POP(thread->prio_set, HP_thread_prio_set) }, + { HP_POP(thread->prio_get, HP_thread_prio_get) }, + { HP_POP(thread->yield, HP_thread_yield) }, /* timer_interface */ { HP_POP(timer->gettick, HP_timer_gettick) }, { HP_POP(timer->gettick_nocache, HP_timer_gettick_nocache) }, diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 23e2e2c90..013a56104 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; @@ -5036,6 +5089,349 @@ void HP_iMalloc_init_messages(void) { } return; } +/* md5_interface */ +void HP_md5_string(const char *string, char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_string_pre ) { + void (*preHookFunc) (const char **string, char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_string_pre[hIndex].func; + preHookFunc(&string, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.string(string, output); + } + if( HPMHooks.count.HP_md5_string_post ) { + void (*postHookFunc) (const char *string, char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_string_post[hIndex].func; + postHookFunc(string, output); + } + } + return; +} +void HP_md5_binary(const char *string, unsigned char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_binary_pre ) { + void (*preHookFunc) (const char **string, unsigned char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_binary_pre[hIndex].func; + preHookFunc(&string, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.binary(string, output); + } + if( HPMHooks.count.HP_md5_binary_post ) { + void (*postHookFunc) (const char *string, unsigned char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_binary_post[hIndex].func; + postHookFunc(string, output); + } + } + return; +} +void HP_md5_salt(int len, char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_salt_pre ) { + void (*preHookFunc) (int *len, char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_salt_pre[hIndex].func; + preHookFunc(&len, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.salt(len, output); + } + if( HPMHooks.count.HP_md5_salt_post ) { + void (*postHookFunc) (int len, char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_salt_post[hIndex].func; + postHookFunc(len, output); + } + } + return; +} +/* mutex_interface */ +struct mutex_data* HP_mutex_create(void) { + int hIndex = 0; + struct mutex_data* retVal___ = NULL; + if( HPMHooks.count.HP_mutex_create_pre ) { + struct mutex_data* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_create_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.create(); + } + if( HPMHooks.count.HP_mutex_create_post ) { + struct mutex_data* (*postHookFunc) (struct mutex_data* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +void HP_mutex_destroy(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_destroy_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_destroy_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.destroy(m); + } + if( HPMHooks.count.HP_mutex_destroy_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_destroy_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +void HP_mutex_lock(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_lock_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_lock_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.lock(m); + } + if( HPMHooks.count.HP_mutex_lock_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_lock_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +bool HP_mutex_trylock(struct mutex_data *m) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_mutex_trylock_pre ) { + bool (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_trylock_pre[hIndex].func; + retVal___ = preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.trylock(m); + } + if( HPMHooks.count.HP_mutex_trylock_post ) { + bool (*postHookFunc) (bool retVal___, struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_trylock_post[hIndex].func; + retVal___ = postHookFunc(retVal___, m); + } + } + return retVal___; +} +void HP_mutex_unlock(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_unlock_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_unlock_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.unlock(m); + } + if( HPMHooks.count.HP_mutex_unlock_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_unlock_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +struct cond_data* HP_mutex_cond_create(void) { + int hIndex = 0; + struct cond_data* retVal___ = NULL; + if( HPMHooks.count.HP_mutex_cond_create_pre ) { + struct cond_data* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_create_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.cond_create(); + } + if( HPMHooks.count.HP_mutex_cond_create_post ) { + struct cond_data* (*postHookFunc) (struct cond_data* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +void HP_mutex_cond_destroy(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_destroy_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_destroy_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_destroy(c); + } + if( HPMHooks.count.HP_mutex_cond_destroy_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_destroy_post[hIndex].func; + postHookFunc(c); + } + } + return; +} +void HP_mutex_cond_wait(struct cond_data *c, struct mutex_data *m, sysint timeout_ticks) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_wait_pre ) { + void (*preHookFunc) (struct cond_data **c, struct mutex_data **m, sysint *timeout_ticks); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_wait_pre[hIndex].func; + preHookFunc(&c, &m, &timeout_ticks); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_wait(c, m, timeout_ticks); + } + if( HPMHooks.count.HP_mutex_cond_wait_post ) { + void (*postHookFunc) (struct cond_data *c, struct mutex_data *m, sysint timeout_ticks); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_wait_post[hIndex].func; + postHookFunc(c, m, timeout_ticks); + } + } + return; +} +void HP_mutex_cond_signal(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_signal_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_signal_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_signal(c); + } + if( HPMHooks.count.HP_mutex_cond_signal_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_signal_post[hIndex].func; + postHookFunc(c); + } + } + return; +} +void HP_mutex_cond_broadcast(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_broadcast_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_broadcast(c); + } + if( HPMHooks.count.HP_mutex_cond_broadcast_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_post[hIndex].func; + postHookFunc(c); + } + } + return; +} /* nullpo_interface */ void HP_nullpo_assert_report(const char *file, int line, const char *func, const char *targetname, const char *title) { int hIndex = 0; @@ -5063,6 +5459,220 @@ void HP_nullpo_assert_report(const char *file, int line, const char *func, const } return; } +/* rnd_interface */ +void HP_rnd_init(void) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_init_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_init_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.init(); + } + if( HPMHooks.count.HP_rnd_init_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_rnd_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_final_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.final(); + } + if( HPMHooks.count.HP_rnd_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_rnd_seed(uint32 seed) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_seed_pre ) { + void (*preHookFunc) (uint32 *seed); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_seed_pre[hIndex].func; + preHookFunc(&seed); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.seed(seed); + } + if( HPMHooks.count.HP_rnd_seed_post ) { + void (*postHookFunc) (uint32 seed); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_seed_post[hIndex].func; + postHookFunc(seed); + } + } + return; +} +int32 HP_rnd_random(void) { + int hIndex = 0; + int32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_random_pre ) { + int32 (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_random_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.random(); + } + if( HPMHooks.count.HP_rnd_random_post ) { + int32 (*postHookFunc) (int32 retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_random_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +uint32 HP_rnd_roll(uint32 dice_faces) { + int hIndex = 0; + uint32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_roll_pre ) { + uint32 (*preHookFunc) (uint32 *dice_faces); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_roll_pre[hIndex].func; + retVal___ = preHookFunc(&dice_faces); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.roll(dice_faces); + } + if( HPMHooks.count.HP_rnd_roll_post ) { + uint32 (*postHookFunc) (uint32 retVal___, uint32 dice_faces); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_roll_post[hIndex].func; + retVal___ = postHookFunc(retVal___, dice_faces); + } + } + return retVal___; +} +int32 HP_rnd_value(int32 min, int32 max) { + int hIndex = 0; + int32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_value_pre ) { + int32 (*preHookFunc) (int32 *min, int32 *max); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_value_pre[hIndex].func; + retVal___ = preHookFunc(&min, &max); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.value(min, max); + } + if( HPMHooks.count.HP_rnd_value_post ) { + int32 (*postHookFunc) (int32 retVal___, int32 min, int32 max); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_value_post[hIndex].func; + retVal___ = postHookFunc(retVal___, min, max); + } + } + return retVal___; +} +double HP_rnd_uniform(void) { + int hIndex = 0; + double retVal___ = 0.; + if( HPMHooks.count.HP_rnd_uniform_pre ) { + double (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_uniform_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.uniform(); + } + if( HPMHooks.count.HP_rnd_uniform_post ) { + double (*postHookFunc) (double retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_uniform_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +double HP_rnd_uniform53(void) { + int hIndex = 0; + double retVal___ = 0.; + if( HPMHooks.count.HP_rnd_uniform53_pre ) { + double (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_uniform53_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.uniform53(); + } + if( HPMHooks.count.HP_rnd_uniform53_post ) { + double (*postHookFunc) (double retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_uniform53_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} /* showmsg_interface */ void HP_showmsg_init(void) { int hIndex = 0; @@ -8146,6 +8756,299 @@ void HP_sysinfo_final(void) { } return; } +/* thread_interface */ +void HP_thread_init(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_init_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_init_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.init(); + } + if( HPMHooks.count.HP_thread_init_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_thread_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_final_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.final(); + } + if( HPMHooks.count.HP_thread_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_create_pre ) { + struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_create_pre[hIndex].func; + retVal___ = preHookFunc(&entry_point, ¶m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.create(entry_point, param); + } + if( HPMHooks.count.HP_thread_create_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___, entry_point, param); + } + } + return retVal___; +} +struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_create_opt_pre ) { + struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_create_opt_pre[hIndex].func; + retVal___ = preHookFunc(&entry_point, ¶m, &stack_size, &prio); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.create_opt(entry_point, param, stack_size, prio); + } + if( HPMHooks.count.HP_thread_create_opt_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_create_opt_post[hIndex].func; + retVal___ = postHookFunc(retVal___, entry_point, param, stack_size, prio); + } + } + return retVal___; +} +void HP_thread_destroy(struct thread_handle *handle) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_destroy_pre ) { + void (*preHookFunc) (struct thread_handle **handle); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_destroy_pre[hIndex].func; + preHookFunc(&handle); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.destroy(handle); + } + if( HPMHooks.count.HP_thread_destroy_post ) { + void (*postHookFunc) (struct thread_handle *handle); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_destroy_post[hIndex].func; + postHookFunc(handle); + } + } + return; +} +struct thread_handle* HP_thread_self(void) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_self_pre ) { + struct thread_handle* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_self_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.self(); + } + if( HPMHooks.count.HP_thread_self_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_self_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +int HP_thread_get_tid(void) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_thread_get_tid_pre ) { + int (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_get_tid_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.get_tid(); + } + if( HPMHooks.count.HP_thread_get_tid_post ) { + int (*postHookFunc) (int retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_get_tid_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_thread_wait(struct thread_handle *handle, void **out_exit_code) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_thread_wait_pre ) { + bool (*preHookFunc) (struct thread_handle **handle, void ***out_exit_code); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_wait_pre[hIndex].func; + retVal___ = preHookFunc(&handle, &out_exit_code); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.wait(handle, out_exit_code); + } + if( HPMHooks.count.HP_thread_wait_post ) { + bool (*postHookFunc) (bool retVal___, struct thread_handle *handle, void **out_exit_code); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_wait_post[hIndex].func; + retVal___ = postHookFunc(retVal___, handle, out_exit_code); + } + } + return retVal___; +} +void HP_thread_prio_set(struct thread_handle *handle, enum thread_priority prio) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_prio_set_pre ) { + void (*preHookFunc) (struct thread_handle **handle, enum thread_priority *prio); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_prio_set_pre[hIndex].func; + preHookFunc(&handle, &prio); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.prio_set(handle, prio); + } + if( HPMHooks.count.HP_thread_prio_set_post ) { + void (*postHookFunc) (struct thread_handle *handle, enum thread_priority prio); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_prio_set_post[hIndex].func; + postHookFunc(handle, prio); + } + } + return; +} +enum thread_priority HP_thread_prio_get(struct thread_handle *handle) { + int hIndex = 0; + enum thread_priority retVal___ = THREADPRIO_NORMAL; + if( HPMHooks.count.HP_thread_prio_get_pre ) { + enum thread_priority (*preHookFunc) (struct thread_handle **handle); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_prio_get_pre[hIndex].func; + retVal___ = preHookFunc(&handle); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.prio_get(handle); + } + if( HPMHooks.count.HP_thread_prio_get_post ) { + enum thread_priority (*postHookFunc) (enum thread_priority retVal___, struct thread_handle *handle); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_prio_get_post[hIndex].func; + retVal___ = postHookFunc(retVal___, handle); + } + } + return retVal___; +} +void HP_thread_yield(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_yield_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_yield_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.yield(); + } + if( HPMHooks.count.HP_thread_yield_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_yield_post[hIndex].func; + postHookFunc(); + } + } + return; +} /* timer_interface */ int64 HP_timer_gettick(void) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_login.sources.inc b/src/plugins/HPMHooking/HPMHooking_login.sources.inc index 10558043c..6677a0c55 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.sources.inc @@ -30,12 +30,16 @@ 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)); memcpy(&HPMHooks.source.login, login, sizeof(struct login_interface)); memcpy(&HPMHooks.source.iMalloc, iMalloc, sizeof(struct malloc_interface)); +memcpy(&HPMHooks.source.md5, md5, sizeof(struct md5_interface)); +memcpy(&HPMHooks.source.mutex, mutex, sizeof(struct mutex_interface)); memcpy(&HPMHooks.source.nullpo, nullpo, sizeof(struct nullpo_interface)); +memcpy(&HPMHooks.source.rnd, rnd, sizeof(struct rnd_interface)); memcpy(&HPMHooks.source.showmsg, showmsg, sizeof(struct showmsg_interface)); memcpy(&HPMHooks.source.sockt, sockt, sizeof(struct socket_interface)); memcpy(&HPMHooks.source.SQL, SQL, sizeof(struct sql_interface)); @@ -43,4 +47,5 @@ memcpy(&HPMHooks.source.StrBuf, StrBuf, sizeof(struct stringbuf_interface)); memcpy(&HPMHooks.source.strlib, strlib, sizeof(struct strlib_interface)); memcpy(&HPMHooks.source.sv, sv, sizeof(struct sv_interface)); memcpy(&HPMHooks.source.sysinfo, sysinfo, sizeof(struct sysinfo_interface)); +memcpy(&HPMHooks.source.thread, thread, sizeof(struct thread_interface)); memcpy(&HPMHooks.source.timer, timer, sizeof(struct timer_interface)); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 591c6b147..7131f486c 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; @@ -2010,6 +2014,20 @@ struct { struct HPMHookPoint *HP_elemental_ai_timer_post; struct HPMHookPoint *HP_elemental_read_db_pre; struct HPMHookPoint *HP_elemental_read_db_post; + struct HPMHookPoint *HP_grfio_init_pre; + struct HPMHookPoint *HP_grfio_init_post; + struct HPMHookPoint *HP_grfio_final_pre; + struct HPMHookPoint *HP_grfio_final_post; + struct HPMHookPoint *HP_grfio_reads_pre; + struct HPMHookPoint *HP_grfio_reads_post; + struct HPMHookPoint *HP_grfio_find_file_pre; + struct HPMHookPoint *HP_grfio_find_file_post; + struct HPMHookPoint *HP_grfio_crc32_pre; + struct HPMHookPoint *HP_grfio_crc32_post; + struct HPMHookPoint *HP_grfio_decode_zip_pre; + struct HPMHookPoint *HP_grfio_decode_zip_post; + struct HPMHookPoint *HP_grfio_encode_zip_pre; + struct HPMHookPoint *HP_grfio_encode_zip_post; struct HPMHookPoint *HP_guild_init_pre; struct HPMHookPoint *HP_guild_init_post; struct HPMHookPoint *HP_guild_final_pre; @@ -3310,6 +3328,12 @@ struct { struct HPMHookPoint *HP_mapreg_reload_post; struct HPMHookPoint *HP_mapreg_config_read_pre; struct HPMHookPoint *HP_mapreg_config_read_post; + struct HPMHookPoint *HP_md5_string_pre; + struct HPMHookPoint *HP_md5_string_post; + struct HPMHookPoint *HP_md5_binary_pre; + struct HPMHookPoint *HP_md5_binary_post; + struct HPMHookPoint *HP_md5_salt_pre; + struct HPMHookPoint *HP_md5_salt_post; struct HPMHookPoint *HP_mercenary_init_pre; struct HPMHookPoint *HP_mercenary_init_post; struct HPMHookPoint *HP_mercenary_class_pre; @@ -3566,6 +3590,26 @@ struct { struct HPMHookPoint *HP_mob_clear_spawninfo_post; struct HPMHookPoint *HP_mob_destroy_mob_db_pre; struct HPMHookPoint *HP_mob_destroy_mob_db_post; + struct HPMHookPoint *HP_mutex_create_pre; + struct HPMHookPoint *HP_mutex_create_post; + struct HPMHookPoint *HP_mutex_destroy_pre; + struct HPMHookPoint *HP_mutex_destroy_post; + struct HPMHookPoint *HP_mutex_lock_pre; + struct HPMHookPoint *HP_mutex_lock_post; + struct HPMHookPoint *HP_mutex_trylock_pre; + struct HPMHookPoint *HP_mutex_trylock_post; + struct HPMHookPoint *HP_mutex_unlock_pre; + struct HPMHookPoint *HP_mutex_unlock_post; + struct HPMHookPoint *HP_mutex_cond_create_pre; + struct HPMHookPoint *HP_mutex_cond_create_post; + struct HPMHookPoint *HP_mutex_cond_destroy_pre; + struct HPMHookPoint *HP_mutex_cond_destroy_post; + struct HPMHookPoint *HP_mutex_cond_wait_pre; + struct HPMHookPoint *HP_mutex_cond_wait_post; + struct HPMHookPoint *HP_mutex_cond_signal_pre; + struct HPMHookPoint *HP_mutex_cond_signal_post; + struct HPMHookPoint *HP_mutex_cond_broadcast_pre; + struct HPMHookPoint *HP_mutex_cond_broadcast_post; struct HPMHookPoint *HP_npc_chat_sub_pre; struct HPMHookPoint *HP_npc_chat_sub_post; struct HPMHookPoint *HP_npc_chat_finalize_pre; @@ -4500,6 +4544,22 @@ struct { struct HPMHookPoint *HP_quest_read_db_post; struct HPMHookPoint *HP_quest_read_db_sub_pre; struct HPMHookPoint *HP_quest_read_db_sub_post; + struct HPMHookPoint *HP_rnd_init_pre; + struct HPMHookPoint *HP_rnd_init_post; + struct HPMHookPoint *HP_rnd_final_pre; + struct HPMHookPoint *HP_rnd_final_post; + struct HPMHookPoint *HP_rnd_seed_pre; + struct HPMHookPoint *HP_rnd_seed_post; + struct HPMHookPoint *HP_rnd_random_pre; + struct HPMHookPoint *HP_rnd_random_post; + struct HPMHookPoint *HP_rnd_roll_pre; + struct HPMHookPoint *HP_rnd_roll_post; + struct HPMHookPoint *HP_rnd_value_pre; + struct HPMHookPoint *HP_rnd_value_post; + struct HPMHookPoint *HP_rnd_uniform_pre; + struct HPMHookPoint *HP_rnd_uniform_post; + struct HPMHookPoint *HP_rnd_uniform53_pre; + struct HPMHookPoint *HP_rnd_uniform53_post; struct HPMHookPoint *HP_script_init_pre; struct HPMHookPoint *HP_script_init_post; struct HPMHookPoint *HP_script_final_pre; @@ -5822,6 +5882,28 @@ struct { struct HPMHookPoint *HP_sysinfo_init_post; struct HPMHookPoint *HP_sysinfo_final_pre; struct HPMHookPoint *HP_sysinfo_final_post; + struct HPMHookPoint *HP_thread_init_pre; + struct HPMHookPoint *HP_thread_init_post; + struct HPMHookPoint *HP_thread_final_pre; + struct HPMHookPoint *HP_thread_final_post; + struct HPMHookPoint *HP_thread_create_pre; + struct HPMHookPoint *HP_thread_create_post; + struct HPMHookPoint *HP_thread_create_opt_pre; + struct HPMHookPoint *HP_thread_create_opt_post; + struct HPMHookPoint *HP_thread_destroy_pre; + struct HPMHookPoint *HP_thread_destroy_post; + struct HPMHookPoint *HP_thread_self_pre; + struct HPMHookPoint *HP_thread_self_post; + struct HPMHookPoint *HP_thread_get_tid_pre; + struct HPMHookPoint *HP_thread_get_tid_post; + struct HPMHookPoint *HP_thread_wait_pre; + struct HPMHookPoint *HP_thread_wait_post; + struct HPMHookPoint *HP_thread_prio_set_pre; + struct HPMHookPoint *HP_thread_prio_set_post; + struct HPMHookPoint *HP_thread_prio_get_pre; + struct HPMHookPoint *HP_thread_prio_get_post; + struct HPMHookPoint *HP_thread_yield_pre; + struct HPMHookPoint *HP_thread_yield_post; struct HPMHookPoint *HP_timer_gettick_pre; struct HPMHookPoint *HP_timer_gettick_post; struct HPMHookPoint *HP_timer_gettick_nocache_pre; @@ -7885,6 +7967,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; @@ -7967,6 +8053,20 @@ struct { int HP_elemental_ai_timer_post; int HP_elemental_read_db_pre; int HP_elemental_read_db_post; + int HP_grfio_init_pre; + int HP_grfio_init_post; + int HP_grfio_final_pre; + int HP_grfio_final_post; + int HP_grfio_reads_pre; + int HP_grfio_reads_post; + int HP_grfio_find_file_pre; + int HP_grfio_find_file_post; + int HP_grfio_crc32_pre; + int HP_grfio_crc32_post; + int HP_grfio_decode_zip_pre; + int HP_grfio_decode_zip_post; + int HP_grfio_encode_zip_pre; + int HP_grfio_encode_zip_post; int HP_guild_init_pre; int HP_guild_init_post; int HP_guild_final_pre; @@ -9267,6 +9367,12 @@ struct { int HP_mapreg_reload_post; int HP_mapreg_config_read_pre; int HP_mapreg_config_read_post; + int HP_md5_string_pre; + int HP_md5_string_post; + int HP_md5_binary_pre; + int HP_md5_binary_post; + int HP_md5_salt_pre; + int HP_md5_salt_post; int HP_mercenary_init_pre; int HP_mercenary_init_post; int HP_mercenary_class_pre; @@ -9523,6 +9629,26 @@ struct { int HP_mob_clear_spawninfo_post; int HP_mob_destroy_mob_db_pre; int HP_mob_destroy_mob_db_post; + int HP_mutex_create_pre; + int HP_mutex_create_post; + int HP_mutex_destroy_pre; + int HP_mutex_destroy_post; + int HP_mutex_lock_pre; + int HP_mutex_lock_post; + int HP_mutex_trylock_pre; + int HP_mutex_trylock_post; + int HP_mutex_unlock_pre; + int HP_mutex_unlock_post; + int HP_mutex_cond_create_pre; + int HP_mutex_cond_create_post; + int HP_mutex_cond_destroy_pre; + int HP_mutex_cond_destroy_post; + int HP_mutex_cond_wait_pre; + int HP_mutex_cond_wait_post; + int HP_mutex_cond_signal_pre; + int HP_mutex_cond_signal_post; + int HP_mutex_cond_broadcast_pre; + int HP_mutex_cond_broadcast_post; int HP_npc_chat_sub_pre; int HP_npc_chat_sub_post; int HP_npc_chat_finalize_pre; @@ -10457,6 +10583,22 @@ struct { int HP_quest_read_db_post; int HP_quest_read_db_sub_pre; int HP_quest_read_db_sub_post; + int HP_rnd_init_pre; + int HP_rnd_init_post; + int HP_rnd_final_pre; + int HP_rnd_final_post; + int HP_rnd_seed_pre; + int HP_rnd_seed_post; + int HP_rnd_random_pre; + int HP_rnd_random_post; + int HP_rnd_roll_pre; + int HP_rnd_roll_post; + int HP_rnd_value_pre; + int HP_rnd_value_post; + int HP_rnd_uniform_pre; + int HP_rnd_uniform_post; + int HP_rnd_uniform53_pre; + int HP_rnd_uniform53_post; int HP_script_init_pre; int HP_script_init_post; int HP_script_final_pre; @@ -11779,6 +11921,28 @@ struct { int HP_sysinfo_init_post; int HP_sysinfo_final_pre; int HP_sysinfo_final_post; + int HP_thread_init_pre; + int HP_thread_init_post; + int HP_thread_final_pre; + int HP_thread_final_post; + int HP_thread_create_pre; + int HP_thread_create_post; + int HP_thread_create_opt_pre; + int HP_thread_create_opt_post; + int HP_thread_destroy_pre; + int HP_thread_destroy_post; + int HP_thread_self_pre; + int HP_thread_self_post; + int HP_thread_get_tid_pre; + int HP_thread_get_tid_post; + int HP_thread_wait_pre; + int HP_thread_wait_post; + int HP_thread_prio_set_pre; + int HP_thread_prio_set_post; + int HP_thread_prio_get_pre; + int HP_thread_prio_get_post; + int HP_thread_yield_pre; + int HP_thread_yield_post; int HP_timer_gettick_pre; int HP_timer_gettick_post; int HP_timer_gettick_nocache_pre; @@ -11953,8 +12117,10 @@ 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 grfio_interface grfio; struct guild_interface guild; struct guild_storage_interface gstorage; struct homunculus_interface homun; @@ -11970,8 +12136,10 @@ struct { struct mapindex_interface mapindex; struct mapit_interface mapit; struct mapreg_interface mapreg; + struct md5_interface md5; struct mercenary_interface mercenary; struct mob_interface mob; + struct mutex_interface mutex; struct npc_chat_interface npc_chat; struct npc_interface npc; struct nullpo_interface nullpo; @@ -11982,6 +12150,7 @@ struct { struct pcre_interface libpcre; struct pet_interface pet; struct quest_interface quest; + struct rnd_interface rnd; struct script_interface script; struct searchstore_interface searchstore; struct showmsg_interface showmsg; @@ -11994,6 +12163,7 @@ struct { struct strlib_interface strlib; struct sv_interface sv; struct sysinfo_interface sysinfo; + struct thread_interface thread; struct timer_interface timer; struct trade_interface trade; struct unit_interface unit; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 014497ae2..cbf7ba79f 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) }, @@ -1033,6 +1036,14 @@ struct HookingPointData HookingPoints[] = { { HP_POP(elemental->ai_sub_foreachclient, HP_elemental_ai_sub_foreachclient) }, { HP_POP(elemental->ai_timer, HP_elemental_ai_timer) }, { HP_POP(elemental->read_db, HP_elemental_read_db) }, +/* grfio_interface */ + { HP_POP(grfio->init, HP_grfio_init) }, + { HP_POP(grfio->final, HP_grfio_final) }, + { HP_POP(grfio->reads, HP_grfio_reads) }, + { HP_POP(grfio->find_file, HP_grfio_find_file) }, + { HP_POP(grfio->crc32, HP_grfio_crc32) }, + { HP_POP(grfio->decode_zip, HP_grfio_decode_zip) }, + { HP_POP(grfio->encode_zip, HP_grfio_encode_zip) }, /* guild_interface */ { HP_POP(guild->init, HP_guild_init) }, { HP_POP(guild->final, HP_guild_final) }, @@ -1698,6 +1709,10 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapreg->destroyreg, HP_mapreg_destroyreg) }, { HP_POP(mapreg->reload, HP_mapreg_reload) }, { HP_POP(mapreg->config_read, HP_mapreg_config_read) }, +/* md5_interface */ + { HP_POP(md5->string, HP_md5_string) }, + { HP_POP(md5->binary, HP_md5_binary) }, + { HP_POP(md5->salt, HP_md5_salt) }, /* mercenary_interface */ { HP_POP(mercenary->init, HP_mercenary_init) }, { HP_POP(mercenary->class, HP_mercenary_class) }, @@ -1828,6 +1843,17 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mob->load, HP_mob_load) }, { HP_POP(mob->clear_spawninfo, HP_mob_clear_spawninfo) }, { HP_POP(mob->destroy_mob_db, HP_mob_destroy_mob_db) }, +/* mutex_interface */ + { HP_POP(mutex->create, HP_mutex_create) }, + { HP_POP(mutex->destroy, HP_mutex_destroy) }, + { HP_POP(mutex->lock, HP_mutex_lock) }, + { HP_POP(mutex->trylock, HP_mutex_trylock) }, + { HP_POP(mutex->unlock, HP_mutex_unlock) }, + { HP_POP(mutex->cond_create, HP_mutex_cond_create) }, + { HP_POP(mutex->cond_destroy, HP_mutex_cond_destroy) }, + { HP_POP(mutex->cond_wait, HP_mutex_cond_wait) }, + { HP_POP(mutex->cond_signal, HP_mutex_cond_signal) }, + { HP_POP(mutex->cond_broadcast, HP_mutex_cond_broadcast) }, /* npc_chat_interface */ { HP_POP(npc_chat->sub, HP_npc_chat_sub) }, { HP_POP(npc_chat->finalize, HP_npc_chat_finalize) }, @@ -2305,6 +2331,15 @@ struct HookingPointData HookingPoints[] = { { HP_POP(quest->clear, HP_quest_clear) }, { HP_POP(quest->read_db, HP_quest_read_db) }, { HP_POP(quest->read_db_sub, HP_quest_read_db_sub) }, +/* rnd_interface */ + { HP_POP(rnd->init, HP_rnd_init) }, + { HP_POP(rnd->final, HP_rnd_final) }, + { HP_POP(rnd->seed, HP_rnd_seed) }, + { HP_POP(rnd->random, HP_rnd_random) }, + { HP_POP(rnd->roll, HP_rnd_roll) }, + { HP_POP(rnd->value, HP_rnd_value) }, + { HP_POP(rnd->uniform, HP_rnd_uniform) }, + { HP_POP(rnd->uniform53, HP_rnd_uniform53) }, /* script_interface */ { HP_POP(script->init, HP_script_init) }, { HP_POP(script->final, HP_script_final) }, @@ -2978,6 +3013,18 @@ struct HookingPointData HookingPoints[] = { { HP_POP(sysinfo->is_superuser, HP_sysinfo_is_superuser) }, { HP_POP(sysinfo->init, HP_sysinfo_init) }, { HP_POP(sysinfo->final, HP_sysinfo_final) }, +/* thread_interface */ + { HP_POP(thread->init, HP_thread_init) }, + { HP_POP(thread->final, HP_thread_final) }, + { HP_POP(thread->create, HP_thread_create) }, + { HP_POP(thread->create_opt, HP_thread_create_opt) }, + { HP_POP(thread->destroy, HP_thread_destroy) }, + { HP_POP(thread->self, HP_thread_self) }, + { HP_POP(thread->get_tid, HP_thread_get_tid) }, + { HP_POP(thread->wait, HP_thread_wait) }, + { HP_POP(thread->prio_set, HP_thread_prio_set) }, + { HP_POP(thread->prio_get, HP_thread_prio_get) }, + { HP_POP(thread->yield, HP_thread_yield) }, /* timer_interface */ { HP_POP(timer->gettick, HP_timer_gettick) }, { HP_POP(timer->gettick_nocache, HP_timer_gettick_nocache) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 850c54f80..2317f9392 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; @@ -26217,6 +26270,194 @@ int HP_elemental_read_db(void) { } return retVal___; } +/* grfio_interface */ +void HP_grfio_init(const char *fname) { + int hIndex = 0; + if( HPMHooks.count.HP_grfio_init_pre ) { + void (*preHookFunc) (const char **fname); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_grfio_init_pre[hIndex].func; + preHookFunc(&fname); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.grfio.init(fname); + } + if( HPMHooks.count.HP_grfio_init_post ) { + void (*postHookFunc) (const char *fname); + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_grfio_init_post[hIndex].func; + postHookFunc(fname); + } + } + return; +} +void HP_grfio_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_grfio_final_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_grfio_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.grfio.final(); + } + if( HPMHooks.count.HP_grfio_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_grfio_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void* HP_grfio_reads(const char *fname, int *size) { + int hIndex = 0; + void* retVal___ = NULL; + if( HPMHooks.count.HP_grfio_reads_pre ) { + void* (*preHookFunc) (const char **fname, int **size); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_reads_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_grfio_reads_pre[hIndex].func; + retVal___ = preHookFunc(&fname, &size); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.grfio.reads(fname, size); + } + if( HPMHooks.count.HP_grfio_reads_post ) { + void* (*postHookFunc) (void* retVal___, const char *fname, int *size); + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_reads_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_grfio_reads_post[hIndex].func; + retVal___ = postHookFunc(retVal___, fname, size); + } + } + return retVal___; +} +const char* HP_grfio_find_file(const char *fname) { + int hIndex = 0; + const char* retVal___ = NULL; + if( HPMHooks.count.HP_grfio_find_file_pre ) { + const char* (*preHookFunc) (const char **fname); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_find_file_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_grfio_find_file_pre[hIndex].func; + retVal___ = preHookFunc(&fname); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.grfio.find_file(fname); + } + if( HPMHooks.count.HP_grfio_find_file_post ) { + const char* (*postHookFunc) (const char* retVal___, const char *fname); + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_find_file_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_grfio_find_file_post[hIndex].func; + retVal___ = postHookFunc(retVal___, fname); + } + } + return retVal___; +} +unsigned long HP_grfio_crc32(const unsigned char *buf, unsigned int len) { + int hIndex = 0; + unsigned long retVal___ = 0; + if( HPMHooks.count.HP_grfio_crc32_pre ) { + unsigned long (*preHookFunc) (const unsigned char **buf, unsigned int *len); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_crc32_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_grfio_crc32_pre[hIndex].func; + retVal___ = preHookFunc(&buf, &len); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.grfio.crc32(buf, len); + } + if( HPMHooks.count.HP_grfio_crc32_post ) { + unsigned long (*postHookFunc) (unsigned long retVal___, const unsigned char *buf, unsigned int len); + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_crc32_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_grfio_crc32_post[hIndex].func; + retVal___ = postHookFunc(retVal___, buf, len); + } + } + return retVal___; +} +int HP_grfio_decode_zip(void *dest, unsigned long *dest_len, const void *source, unsigned long source_len) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_grfio_decode_zip_pre ) { + int (*preHookFunc) (void **dest, unsigned long **dest_len, const void **source, unsigned long *source_len); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_decode_zip_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_grfio_decode_zip_pre[hIndex].func; + retVal___ = preHookFunc(&dest, &dest_len, &source, &source_len); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.grfio.decode_zip(dest, dest_len, source, source_len); + } + if( HPMHooks.count.HP_grfio_decode_zip_post ) { + int (*postHookFunc) (int retVal___, void *dest, unsigned long *dest_len, const void *source, unsigned long source_len); + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_decode_zip_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_grfio_decode_zip_post[hIndex].func; + retVal___ = postHookFunc(retVal___, dest, dest_len, source, source_len); + } + } + return retVal___; +} +int HP_grfio_encode_zip(void *dest, unsigned long *dest_len, const void *source, unsigned long source_len) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_grfio_encode_zip_pre ) { + int (*preHookFunc) (void **dest, unsigned long **dest_len, const void **source, unsigned long *source_len); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_encode_zip_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_grfio_encode_zip_pre[hIndex].func; + retVal___ = preHookFunc(&dest, &dest_len, &source, &source_len); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.grfio.encode_zip(dest, dest_len, source, source_len); + } + if( HPMHooks.count.HP_grfio_encode_zip_post ) { + int (*postHookFunc) (int retVal___, void *dest, unsigned long *dest_len, const void *source, unsigned long source_len); + for(hIndex = 0; hIndex < HPMHooks.count.HP_grfio_encode_zip_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_grfio_encode_zip_post[hIndex].func; + retVal___ = postHookFunc(retVal___, dest, dest_len, source, source_len); + } + } + return retVal___; +} /* guild_interface */ void HP_guild_init(bool minimal) { int hIndex = 0; @@ -43809,6 +44050,85 @@ bool HP_mapreg_config_read(const char *w1, const char *w2) { } return retVal___; } +/* md5_interface */ +void HP_md5_string(const char *string, char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_string_pre ) { + void (*preHookFunc) (const char **string, char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_string_pre[hIndex].func; + preHookFunc(&string, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.string(string, output); + } + if( HPMHooks.count.HP_md5_string_post ) { + void (*postHookFunc) (const char *string, char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_string_post[hIndex].func; + postHookFunc(string, output); + } + } + return; +} +void HP_md5_binary(const char *string, unsigned char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_binary_pre ) { + void (*preHookFunc) (const char **string, unsigned char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_binary_pre[hIndex].func; + preHookFunc(&string, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.binary(string, output); + } + if( HPMHooks.count.HP_md5_binary_post ) { + void (*postHookFunc) (const char *string, unsigned char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_binary_post[hIndex].func; + postHookFunc(string, output); + } + } + return; +} +void HP_md5_salt(int len, char *output) { + int hIndex = 0; + if( HPMHooks.count.HP_md5_salt_pre ) { + void (*preHookFunc) (int *len, char **output); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_md5_salt_pre[hIndex].func; + preHookFunc(&len, &output); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.md5.salt(len, output); + } + if( HPMHooks.count.HP_md5_salt_post ) { + void (*postHookFunc) (int len, char *output); + for(hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_md5_salt_post[hIndex].func; + postHookFunc(len, output); + } + } + return; +} /* mercenary_interface */ void HP_mercenary_init(bool minimal) { int hIndex = 0; @@ -47334,6 +47654,270 @@ void HP_mob_destroy_mob_db(int index) { } return; } +/* mutex_interface */ +struct mutex_data* HP_mutex_create(void) { + int hIndex = 0; + struct mutex_data* retVal___ = NULL; + if( HPMHooks.count.HP_mutex_create_pre ) { + struct mutex_data* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_create_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.create(); + } + if( HPMHooks.count.HP_mutex_create_post ) { + struct mutex_data* (*postHookFunc) (struct mutex_data* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +void HP_mutex_destroy(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_destroy_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_destroy_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.destroy(m); + } + if( HPMHooks.count.HP_mutex_destroy_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_destroy_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +void HP_mutex_lock(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_lock_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_lock_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.lock(m); + } + if( HPMHooks.count.HP_mutex_lock_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_lock_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +bool HP_mutex_trylock(struct mutex_data *m) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_mutex_trylock_pre ) { + bool (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_trylock_pre[hIndex].func; + retVal___ = preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.trylock(m); + } + if( HPMHooks.count.HP_mutex_trylock_post ) { + bool (*postHookFunc) (bool retVal___, struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_trylock_post[hIndex].func; + retVal___ = postHookFunc(retVal___, m); + } + } + return retVal___; +} +void HP_mutex_unlock(struct mutex_data *m) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_unlock_pre ) { + void (*preHookFunc) (struct mutex_data **m); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_unlock_pre[hIndex].func; + preHookFunc(&m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.unlock(m); + } + if( HPMHooks.count.HP_mutex_unlock_post ) { + void (*postHookFunc) (struct mutex_data *m); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_unlock_post[hIndex].func; + postHookFunc(m); + } + } + return; +} +struct cond_data* HP_mutex_cond_create(void) { + int hIndex = 0; + struct cond_data* retVal___ = NULL; + if( HPMHooks.count.HP_mutex_cond_create_pre ) { + struct cond_data* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_create_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mutex.cond_create(); + } + if( HPMHooks.count.HP_mutex_cond_create_post ) { + struct cond_data* (*postHookFunc) (struct cond_data* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +void HP_mutex_cond_destroy(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_destroy_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_destroy_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_destroy(c); + } + if( HPMHooks.count.HP_mutex_cond_destroy_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_destroy_post[hIndex].func; + postHookFunc(c); + } + } + return; +} +void HP_mutex_cond_wait(struct cond_data *c, struct mutex_data *m, sysint timeout_ticks) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_wait_pre ) { + void (*preHookFunc) (struct cond_data **c, struct mutex_data **m, sysint *timeout_ticks); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_wait_pre[hIndex].func; + preHookFunc(&c, &m, &timeout_ticks); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_wait(c, m, timeout_ticks); + } + if( HPMHooks.count.HP_mutex_cond_wait_post ) { + void (*postHookFunc) (struct cond_data *c, struct mutex_data *m, sysint timeout_ticks); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_wait_post[hIndex].func; + postHookFunc(c, m, timeout_ticks); + } + } + return; +} +void HP_mutex_cond_signal(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_signal_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_signal_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_signal(c); + } + if( HPMHooks.count.HP_mutex_cond_signal_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_signal_post[hIndex].func; + postHookFunc(c); + } + } + return; +} +void HP_mutex_cond_broadcast(struct cond_data *c) { + int hIndex = 0; + if( HPMHooks.count.HP_mutex_cond_broadcast_pre ) { + void (*preHookFunc) (struct cond_data **c); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_pre[hIndex].func; + preHookFunc(&c); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mutex.cond_broadcast(c); + } + if( HPMHooks.count.HP_mutex_cond_broadcast_post ) { + void (*postHookFunc) (struct cond_data *c); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_post[hIndex].func; + postHookFunc(c); + } + } + return; +} /* npc_chat_interface */ int HP_npc_chat_sub(struct block_list *bl, va_list ap) { int hIndex = 0; @@ -59988,6 +60572,220 @@ struct quest_db* HP_quest_read_db_sub(struct config_setting_t *cs, int n, const } return retVal___; } +/* rnd_interface */ +void HP_rnd_init(void) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_init_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_init_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.init(); + } + if( HPMHooks.count.HP_rnd_init_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_rnd_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_final_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.final(); + } + if( HPMHooks.count.HP_rnd_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_rnd_seed(uint32 seed) { + int hIndex = 0; + if( HPMHooks.count.HP_rnd_seed_pre ) { + void (*preHookFunc) (uint32 *seed); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_seed_pre[hIndex].func; + preHookFunc(&seed); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.rnd.seed(seed); + } + if( HPMHooks.count.HP_rnd_seed_post ) { + void (*postHookFunc) (uint32 seed); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_seed_post[hIndex].func; + postHookFunc(seed); + } + } + return; +} +int32 HP_rnd_random(void) { + int hIndex = 0; + int32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_random_pre ) { + int32 (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_random_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.random(); + } + if( HPMHooks.count.HP_rnd_random_post ) { + int32 (*postHookFunc) (int32 retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_random_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +uint32 HP_rnd_roll(uint32 dice_faces) { + int hIndex = 0; + uint32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_roll_pre ) { + uint32 (*preHookFunc) (uint32 *dice_faces); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_roll_pre[hIndex].func; + retVal___ = preHookFunc(&dice_faces); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.roll(dice_faces); + } + if( HPMHooks.count.HP_rnd_roll_post ) { + uint32 (*postHookFunc) (uint32 retVal___, uint32 dice_faces); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_roll_post[hIndex].func; + retVal___ = postHookFunc(retVal___, dice_faces); + } + } + return retVal___; +} +int32 HP_rnd_value(int32 min, int32 max) { + int hIndex = 0; + int32 retVal___ = 0; + if( HPMHooks.count.HP_rnd_value_pre ) { + int32 (*preHookFunc) (int32 *min, int32 *max); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_value_pre[hIndex].func; + retVal___ = preHookFunc(&min, &max); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.value(min, max); + } + if( HPMHooks.count.HP_rnd_value_post ) { + int32 (*postHookFunc) (int32 retVal___, int32 min, int32 max); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_value_post[hIndex].func; + retVal___ = postHookFunc(retVal___, min, max); + } + } + return retVal___; +} +double HP_rnd_uniform(void) { + int hIndex = 0; + double retVal___ = 0.; + if( HPMHooks.count.HP_rnd_uniform_pre ) { + double (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_uniform_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.uniform(); + } + if( HPMHooks.count.HP_rnd_uniform_post ) { + double (*postHookFunc) (double retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_uniform_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +double HP_rnd_uniform53(void) { + int hIndex = 0; + double retVal___ = 0.; + if( HPMHooks.count.HP_rnd_uniform53_pre ) { + double (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_rnd_uniform53_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.rnd.uniform53(); + } + if( HPMHooks.count.HP_rnd_uniform53_post ) { + double (*postHookFunc) (double retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_rnd_uniform53_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} /* script_interface */ void HP_script_init(bool minimal) { int hIndex = 0; @@ -78017,6 +78815,299 @@ void HP_sysinfo_final(void) { } return; } +/* thread_interface */ +void HP_thread_init(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_init_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_init_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.init(); + } + if( HPMHooks.count.HP_thread_init_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_thread_final(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_final_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_final_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.final(); + } + if( HPMHooks.count.HP_thread_final_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_create_pre ) { + struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_create_pre[hIndex].func; + retVal___ = preHookFunc(&entry_point, ¶m); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.create(entry_point, param); + } + if( HPMHooks.count.HP_thread_create_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___, entry_point, param); + } + } + return retVal___; +} +struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_create_opt_pre ) { + struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_create_opt_pre[hIndex].func; + retVal___ = preHookFunc(&entry_point, ¶m, &stack_size, &prio); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.create_opt(entry_point, param, stack_size, prio); + } + if( HPMHooks.count.HP_thread_create_opt_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_create_opt_post[hIndex].func; + retVal___ = postHookFunc(retVal___, entry_point, param, stack_size, prio); + } + } + return retVal___; +} +void HP_thread_destroy(struct thread_handle *handle) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_destroy_pre ) { + void (*preHookFunc) (struct thread_handle **handle); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_destroy_pre[hIndex].func; + preHookFunc(&handle); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.destroy(handle); + } + if( HPMHooks.count.HP_thread_destroy_post ) { + void (*postHookFunc) (struct thread_handle *handle); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_destroy_post[hIndex].func; + postHookFunc(handle); + } + } + return; +} +struct thread_handle* HP_thread_self(void) { + int hIndex = 0; + struct thread_handle* retVal___ = NULL; + if( HPMHooks.count.HP_thread_self_pre ) { + struct thread_handle* (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_self_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.self(); + } + if( HPMHooks.count.HP_thread_self_post ) { + struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_self_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +int HP_thread_get_tid(void) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_thread_get_tid_pre ) { + int (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_get_tid_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.get_tid(); + } + if( HPMHooks.count.HP_thread_get_tid_post ) { + int (*postHookFunc) (int retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_get_tid_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_thread_wait(struct thread_handle *handle, void **out_exit_code) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_thread_wait_pre ) { + bool (*preHookFunc) (struct thread_handle **handle, void ***out_exit_code); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_wait_pre[hIndex].func; + retVal___ = preHookFunc(&handle, &out_exit_code); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.wait(handle, out_exit_code); + } + if( HPMHooks.count.HP_thread_wait_post ) { + bool (*postHookFunc) (bool retVal___, struct thread_handle *handle, void **out_exit_code); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_wait_post[hIndex].func; + retVal___ = postHookFunc(retVal___, handle, out_exit_code); + } + } + return retVal___; +} +void HP_thread_prio_set(struct thread_handle *handle, enum thread_priority prio) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_prio_set_pre ) { + void (*preHookFunc) (struct thread_handle **handle, enum thread_priority *prio); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_prio_set_pre[hIndex].func; + preHookFunc(&handle, &prio); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.prio_set(handle, prio); + } + if( HPMHooks.count.HP_thread_prio_set_post ) { + void (*postHookFunc) (struct thread_handle *handle, enum thread_priority prio); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_prio_set_post[hIndex].func; + postHookFunc(handle, prio); + } + } + return; +} +enum thread_priority HP_thread_prio_get(struct thread_handle *handle) { + int hIndex = 0; + enum thread_priority retVal___ = THREADPRIO_NORMAL; + if( HPMHooks.count.HP_thread_prio_get_pre ) { + enum thread_priority (*preHookFunc) (struct thread_handle **handle); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_prio_get_pre[hIndex].func; + retVal___ = preHookFunc(&handle); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.thread.prio_get(handle); + } + if( HPMHooks.count.HP_thread_prio_get_post ) { + enum thread_priority (*postHookFunc) (enum thread_priority retVal___, struct thread_handle *handle); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_prio_get_post[hIndex].func; + retVal___ = postHookFunc(retVal___, handle); + } + } + return retVal___; +} +void HP_thread_yield(void) { + int hIndex = 0; + if( HPMHooks.count.HP_thread_yield_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_thread_yield_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.thread.yield(); + } + if( HPMHooks.count.HP_thread_yield_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_thread_yield_post[hIndex].func; + postHookFunc(); + } + } + return; +} /* timer_interface */ int64 HP_timer_gettick(void) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_map.sources.inc b/src/plugins/HPMHooking/HPMHooking_map.sources.inc index f98330b88..54861ed6f 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.sources.inc @@ -38,8 +38,10 @@ 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.grfio, grfio, sizeof(struct grfio_interface)); memcpy(&HPMHooks.source.guild, guild, sizeof(struct guild_interface)); memcpy(&HPMHooks.source.gstorage, gstorage, sizeof(struct guild_storage_interface)); memcpy(&HPMHooks.source.homun, homun, sizeof(struct homunculus_interface)); @@ -55,8 +57,10 @@ memcpy(&HPMHooks.source.map, map, sizeof(struct map_interface)); memcpy(&HPMHooks.source.mapindex, mapindex, sizeof(struct mapindex_interface)); memcpy(&HPMHooks.source.mapit, mapit, sizeof(struct mapit_interface)); memcpy(&HPMHooks.source.mapreg, mapreg, sizeof(struct mapreg_interface)); +memcpy(&HPMHooks.source.md5, md5, sizeof(struct md5_interface)); memcpy(&HPMHooks.source.mercenary, mercenary, sizeof(struct mercenary_interface)); memcpy(&HPMHooks.source.mob, mob, sizeof(struct mob_interface)); +memcpy(&HPMHooks.source.mutex, mutex, sizeof(struct mutex_interface)); memcpy(&HPMHooks.source.npc_chat, npc_chat, sizeof(struct npc_chat_interface)); memcpy(&HPMHooks.source.npc, npc, sizeof(struct npc_interface)); memcpy(&HPMHooks.source.nullpo, nullpo, sizeof(struct nullpo_interface)); @@ -67,6 +71,7 @@ memcpy(&HPMHooks.source.pc, pc, sizeof(struct pc_interface)); memcpy(&HPMHooks.source.libpcre, libpcre, sizeof(struct pcre_interface)); memcpy(&HPMHooks.source.pet, pet, sizeof(struct pet_interface)); memcpy(&HPMHooks.source.quest, quest, sizeof(struct quest_interface)); +memcpy(&HPMHooks.source.rnd, rnd, sizeof(struct rnd_interface)); memcpy(&HPMHooks.source.script, script, sizeof(struct script_interface)); memcpy(&HPMHooks.source.searchstore, searchstore, sizeof(struct searchstore_interface)); memcpy(&HPMHooks.source.showmsg, showmsg, sizeof(struct showmsg_interface)); @@ -79,6 +84,7 @@ memcpy(&HPMHooks.source.StrBuf, StrBuf, sizeof(struct stringbuf_interface)); memcpy(&HPMHooks.source.strlib, strlib, sizeof(struct strlib_interface)); memcpy(&HPMHooks.source.sv, sv, sizeof(struct sv_interface)); memcpy(&HPMHooks.source.sysinfo, sysinfo, sizeof(struct sysinfo_interface)); +memcpy(&HPMHooks.source.thread, thread, sizeof(struct thread_interface)); memcpy(&HPMHooks.source.timer, timer, sizeof(struct timer_interface)); memcpy(&HPMHooks.source.trade, trade, sizeof(struct trade_interface)); memcpy(&HPMHooks.source.unit, unit, sizeof(struct unit_interface)); |