diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 76 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc | 57 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc | 15 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.Hooks.inc | 425 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_char.sources.inc | 1 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc | 57 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc | 15 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.Hooks.inc | 413 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_login.sources.inc | 1 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 77 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 20 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 571 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.sources.inc | 1 | ||||
-rw-r--r-- | src/plugins/db2sql.c | 2 | ||||
-rw-r--r-- | src/plugins/dbghelpplug.c | 2 |
15 files changed, 267 insertions, 1466 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 9968d1d18..eb494a6c2 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -396,8 +396,8 @@ typedef int (*HPMHOOK_pre_chr_rename_char_sql) (struct char_session_data **sd, i typedef int (*HPMHOOK_post_chr_rename_char_sql) (int retVal___, struct char_session_data *sd, int char_id); typedef int (*HPMHOOK_pre_chr_check_char_name) (char **name, char **esc_name); typedef int (*HPMHOOK_post_chr_check_char_name) (int retVal___, char *name, char *esc_name); -typedef int (*HPMHOOK_pre_chr_make_new_char_sql) (struct char_session_data **sd, const char **name_, int *str, int *agi, int *vit, int *int_, int *dex, int *luk, int *slot, int *hair_color, int *hair_style); -typedef int (*HPMHOOK_post_chr_make_new_char_sql) (int retVal___, struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style); +typedef int (*HPMHOOK_pre_chr_make_new_char_sql) (struct char_session_data **sd, const char **name_, int *str, int *agi, int *vit, int *int_, int *dex, int *luk, int *slot, int *hair_color, int *hair_style, short *starting_job); +typedef int (*HPMHOOK_post_chr_make_new_char_sql) (int retVal___, struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job); typedef int (*HPMHOOK_pre_chr_divorce_char_sql) (int *partner_id1, int *partner_id2); typedef int (*HPMHOOK_post_chr_divorce_char_sql) (int retVal___, int partner_id1, int partner_id2); typedef int (*HPMHOOK_pre_chr_count_users) (void); @@ -1396,8 +1396,8 @@ typedef void (*HPMHOOK_pre_clif_buyvending) (struct map_session_data **sd, int * typedef void (*HPMHOOK_post_clif_buyvending) (struct map_session_data *sd, int index, int amount, int fail); typedef void (*HPMHOOK_pre_clif_openvending) (struct map_session_data **sd, int *id, struct s_vending **vending_list); typedef void (*HPMHOOK_post_clif_openvending) (struct map_session_data *sd, int id, struct s_vending *vending_list); -typedef void (*HPMHOOK_pre_clif_vendingreport) (struct map_session_data **sd, int *index, int *amount); -typedef void (*HPMHOOK_post_clif_vendingreport) (struct map_session_data *sd, int index, int amount); +typedef void (*HPMHOOK_pre_clif_vendingreport) (struct map_session_data **sd, int *index, int *amount, uint32 *char_id, int *zeny); +typedef void (*HPMHOOK_post_clif_vendingreport) (struct map_session_data *sd, int index, int amount, uint32 char_id, int zeny); typedef void (*HPMHOOK_pre_clif_storagelist) (struct map_session_data **sd, struct item **items, int *items_length); typedef void (*HPMHOOK_post_clif_storagelist) (struct map_session_data *sd, struct item *items, int items_length); typedef void (*HPMHOOK_pre_clif_updatestorageamount) (struct map_session_data **sd, int *amount, int *max_amount); @@ -1684,8 +1684,8 @@ typedef void (*HPMHOOK_pre_clif_buyingstore_itemlist) (struct map_session_data * typedef void (*HPMHOOK_post_clif_buyingstore_itemlist) (struct map_session_data *sd, struct map_session_data *pl_sd); typedef void (*HPMHOOK_pre_clif_buyingstore_trade_failed_buyer) (struct map_session_data **sd, short *result); typedef void (*HPMHOOK_post_clif_buyingstore_trade_failed_buyer) (struct map_session_data *sd, short result); -typedef void (*HPMHOOK_pre_clif_buyingstore_update_item) (struct map_session_data **sd, unsigned short *nameid, unsigned short *amount); -typedef void (*HPMHOOK_post_clif_buyingstore_update_item) (struct map_session_data *sd, unsigned short nameid, unsigned short amount); +typedef void (*HPMHOOK_pre_clif_buyingstore_update_item) (struct map_session_data **sd, unsigned short *nameid, unsigned short *amount, uint32 *char_id, int *zeny); +typedef void (*HPMHOOK_post_clif_buyingstore_update_item) (struct map_session_data *sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny); typedef void (*HPMHOOK_pre_clif_buyingstore_delete_item) (struct map_session_data **sd, short *index, unsigned short *amount, int *price); typedef void (*HPMHOOK_post_clif_buyingstore_delete_item) (struct map_session_data *sd, short index, unsigned short amount, int price); typedef void (*HPMHOOK_pre_clif_buyingstore_trade_failed_seller) (struct map_session_data **sd, short *result, unsigned short *nameid); @@ -1764,6 +1764,8 @@ typedef void (*HPMHOOK_pre_clif_ackmergeitems) (int *fd, struct map_session_data typedef void (*HPMHOOK_post_clif_ackmergeitems) (int fd, struct map_session_data *sd); typedef bool (*HPMHOOK_pre_clif_isdisguised) (struct block_list **bl); typedef bool (*HPMHOOK_post_clif_isdisguised) (bool retVal___, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_navigate_to) (struct map_session_data **sd, const char **mapname, uint16 *x, uint16 *y, uint8 *flag, bool *hideWindow, uint16 *mob_id); +typedef void (*HPMHOOK_post_clif_navigate_to) (struct map_session_data *sd, const char *mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id); typedef unsigned char (*HPMHOOK_pre_clif_bl_type) (struct block_list **bl); typedef unsigned char (*HPMHOOK_post_clif_bl_type) (unsigned char retVal___, struct block_list *bl); typedef void (*HPMHOOK_pre_clif_pWantToConnection) (int *fd, struct map_session_data **sd); @@ -3478,8 +3480,8 @@ typedef void (*HPMHOOK_pre_libconfig_destroy) (struct config_t **config); typedef void (*HPMHOOK_post_libconfig_destroy) (struct config_t *config); typedef int (*HPMHOOK_pre_libconfig_setting_get_int) (const struct config_setting_t **setting); typedef int (*HPMHOOK_post_libconfig_setting_get_int) (int retVal___, const struct config_setting_t *setting); -typedef long long (*HPMHOOK_pre_libconfig_setting_get_int64) (const struct config_setting_t **setting); -typedef long long (*HPMHOOK_post_libconfig_setting_get_int64) (long long retVal___, const struct config_setting_t *setting); +typedef int64 (*HPMHOOK_pre_libconfig_setting_get_int64) (const struct config_setting_t **setting); +typedef int64 (*HPMHOOK_post_libconfig_setting_get_int64) (int64 retVal___, const struct config_setting_t *setting); typedef double (*HPMHOOK_pre_libconfig_setting_get_float) (const struct config_setting_t **setting); typedef double (*HPMHOOK_post_libconfig_setting_get_float) (double retVal___, const struct config_setting_t *setting); typedef int (*HPMHOOK_pre_libconfig_setting_get_bool) (const struct config_setting_t **setting); @@ -3490,8 +3492,8 @@ typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_lookup) (struct typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_lookup) (struct config_setting_t* retVal___, struct config_setting_t *setting, const char *name); typedef int (*HPMHOOK_pre_libconfig_setting_lookup_int) (const struct config_setting_t **setting, const char **name, int **value); typedef int (*HPMHOOK_post_libconfig_setting_lookup_int) (int retVal___, const struct config_setting_t *setting, const char *name, int *value); -typedef int (*HPMHOOK_pre_libconfig_setting_lookup_int64) (const struct config_setting_t **setting, const char **name, long long **value); -typedef int (*HPMHOOK_post_libconfig_setting_lookup_int64) (int retVal___, const struct config_setting_t *setting, const char *name, long long *value); +typedef int (*HPMHOOK_pre_libconfig_setting_lookup_int64) (const struct config_setting_t **setting, const char **name, int64 **value); +typedef int (*HPMHOOK_post_libconfig_setting_lookup_int64) (int retVal___, const struct config_setting_t *setting, const char *name, int64 *value); typedef int (*HPMHOOK_pre_libconfig_setting_lookup_float) (const struct config_setting_t **setting, const char **name, double **value); typedef int (*HPMHOOK_post_libconfig_setting_lookup_float) (int retVal___, const struct config_setting_t *setting, const char *name, double *value); typedef int (*HPMHOOK_pre_libconfig_setting_lookup_bool) (const struct config_setting_t **setting, const char **name, int **value); @@ -3500,8 +3502,8 @@ typedef int (*HPMHOOK_pre_libconfig_setting_lookup_string) (const struct config_ typedef int (*HPMHOOK_post_libconfig_setting_lookup_string) (int retVal___, const struct config_setting_t *setting, const char *name, const char **value); typedef int (*HPMHOOK_pre_libconfig_setting_set_int) (struct config_setting_t **setting, int *value); typedef int (*HPMHOOK_post_libconfig_setting_set_int) (int retVal___, struct config_setting_t *setting, int value); -typedef int (*HPMHOOK_pre_libconfig_setting_set_int64) (struct config_setting_t **setting, long long *value); -typedef int (*HPMHOOK_post_libconfig_setting_set_int64) (int retVal___, struct config_setting_t *setting, long long value); +typedef int (*HPMHOOK_pre_libconfig_setting_set_int64) (struct config_setting_t **setting, int64 *value); +typedef int (*HPMHOOK_post_libconfig_setting_set_int64) (int retVal___, struct config_setting_t *setting, int64 value); typedef int (*HPMHOOK_pre_libconfig_setting_set_float) (struct config_setting_t **setting, double *value); typedef int (*HPMHOOK_post_libconfig_setting_set_float) (int retVal___, struct config_setting_t *setting, double value); typedef int (*HPMHOOK_pre_libconfig_setting_set_bool) (struct config_setting_t **setting, int *value); @@ -3514,8 +3516,8 @@ typedef short (*HPMHOOK_pre_libconfig_setting_get_format) (const struct config_s typedef short (*HPMHOOK_post_libconfig_setting_get_format) (short retVal___, const struct config_setting_t *setting); typedef int (*HPMHOOK_pre_libconfig_setting_get_int_elem) (const struct config_setting_t **setting, int *idx); typedef int (*HPMHOOK_post_libconfig_setting_get_int_elem) (int retVal___, const struct config_setting_t *setting, int idx); -typedef long long (*HPMHOOK_pre_libconfig_setting_get_int64_elem) (const struct config_setting_t **setting, int *idx); -typedef long long (*HPMHOOK_post_libconfig_setting_get_int64_elem) (long long retVal___, const struct config_setting_t *setting, int idx); +typedef int64 (*HPMHOOK_pre_libconfig_setting_get_int64_elem) (const struct config_setting_t **setting, int *idx); +typedef int64 (*HPMHOOK_post_libconfig_setting_get_int64_elem) (int64 retVal___, const struct config_setting_t *setting, int idx); typedef double (*HPMHOOK_pre_libconfig_setting_get_float_elem) (const struct config_setting_t **setting, int *idx); typedef double (*HPMHOOK_post_libconfig_setting_get_float_elem) (double retVal___, const struct config_setting_t *setting, int idx); typedef int (*HPMHOOK_pre_libconfig_setting_get_bool_elem) (const struct config_setting_t **setting, int *idx); @@ -3524,8 +3526,8 @@ typedef const char* (*HPMHOOK_pre_libconfig_setting_get_string_elem) (const stru typedef const char* (*HPMHOOK_post_libconfig_setting_get_string_elem) (const char* retVal___, const struct config_setting_t *setting, int idx); typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_int_elem) (struct config_setting_t **setting, int *idx, int *value); typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_int_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value); -typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_int64_elem) (struct config_setting_t **setting, int *idx, long long *value); -typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_int64_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, long long value); +typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_int64_elem) (struct config_setting_t **setting, int *idx, int64 *value); +typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_int64_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value); typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_float_elem) (struct config_setting_t **setting, int *idx, double *value); typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_float_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, double value); typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_bool_elem) (struct config_setting_t **setting, int *idx, int *value); @@ -3552,8 +3554,8 @@ typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_lookup) (const struct c typedef struct config_setting_t* (*HPMHOOK_post_libconfig_lookup) (struct config_setting_t* retVal___, const struct config_t *config, const char *filepath); typedef int (*HPMHOOK_pre_libconfig_lookup_int) (const struct config_t **config, const char **filepath, int **value); typedef int (*HPMHOOK_post_libconfig_lookup_int) (int retVal___, const struct config_t *config, const char *filepath, int *value); -typedef int (*HPMHOOK_pre_libconfig_lookup_int64) (const struct config_t **config, const char **filepath, long long **value); -typedef int (*HPMHOOK_post_libconfig_lookup_int64) (int retVal___, const struct config_t *config, const char *filepath, long long *value); +typedef int (*HPMHOOK_pre_libconfig_lookup_int64) (const struct config_t **config, const char **filepath, int64 **value); +typedef int (*HPMHOOK_post_libconfig_lookup_int64) (int retVal___, const struct config_t *config, const char *filepath, int64 *value); typedef int (*HPMHOOK_pre_libconfig_lookup_float) (const struct config_t **config, const char **filepath, double **value); typedef int (*HPMHOOK_post_libconfig_lookup_float) (int retVal___, const struct config_t *config, const char *filepath, double *value); typedef int (*HPMHOOK_pre_libconfig_lookup_bool) (const struct config_t **config, const char **filepath, int **value); @@ -3785,36 +3787,6 @@ typedef void (*HPMHOOK_post_mail_deliveryfail) (struct map_session_data *sd, str typedef bool (*HPMHOOK_pre_mail_invalid_operation) (struct map_session_data **sd); typedef bool (*HPMHOOK_post_mail_invalid_operation) (bool retVal___, struct map_session_data *sd); #endif // MAP_MAIL_H -#ifdef COMMON_MEMMGR_H /* iMalloc */ -typedef void (*HPMHOOK_pre_iMalloc_init) (void); -typedef void (*HPMHOOK_post_iMalloc_init) (void); -typedef void (*HPMHOOK_pre_iMalloc_final) (void); -typedef void (*HPMHOOK_post_iMalloc_final) (void); -typedef void* (*HPMHOOK_pre_iMalloc_malloc) (size_t *size, const char **file, int *line, const char **func); -typedef void* (*HPMHOOK_post_iMalloc_malloc) (void* retVal___, size_t size, const char *file, int line, const char *func); -typedef void* (*HPMHOOK_pre_iMalloc_calloc) (size_t *num, size_t *size, const char **file, int *line, const char **func); -typedef void* (*HPMHOOK_post_iMalloc_calloc) (void* retVal___, size_t num, size_t size, const char *file, int line, const char *func); -typedef void* (*HPMHOOK_pre_iMalloc_realloc) (void **p, size_t *size, const char **file, int *line, const char **func); -typedef void* (*HPMHOOK_post_iMalloc_realloc) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func); -typedef void* (*HPMHOOK_pre_iMalloc_reallocz) (void **p, size_t *size, const char **file, int *line, const char **func); -typedef void* (*HPMHOOK_post_iMalloc_reallocz) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func); -typedef char* (*HPMHOOK_pre_iMalloc_astrdup) (const char **p, const char **file, int *line, const char **func); -typedef char* (*HPMHOOK_post_iMalloc_astrdup) (char* retVal___, const char *p, const char *file, int line, const char *func); -typedef char* (*HPMHOOK_pre_iMalloc_astrndup) (const char **p, size_t *size, const char **file, int *line, const char **func); -typedef char* (*HPMHOOK_post_iMalloc_astrndup) (char* retVal___, const char *p, size_t size, const char *file, int line, const char *func); -typedef void (*HPMHOOK_pre_iMalloc_free) (void **p, const char **file, int *line, const char **func); -typedef void (*HPMHOOK_post_iMalloc_free) (void *p, const char *file, int line, const char *func); -typedef void (*HPMHOOK_pre_iMalloc_memory_check) (void); -typedef void (*HPMHOOK_post_iMalloc_memory_check) (void); -typedef bool (*HPMHOOK_pre_iMalloc_verify_ptr) (void **ptr); -typedef bool (*HPMHOOK_post_iMalloc_verify_ptr) (bool retVal___, void *ptr); -typedef size_t (*HPMHOOK_pre_iMalloc_usage) (void); -typedef size_t (*HPMHOOK_post_iMalloc_usage) (size_t retVal___); -typedef void (*HPMHOOK_pre_iMalloc_post_shutdown) (void); -typedef void (*HPMHOOK_post_iMalloc_post_shutdown) (void); -typedef void (*HPMHOOK_pre_iMalloc_init_messages) (void); -typedef void (*HPMHOOK_post_iMalloc_init_messages) (void); -#endif // COMMON_MEMMGR_H #ifdef MAP_MAP_H /* map */ typedef void (*HPMHOOK_pre_map_zone_init) (void); typedef void (*HPMHOOK_post_map_zone_init) (void); @@ -5602,6 +5574,8 @@ typedef bool (*HPMHOOK_pre_pc_process_chat_message) (struct map_session_data **s typedef bool (*HPMHOOK_post_pc_process_chat_message) (bool retVal___, struct map_session_data *sd, const char *message); typedef void (*HPMHOOK_pre_pc_check_supernovice_call) (struct map_session_data **sd, const char **message); typedef void (*HPMHOOK_post_pc_check_supernovice_call) (struct map_session_data *sd, const char *message); +typedef bool (*HPMHOOK_pre_pc_check_basicskill) (struct map_session_data **sd, int *level); +typedef bool (*HPMHOOK_post_pc_check_basicskill) (bool retVal___, struct map_session_data *sd, int level); #endif // MAP_PC_H #ifdef MAP_NPC_H /* libpcre */ typedef pcre* (*HPMHOOK_pre_libpcre_compile) (const char **pattern, int *options, const char ***errptr, int **erroffset, const unsigned char **tableptr); @@ -6508,6 +6482,12 @@ typedef void (*HPMHOOK_pre_skill_validate_additional_fields) (struct config_sett typedef void (*HPMHOOK_post_skill_validate_additional_fields) (struct config_setting_t *conf, struct s_skill_db *sk); typedef bool (*HPMHOOK_pre_skill_validate_skilldb) (struct s_skill_db **skt, const char **source); typedef bool (*HPMHOOK_post_skill_validate_skilldb) (bool retVal___, struct s_skill_db *skt, const char *source); +typedef int (*HPMHOOK_pre_skill_validate_weapontype_sub) (const char **type, bool *on, struct s_skill_db **sk); +typedef int (*HPMHOOK_post_skill_validate_weapontype_sub) (int retVal___, const char *type, bool on, struct s_skill_db *sk); +typedef int (*HPMHOOK_pre_skill_validate_ammotype_sub) (const char **type, bool *on, struct s_skill_db **sk); +typedef int (*HPMHOOK_post_skill_validate_ammotype_sub) (int retVal___, const char *type, bool on, struct s_skill_db *sk); +typedef int (*HPMHOOK_pre_skill_validate_unit_flag_sub) (const char **type, bool *on, struct s_skill_db **sk); +typedef int (*HPMHOOK_post_skill_validate_unit_flag_sub) (int retVal___, const char *type, bool on, struct s_skill_db *sk); typedef bool (*HPMHOOK_pre_skill_read_skilldb) (const char **filename); typedef bool (*HPMHOOK_post_skill_read_skilldb) (bool retVal___, const char *filename); typedef void (*HPMHOOK_pre_skill_config_set_level) (struct config_setting_t **conf, int **arr); diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index 836e51f3f..3af236f48 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc @@ -804,34 +804,6 @@ struct { struct HPMHookPoint *HP_loginif_send_users_count_post; struct HPMHookPoint *HP_loginif_connect_to_server_pre; struct HPMHookPoint *HP_loginif_connect_to_server_post; - struct HPMHookPoint *HP_iMalloc_init_pre; - struct HPMHookPoint *HP_iMalloc_init_post; - struct HPMHookPoint *HP_iMalloc_final_pre; - struct HPMHookPoint *HP_iMalloc_final_post; - struct HPMHookPoint *HP_iMalloc_malloc_pre; - struct HPMHookPoint *HP_iMalloc_malloc_post; - struct HPMHookPoint *HP_iMalloc_calloc_pre; - struct HPMHookPoint *HP_iMalloc_calloc_post; - struct HPMHookPoint *HP_iMalloc_realloc_pre; - struct HPMHookPoint *HP_iMalloc_realloc_post; - struct HPMHookPoint *HP_iMalloc_reallocz_pre; - struct HPMHookPoint *HP_iMalloc_reallocz_post; - struct HPMHookPoint *HP_iMalloc_astrdup_pre; - struct HPMHookPoint *HP_iMalloc_astrdup_post; - struct HPMHookPoint *HP_iMalloc_astrndup_pre; - struct HPMHookPoint *HP_iMalloc_astrndup_post; - struct HPMHookPoint *HP_iMalloc_free_pre; - struct HPMHookPoint *HP_iMalloc_free_post; - struct HPMHookPoint *HP_iMalloc_memory_check_pre; - struct HPMHookPoint *HP_iMalloc_memory_check_post; - struct HPMHookPoint *HP_iMalloc_verify_ptr_pre; - struct HPMHookPoint *HP_iMalloc_verify_ptr_post; - struct HPMHookPoint *HP_iMalloc_usage_pre; - struct HPMHookPoint *HP_iMalloc_usage_post; - struct HPMHookPoint *HP_iMalloc_post_shutdown_pre; - struct HPMHookPoint *HP_iMalloc_post_shutdown_post; - struct HPMHookPoint *HP_iMalloc_init_messages_pre; - struct HPMHookPoint *HP_iMalloc_init_messages_post; struct HPMHookPoint *HP_mapif_ban_pre; struct HPMHookPoint *HP_mapif_ban_post; struct HPMHookPoint *HP_mapif_server_init_pre; @@ -2309,34 +2281,6 @@ struct { int HP_loginif_send_users_count_post; int HP_loginif_connect_to_server_pre; int HP_loginif_connect_to_server_post; - int HP_iMalloc_init_pre; - int HP_iMalloc_init_post; - int HP_iMalloc_final_pre; - int HP_iMalloc_final_post; - int HP_iMalloc_malloc_pre; - int HP_iMalloc_malloc_post; - int HP_iMalloc_calloc_pre; - int HP_iMalloc_calloc_post; - int HP_iMalloc_realloc_pre; - int HP_iMalloc_realloc_post; - int HP_iMalloc_reallocz_pre; - int HP_iMalloc_reallocz_post; - int HP_iMalloc_astrdup_pre; - int HP_iMalloc_astrdup_post; - int HP_iMalloc_astrndup_pre; - int HP_iMalloc_astrndup_post; - int HP_iMalloc_free_pre; - int HP_iMalloc_free_post; - int HP_iMalloc_memory_check_pre; - int HP_iMalloc_memory_check_post; - int HP_iMalloc_verify_ptr_pre; - int HP_iMalloc_verify_ptr_post; - int HP_iMalloc_usage_pre; - int HP_iMalloc_usage_post; - int HP_iMalloc_post_shutdown_pre; - int HP_iMalloc_post_shutdown_post; - int HP_iMalloc_init_messages_pre; - int HP_iMalloc_init_messages_post; int HP_mapif_ban_pre; int HP_mapif_ban_post; int HP_mapif_server_init_pre; @@ -3057,7 +3001,6 @@ struct { struct inter_storage_interface inter_storage; struct libconfig_interface libconfig; struct loginif_interface loginif; - struct malloc_interface iMalloc; struct mapif_interface mapif; struct mapindex_interface mapindex; struct md5_interface md5; diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index 047373f77..55fc347e5 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc @@ -436,21 +436,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(loginif->auth, HP_loginif_auth) }, { HP_POP(loginif->send_users_count, HP_loginif_send_users_count) }, { HP_POP(loginif->connect_to_server, HP_loginif_connect_to_server) }, -/* malloc_interface */ - { HP_POP(iMalloc->init, HP_iMalloc_init) }, - { HP_POP(iMalloc->final, HP_iMalloc_final) }, - { HP_POP(iMalloc->malloc, HP_iMalloc_malloc) }, - { HP_POP(iMalloc->calloc, HP_iMalloc_calloc) }, - { HP_POP(iMalloc->realloc, HP_iMalloc_realloc) }, - { HP_POP(iMalloc->reallocz, HP_iMalloc_reallocz) }, - { HP_POP(iMalloc->astrdup, HP_iMalloc_astrdup) }, - { HP_POP(iMalloc->astrndup, HP_iMalloc_astrndup) }, - { HP_POP(iMalloc->free, HP_iMalloc_free) }, - { HP_POP(iMalloc->memory_check, HP_iMalloc_memory_check) }, - { HP_POP(iMalloc->verify_ptr, HP_iMalloc_verify_ptr) }, - { 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) }, /* mapif_interface */ { HP_POP(mapif->ban, HP_mapif_ban) }, { HP_POP(mapif->server_init, HP_mapif_server_init) }, diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index 63afcab3c..bab2c2721 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -744,15 +744,15 @@ int HP_chr_check_char_name(char *name, char *esc_name) { } return retVal___; } -int HP_chr_make_new_char_sql(struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style) { +int HP_chr_make_new_char_sql(struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_chr_make_new_char_sql_pre ) { - int (*preHookFunc) (struct char_session_data **sd, const char **name_, int *str, int *agi, int *vit, int *int_, int *dex, int *luk, int *slot, int *hair_color, int *hair_style); + int (*preHookFunc) (struct char_session_data **sd, const char **name_, int *str, int *agi, int *vit, int *int_, int *dex, int *luk, int *slot, int *hair_color, int *hair_style, short *starting_job); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_make_new_char_sql_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_chr_make_new_char_sql_pre[hIndex].func; - retVal___ = preHookFunc(&sd, &name_, &str, &agi, &vit, &int_, &dex, &luk, &slot, &hair_color, &hair_style); + retVal___ = preHookFunc(&sd, &name_, &str, &agi, &vit, &int_, &dex, &luk, &slot, &hair_color, &hair_style, &starting_job); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -760,13 +760,13 @@ int HP_chr_make_new_char_sql(struct char_session_data *sd, const char *name_, in } } { - retVal___ = HPMHooks.source.chr.make_new_char_sql(sd, name_, str, agi, vit, int_, dex, luk, slot, hair_color, hair_style); + retVal___ = HPMHooks.source.chr.make_new_char_sql(sd, name_, str, agi, vit, int_, dex, luk, slot, hair_color, hair_style, starting_job); } if( HPMHooks.count.HP_chr_make_new_char_sql_post ) { - int (*postHookFunc) (int retVal___, struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style); + int (*postHookFunc) (int retVal___, struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job); for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_make_new_char_sql_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_chr_make_new_char_sql_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, name_, str, agi, vit, int_, dex, luk, slot, hair_color, hair_style); + retVal___ = postHookFunc(retVal___, sd, name_, str, agi, vit, int_, dex, luk, slot, hair_color, hair_style, starting_job); } } return retVal___; @@ -8593,11 +8593,11 @@ int HP_libconfig_setting_get_int(const struct config_setting_t *setting) { } return retVal___; } -long long HP_libconfig_setting_get_int64(const struct config_setting_t *setting) { +int64 HP_libconfig_setting_get_int64(const struct config_setting_t *setting) { int hIndex = 0; - long long retVal___ = 0; + int64 retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_get_int64_pre ) { - long long (*preHookFunc) (const struct config_setting_t **setting); + int64 (*preHookFunc) (const struct config_setting_t **setting); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_pre[hIndex].func; @@ -8612,7 +8612,7 @@ long long HP_libconfig_setting_get_int64(const struct config_setting_t *setting) retVal___ = HPMHooks.source.libconfig.setting_get_int64(setting); } if( HPMHooks.count.HP_libconfig_setting_get_int64_post ) { - long long (*postHookFunc) (long long retVal___, const struct config_setting_t *setting); + int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting); @@ -8755,11 +8755,11 @@ int HP_libconfig_setting_lookup_int(const struct config_setting_t *setting, cons } return retVal___; } -int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, long long *value) { +int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, int64 *value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_lookup_int64_pre ) { - int (*preHookFunc) (const struct config_setting_t **setting, const char **name, long long **value); + int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int64 **value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_pre[hIndex].func; @@ -8774,7 +8774,7 @@ int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, co retVal___ = HPMHooks.source.libconfig.setting_lookup_int64(setting, name, value); } if( HPMHooks.count.HP_libconfig_setting_lookup_int64_post ) { - int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, long long *value); + int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int64 *value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, name, value); @@ -8890,11 +8890,11 @@ int HP_libconfig_setting_set_int(struct config_setting_t *setting, int value) { } return retVal___; } -int HP_libconfig_setting_set_int64(struct config_setting_t *setting, long long value) { +int HP_libconfig_setting_set_int64(struct config_setting_t *setting, int64 value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_set_int64_pre ) { - int (*preHookFunc) (struct config_setting_t **setting, long long *value); + int (*preHookFunc) (struct config_setting_t **setting, int64 *value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_pre[hIndex].func; @@ -8909,7 +8909,7 @@ int HP_libconfig_setting_set_int64(struct config_setting_t *setting, long long v retVal___ = HPMHooks.source.libconfig.setting_set_int64(setting, value); } if( HPMHooks.count.HP_libconfig_setting_set_int64_post ) { - int (*postHookFunc) (int retVal___, struct config_setting_t *setting, long long value); + int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int64 value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, value); @@ -9079,11 +9079,11 @@ int HP_libconfig_setting_get_int_elem(const struct config_setting_t *setting, in } return retVal___; } -long long HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) { +int64 HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) { int hIndex = 0; - long long retVal___ = 0; + int64 retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre ) { - long long (*preHookFunc) (const struct config_setting_t **setting, int *idx); + int64 (*preHookFunc) (const struct config_setting_t **setting, int *idx); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_pre[hIndex].func; @@ -9098,7 +9098,7 @@ long long HP_libconfig_setting_get_int64_elem(const struct config_setting_t *set retVal___ = HPMHooks.source.libconfig.setting_get_int64_elem(setting, idx); } if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_post ) { - long long (*postHookFunc) (long long retVal___, const struct config_setting_t *setting, int idx); + int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting, int idx); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx); @@ -9214,11 +9214,11 @@ struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, long long value) { +struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) { int hIndex = 0; struct config_setting_t* retVal___ = NULL; if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre ) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, long long *value); + struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_pre[hIndex].func; @@ -9233,7 +9233,7 @@ struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setti retVal___ = HPMHooks.source.libconfig.setting_set_int64_elem(setting, idx, value); } if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_post ) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, long long value); + struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -9591,11 +9591,11 @@ int HP_libconfig_lookup_int(const struct config_t *config, const char *filepath, } return retVal___; } -int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, long long *value) { +int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, int64 *value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_lookup_int64_pre ) { - int (*preHookFunc) (const struct config_t **config, const char **filepath, long long **value); + int (*preHookFunc) (const struct config_t **config, const char **filepath, int64 **value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_pre[hIndex].func; @@ -9610,7 +9610,7 @@ int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepat retVal___ = HPMHooks.source.libconfig.lookup_int64(config, filepath, value); } if( HPMHooks.count.HP_libconfig_lookup_int64_post ) { - int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, long long *value); + int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int64 *value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, config, filepath, value); @@ -10440,379 +10440,6 @@ void HP_loginif_connect_to_server(void) { } return; } -/* malloc_interface */ -void HP_iMalloc_init(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_init_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_init_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.init(); - } - if( HPMHooks.count.HP_iMalloc_init_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_init_post[hIndex].func; - postHookFunc(); - } - } - return; -} -void HP_iMalloc_final(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_final_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_final_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.final(); - } - if( HPMHooks.count.HP_iMalloc_final_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_final_post[hIndex].func; - postHookFunc(); - } - } - return; -} -void* HP_iMalloc_malloc(size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - void* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_malloc_pre ) { - void* (*preHookFunc) (size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_malloc_pre[hIndex].func; - retVal___ = preHookFunc(&size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.malloc(size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_malloc_post ) { - void* (*postHookFunc) (void* retVal___, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_malloc_post[hIndex].func; - retVal___ = postHookFunc(retVal___, size, file, line, func); - } - } - return retVal___; -} -void* HP_iMalloc_calloc(size_t num, size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - void* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_calloc_pre ) { - void* (*preHookFunc) (size_t *num, size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_calloc_pre[hIndex].func; - retVal___ = preHookFunc(&num, &size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.calloc(num, size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_calloc_post ) { - void* (*postHookFunc) (void* retVal___, size_t num, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_calloc_post[hIndex].func; - retVal___ = postHookFunc(retVal___, num, size, file, line, func); - } - } - return retVal___; -} -void* HP_iMalloc_realloc(void *p, size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - void* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_realloc_pre ) { - void* (*preHookFunc) (void **p, size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_realloc_pre[hIndex].func; - retVal___ = preHookFunc(&p, &size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.realloc(p, size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_realloc_post ) { - void* (*postHookFunc) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_realloc_post[hIndex].func; - retVal___ = postHookFunc(retVal___, p, size, file, line, func); - } - } - return retVal___; -} -void* HP_iMalloc_reallocz(void *p, size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - void* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_reallocz_pre ) { - void* (*preHookFunc) (void **p, size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_reallocz_pre[hIndex].func; - retVal___ = preHookFunc(&p, &size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.reallocz(p, size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_reallocz_post ) { - void* (*postHookFunc) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_reallocz_post[hIndex].func; - retVal___ = postHookFunc(retVal___, p, size, file, line, func); - } - } - return retVal___; -} -char* HP_iMalloc_astrdup(const char *p, const char *file, int line, const char *func) { - int hIndex = 0; - char* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_astrdup_pre ) { - char* (*preHookFunc) (const char **p, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_astrdup_pre[hIndex].func; - retVal___ = preHookFunc(&p, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.astrdup(p, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_astrdup_post ) { - char* (*postHookFunc) (char* retVal___, const char *p, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_astrdup_post[hIndex].func; - retVal___ = postHookFunc(retVal___, p, file, line, func); - } - } - return retVal___; -} -char* HP_iMalloc_astrndup(const char *p, size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - char* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_astrndup_pre ) { - char* (*preHookFunc) (const char **p, size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrndup_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_astrndup_pre[hIndex].func; - retVal___ = preHookFunc(&p, &size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.astrndup(p, size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_astrndup_post ) { - char* (*postHookFunc) (char* retVal___, const char *p, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrndup_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_astrndup_post[hIndex].func; - retVal___ = postHookFunc(retVal___, p, size, file, line, func); - } - } - return retVal___; -} -void HP_iMalloc_free(void *p, const char *file, int line, const char *func) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_free_pre ) { - void (*preHookFunc) (void **p, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_free_pre[hIndex].func; - preHookFunc(&p, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.free(p, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_free_post ) { - void (*postHookFunc) (void *p, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_free_post[hIndex].func; - postHookFunc(p, file, line, func); - } - } - return; -} -void HP_iMalloc_memory_check(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_memory_check_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_memory_check_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.memory_check(); - } - if( HPMHooks.count.HP_iMalloc_memory_check_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_memory_check_post[hIndex].func; - postHookFunc(); - } - } - return; -} -bool HP_iMalloc_verify_ptr(void *ptr) { - int hIndex = 0; - bool retVal___ = false; - if( HPMHooks.count.HP_iMalloc_verify_ptr_pre ) { - bool (*preHookFunc) (void **ptr); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_pre[hIndex].func; - retVal___ = preHookFunc(&ptr); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.verify_ptr(ptr); - } - if( HPMHooks.count.HP_iMalloc_verify_ptr_post ) { - bool (*postHookFunc) (bool retVal___, void *ptr); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_post[hIndex].func; - retVal___ = postHookFunc(retVal___, ptr); - } - } - return retVal___; -} -size_t HP_iMalloc_usage(void) { - int hIndex = 0; - size_t retVal___ = 0; - if( HPMHooks.count.HP_iMalloc_usage_pre ) { - size_t (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_usage_pre[hIndex].func; - retVal___ = preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.usage(); - } - if( HPMHooks.count.HP_iMalloc_usage_post ) { - size_t (*postHookFunc) (size_t retVal___); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_usage_post[hIndex].func; - retVal___ = postHookFunc(retVal___); - } - } - return retVal___; -} -void HP_iMalloc_post_shutdown(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_post_shutdown_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.post_shutdown(); - } - if( HPMHooks.count.HP_iMalloc_post_shutdown_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_post[hIndex].func; - postHookFunc(); - } - } - return; -} -void HP_iMalloc_init_messages(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_init_messages_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_init_messages_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.init_messages(); - } - if( HPMHooks.count.HP_iMalloc_init_messages_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_init_messages_post[hIndex].func; - postHookFunc(); - } - } - return; -} /* mapif_interface */ void HP_mapif_ban(int id, unsigned int flag, int status) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_char.sources.inc b/src/plugins/HPMHooking/HPMHooking_char.sources.inc index 54ae8f030..d940e379a 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.sources.inc @@ -46,7 +46,6 @@ memcpy(&HPMHooks.source.inter_quest, inter_quest, sizeof(struct inter_quest_inte memcpy(&HPMHooks.source.inter_storage, inter_storage, sizeof(struct inter_storage_interface)); memcpy(&HPMHooks.source.libconfig, libconfig, sizeof(struct libconfig_interface)); 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)); diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc index b97b6ea7f..1d7ac8267 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc @@ -376,34 +376,6 @@ struct { struct HPMHookPoint *HP_login_config_set_defaults_post; struct HPMHookPoint *HP_login_config_read_pre; struct HPMHookPoint *HP_login_config_read_post; - struct HPMHookPoint *HP_iMalloc_init_pre; - struct HPMHookPoint *HP_iMalloc_init_post; - struct HPMHookPoint *HP_iMalloc_final_pre; - struct HPMHookPoint *HP_iMalloc_final_post; - struct HPMHookPoint *HP_iMalloc_malloc_pre; - struct HPMHookPoint *HP_iMalloc_malloc_post; - struct HPMHookPoint *HP_iMalloc_calloc_pre; - struct HPMHookPoint *HP_iMalloc_calloc_post; - struct HPMHookPoint *HP_iMalloc_realloc_pre; - struct HPMHookPoint *HP_iMalloc_realloc_post; - struct HPMHookPoint *HP_iMalloc_reallocz_pre; - struct HPMHookPoint *HP_iMalloc_reallocz_post; - struct HPMHookPoint *HP_iMalloc_astrdup_pre; - struct HPMHookPoint *HP_iMalloc_astrdup_post; - struct HPMHookPoint *HP_iMalloc_astrndup_pre; - struct HPMHookPoint *HP_iMalloc_astrndup_post; - struct HPMHookPoint *HP_iMalloc_free_pre; - struct HPMHookPoint *HP_iMalloc_free_post; - struct HPMHookPoint *HP_iMalloc_memory_check_pre; - struct HPMHookPoint *HP_iMalloc_memory_check_post; - struct HPMHookPoint *HP_iMalloc_verify_ptr_pre; - struct HPMHookPoint *HP_iMalloc_verify_ptr_post; - struct HPMHookPoint *HP_iMalloc_usage_pre; - struct HPMHookPoint *HP_iMalloc_usage_post; - struct HPMHookPoint *HP_iMalloc_post_shutdown_pre; - 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; @@ -1077,34 +1049,6 @@ struct { int HP_login_config_set_defaults_post; int HP_login_config_read_pre; int HP_login_config_read_post; - int HP_iMalloc_init_pre; - int HP_iMalloc_init_post; - int HP_iMalloc_final_pre; - int HP_iMalloc_final_post; - int HP_iMalloc_malloc_pre; - int HP_iMalloc_malloc_post; - int HP_iMalloc_calloc_pre; - int HP_iMalloc_calloc_post; - int HP_iMalloc_realloc_pre; - int HP_iMalloc_realloc_post; - int HP_iMalloc_reallocz_pre; - int HP_iMalloc_reallocz_post; - int HP_iMalloc_astrdup_pre; - int HP_iMalloc_astrdup_post; - int HP_iMalloc_astrndup_pre; - int HP_iMalloc_astrndup_post; - int HP_iMalloc_free_pre; - int HP_iMalloc_free_post; - int HP_iMalloc_memory_check_pre; - int HP_iMalloc_memory_check_post; - int HP_iMalloc_verify_ptr_pre; - int HP_iMalloc_verify_ptr_post; - int HP_iMalloc_usage_pre; - int HP_iMalloc_usage_post; - int HP_iMalloc_post_shutdown_pre; - 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; @@ -1438,7 +1382,6 @@ struct { 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; diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc index 2d3e37bc3..96a711af6 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc @@ -211,21 +211,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(login->parse_request_connection, HP_login_parse_request_connection) }, { HP_POP(login->config_set_defaults, HP_login_config_set_defaults) }, { HP_POP(login->config_read, HP_login_config_read) }, -/* malloc_interface */ - { HP_POP(iMalloc->init, HP_iMalloc_init) }, - { HP_POP(iMalloc->final, HP_iMalloc_final) }, - { HP_POP(iMalloc->malloc, HP_iMalloc_malloc) }, - { HP_POP(iMalloc->calloc, HP_iMalloc_calloc) }, - { HP_POP(iMalloc->realloc, HP_iMalloc_realloc) }, - { HP_POP(iMalloc->reallocz, HP_iMalloc_reallocz) }, - { HP_POP(iMalloc->astrdup, HP_iMalloc_astrdup) }, - { HP_POP(iMalloc->astrndup, HP_iMalloc_astrndup) }, - { HP_POP(iMalloc->free, HP_iMalloc_free) }, - { HP_POP(iMalloc->memory_check, HP_iMalloc_memory_check) }, - { HP_POP(iMalloc->verify_ptr, HP_iMalloc_verify_ptr) }, - { 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) }, diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 290c2283a..b5fc0e70b 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -1899,11 +1899,11 @@ int HP_libconfig_setting_get_int(const struct config_setting_t *setting) { } return retVal___; } -long long HP_libconfig_setting_get_int64(const struct config_setting_t *setting) { +int64 HP_libconfig_setting_get_int64(const struct config_setting_t *setting) { int hIndex = 0; - long long retVal___ = 0; + int64 retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_get_int64_pre ) { - long long (*preHookFunc) (const struct config_setting_t **setting); + int64 (*preHookFunc) (const struct config_setting_t **setting); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_pre[hIndex].func; @@ -1918,7 +1918,7 @@ long long HP_libconfig_setting_get_int64(const struct config_setting_t *setting) retVal___ = HPMHooks.source.libconfig.setting_get_int64(setting); } if( HPMHooks.count.HP_libconfig_setting_get_int64_post ) { - long long (*postHookFunc) (long long retVal___, const struct config_setting_t *setting); + int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting); @@ -2061,11 +2061,11 @@ int HP_libconfig_setting_lookup_int(const struct config_setting_t *setting, cons } return retVal___; } -int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, long long *value) { +int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, int64 *value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_lookup_int64_pre ) { - int (*preHookFunc) (const struct config_setting_t **setting, const char **name, long long **value); + int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int64 **value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_pre[hIndex].func; @@ -2080,7 +2080,7 @@ int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, co retVal___ = HPMHooks.source.libconfig.setting_lookup_int64(setting, name, value); } if( HPMHooks.count.HP_libconfig_setting_lookup_int64_post ) { - int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, long long *value); + int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int64 *value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, name, value); @@ -2196,11 +2196,11 @@ int HP_libconfig_setting_set_int(struct config_setting_t *setting, int value) { } return retVal___; } -int HP_libconfig_setting_set_int64(struct config_setting_t *setting, long long value) { +int HP_libconfig_setting_set_int64(struct config_setting_t *setting, int64 value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_set_int64_pre ) { - int (*preHookFunc) (struct config_setting_t **setting, long long *value); + int (*preHookFunc) (struct config_setting_t **setting, int64 *value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_pre[hIndex].func; @@ -2215,7 +2215,7 @@ int HP_libconfig_setting_set_int64(struct config_setting_t *setting, long long v retVal___ = HPMHooks.source.libconfig.setting_set_int64(setting, value); } if( HPMHooks.count.HP_libconfig_setting_set_int64_post ) { - int (*postHookFunc) (int retVal___, struct config_setting_t *setting, long long value); + int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int64 value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, value); @@ -2385,11 +2385,11 @@ int HP_libconfig_setting_get_int_elem(const struct config_setting_t *setting, in } return retVal___; } -long long HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) { +int64 HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) { int hIndex = 0; - long long retVal___ = 0; + int64 retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre ) { - long long (*preHookFunc) (const struct config_setting_t **setting, int *idx); + int64 (*preHookFunc) (const struct config_setting_t **setting, int *idx); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_pre[hIndex].func; @@ -2404,7 +2404,7 @@ long long HP_libconfig_setting_get_int64_elem(const struct config_setting_t *set retVal___ = HPMHooks.source.libconfig.setting_get_int64_elem(setting, idx); } if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_post ) { - long long (*postHookFunc) (long long retVal___, const struct config_setting_t *setting, int idx); + int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting, int idx); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx); @@ -2520,11 +2520,11 @@ struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, long long value) { +struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) { int hIndex = 0; struct config_setting_t* retVal___ = NULL; if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre ) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, long long *value); + struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_pre[hIndex].func; @@ -2539,7 +2539,7 @@ struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setti retVal___ = HPMHooks.source.libconfig.setting_set_int64_elem(setting, idx, value); } if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_post ) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, long long value); + struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -2897,11 +2897,11 @@ int HP_libconfig_lookup_int(const struct config_t *config, const char *filepath, } return retVal___; } -int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, long long *value) { +int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, int64 *value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_lookup_int64_pre ) { - int (*preHookFunc) (const struct config_t **config, const char **filepath, long long **value); + int (*preHookFunc) (const struct config_t **config, const char **filepath, int64 **value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_pre[hIndex].func; @@ -2916,7 +2916,7 @@ int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepat retVal___ = HPMHooks.source.libconfig.lookup_int64(config, filepath, value); } if( HPMHooks.count.HP_libconfig_lookup_int64_post ) { - int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, long long *value); + int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int64 *value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, config, filepath, value); @@ -4716,379 +4716,6 @@ bool HP_login_config_read(const char *filename, bool included) { } return retVal___; } -/* malloc_interface */ -void HP_iMalloc_init(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_init_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_init_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.init(); - } - if( HPMHooks.count.HP_iMalloc_init_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_init_post[hIndex].func; - postHookFunc(); - } - } - return; -} -void HP_iMalloc_final(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_final_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_final_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.final(); - } - if( HPMHooks.count.HP_iMalloc_final_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_final_post[hIndex].func; - postHookFunc(); - } - } - return; -} -void* HP_iMalloc_malloc(size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - void* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_malloc_pre ) { - void* (*preHookFunc) (size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_malloc_pre[hIndex].func; - retVal___ = preHookFunc(&size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.malloc(size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_malloc_post ) { - void* (*postHookFunc) (void* retVal___, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_malloc_post[hIndex].func; - retVal___ = postHookFunc(retVal___, size, file, line, func); - } - } - return retVal___; -} -void* HP_iMalloc_calloc(size_t num, size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - void* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_calloc_pre ) { - void* (*preHookFunc) (size_t *num, size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_calloc_pre[hIndex].func; - retVal___ = preHookFunc(&num, &size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.calloc(num, size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_calloc_post ) { - void* (*postHookFunc) (void* retVal___, size_t num, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_calloc_post[hIndex].func; - retVal___ = postHookFunc(retVal___, num, size, file, line, func); - } - } - return retVal___; -} -void* HP_iMalloc_realloc(void *p, size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - void* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_realloc_pre ) { - void* (*preHookFunc) (void **p, size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_realloc_pre[hIndex].func; - retVal___ = preHookFunc(&p, &size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.realloc(p, size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_realloc_post ) { - void* (*postHookFunc) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_realloc_post[hIndex].func; - retVal___ = postHookFunc(retVal___, p, size, file, line, func); - } - } - return retVal___; -} -void* HP_iMalloc_reallocz(void *p, size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - void* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_reallocz_pre ) { - void* (*preHookFunc) (void **p, size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_reallocz_pre[hIndex].func; - retVal___ = preHookFunc(&p, &size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.reallocz(p, size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_reallocz_post ) { - void* (*postHookFunc) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_reallocz_post[hIndex].func; - retVal___ = postHookFunc(retVal___, p, size, file, line, func); - } - } - return retVal___; -} -char* HP_iMalloc_astrdup(const char *p, const char *file, int line, const char *func) { - int hIndex = 0; - char* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_astrdup_pre ) { - char* (*preHookFunc) (const char **p, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_astrdup_pre[hIndex].func; - retVal___ = preHookFunc(&p, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.astrdup(p, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_astrdup_post ) { - char* (*postHookFunc) (char* retVal___, const char *p, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_astrdup_post[hIndex].func; - retVal___ = postHookFunc(retVal___, p, file, line, func); - } - } - return retVal___; -} -char* HP_iMalloc_astrndup(const char *p, size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - char* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_astrndup_pre ) { - char* (*preHookFunc) (const char **p, size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrndup_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_astrndup_pre[hIndex].func; - retVal___ = preHookFunc(&p, &size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.astrndup(p, size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_astrndup_post ) { - char* (*postHookFunc) (char* retVal___, const char *p, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrndup_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_astrndup_post[hIndex].func; - retVal___ = postHookFunc(retVal___, p, size, file, line, func); - } - } - return retVal___; -} -void HP_iMalloc_free(void *p, const char *file, int line, const char *func) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_free_pre ) { - void (*preHookFunc) (void **p, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_free_pre[hIndex].func; - preHookFunc(&p, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.free(p, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_free_post ) { - void (*postHookFunc) (void *p, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_free_post[hIndex].func; - postHookFunc(p, file, line, func); - } - } - return; -} -void HP_iMalloc_memory_check(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_memory_check_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_memory_check_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.memory_check(); - } - if( HPMHooks.count.HP_iMalloc_memory_check_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_memory_check_post[hIndex].func; - postHookFunc(); - } - } - return; -} -bool HP_iMalloc_verify_ptr(void *ptr) { - int hIndex = 0; - bool retVal___ = false; - if( HPMHooks.count.HP_iMalloc_verify_ptr_pre ) { - bool (*preHookFunc) (void **ptr); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_pre[hIndex].func; - retVal___ = preHookFunc(&ptr); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.verify_ptr(ptr); - } - if( HPMHooks.count.HP_iMalloc_verify_ptr_post ) { - bool (*postHookFunc) (bool retVal___, void *ptr); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_post[hIndex].func; - retVal___ = postHookFunc(retVal___, ptr); - } - } - return retVal___; -} -size_t HP_iMalloc_usage(void) { - int hIndex = 0; - size_t retVal___ = 0; - if( HPMHooks.count.HP_iMalloc_usage_pre ) { - size_t (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_usage_pre[hIndex].func; - retVal___ = preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.usage(); - } - if( HPMHooks.count.HP_iMalloc_usage_post ) { - size_t (*postHookFunc) (size_t retVal___); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_usage_post[hIndex].func; - retVal___ = postHookFunc(retVal___); - } - } - return retVal___; -} -void HP_iMalloc_post_shutdown(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_post_shutdown_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.post_shutdown(); - } - if( HPMHooks.count.HP_iMalloc_post_shutdown_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_post[hIndex].func; - postHookFunc(); - } - } - return; -} -void HP_iMalloc_init_messages(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_init_messages_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_init_messages_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.init_messages(); - } - if( HPMHooks.count.HP_iMalloc_init_messages_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_init_messages_post[hIndex].func; - postHookFunc(); - } - } - return; -} /* md5_interface */ void HP_md5_string(const char *string, char *output) { int hIndex = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_login.sources.inc b/src/plugins/HPMHooking/HPMHooking_login.sources.inc index 6677a0c55..4bb7f5396 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.sources.inc @@ -35,7 +35,6 @@ 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)); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 0845d8cdd..22f0b3a8a 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -1402,6 +1402,8 @@ struct { struct HPMHookPoint *HP_clif_ackmergeitems_post; struct HPMHookPoint *HP_clif_isdisguised_pre; struct HPMHookPoint *HP_clif_isdisguised_post; + struct HPMHookPoint *HP_clif_navigate_to_pre; + struct HPMHookPoint *HP_clif_navigate_to_post; struct HPMHookPoint *HP_clif_bl_type_pre; struct HPMHookPoint *HP_clif_bl_type_post; struct HPMHookPoint *HP_clif_pWantToConnection_pre; @@ -2982,34 +2984,6 @@ struct { struct HPMHookPoint *HP_mail_deliveryfail_post; struct HPMHookPoint *HP_mail_invalid_operation_pre; struct HPMHookPoint *HP_mail_invalid_operation_post; - struct HPMHookPoint *HP_iMalloc_init_pre; - struct HPMHookPoint *HP_iMalloc_init_post; - struct HPMHookPoint *HP_iMalloc_final_pre; - struct HPMHookPoint *HP_iMalloc_final_post; - struct HPMHookPoint *HP_iMalloc_malloc_pre; - struct HPMHookPoint *HP_iMalloc_malloc_post; - struct HPMHookPoint *HP_iMalloc_calloc_pre; - struct HPMHookPoint *HP_iMalloc_calloc_post; - struct HPMHookPoint *HP_iMalloc_realloc_pre; - struct HPMHookPoint *HP_iMalloc_realloc_post; - struct HPMHookPoint *HP_iMalloc_reallocz_pre; - struct HPMHookPoint *HP_iMalloc_reallocz_post; - struct HPMHookPoint *HP_iMalloc_astrdup_pre; - struct HPMHookPoint *HP_iMalloc_astrdup_post; - struct HPMHookPoint *HP_iMalloc_astrndup_pre; - struct HPMHookPoint *HP_iMalloc_astrndup_post; - struct HPMHookPoint *HP_iMalloc_free_pre; - struct HPMHookPoint *HP_iMalloc_free_post; - struct HPMHookPoint *HP_iMalloc_memory_check_pre; - struct HPMHookPoint *HP_iMalloc_memory_check_post; - struct HPMHookPoint *HP_iMalloc_verify_ptr_pre; - struct HPMHookPoint *HP_iMalloc_verify_ptr_post; - struct HPMHookPoint *HP_iMalloc_usage_pre; - struct HPMHookPoint *HP_iMalloc_usage_post; - struct HPMHookPoint *HP_iMalloc_post_shutdown_pre; - struct HPMHookPoint *HP_iMalloc_post_shutdown_post; - struct HPMHookPoint *HP_iMalloc_init_messages_pre; - struct HPMHookPoint *HP_iMalloc_init_messages_post; struct HPMHookPoint *HP_map_zone_init_pre; struct HPMHookPoint *HP_map_zone_init_post; struct HPMHookPoint *HP_map_zone_remove_pre; @@ -4428,6 +4402,8 @@ struct { struct HPMHookPoint *HP_pc_process_chat_message_post; struct HPMHookPoint *HP_pc_check_supernovice_call_pre; struct HPMHookPoint *HP_pc_check_supernovice_call_post; + struct HPMHookPoint *HP_pc_check_basicskill_pre; + struct HPMHookPoint *HP_pc_check_basicskill_post; struct HPMHookPoint *HP_libpcre_compile_pre; struct HPMHookPoint *HP_libpcre_compile_post; struct HPMHookPoint *HP_libpcre_study_pre; @@ -5296,6 +5272,12 @@ struct { struct HPMHookPoint *HP_skill_validate_additional_fields_post; struct HPMHookPoint *HP_skill_validate_skilldb_pre; struct HPMHookPoint *HP_skill_validate_skilldb_post; + struct HPMHookPoint *HP_skill_validate_weapontype_sub_pre; + struct HPMHookPoint *HP_skill_validate_weapontype_sub_post; + struct HPMHookPoint *HP_skill_validate_ammotype_sub_pre; + struct HPMHookPoint *HP_skill_validate_ammotype_sub_post; + struct HPMHookPoint *HP_skill_validate_unit_flag_sub_pre; + struct HPMHookPoint *HP_skill_validate_unit_flag_sub_post; struct HPMHookPoint *HP_skill_read_skilldb_pre; struct HPMHookPoint *HP_skill_read_skilldb_post; struct HPMHookPoint *HP_skill_config_set_level_pre; @@ -7457,6 +7439,8 @@ struct { int HP_clif_ackmergeitems_post; int HP_clif_isdisguised_pre; int HP_clif_isdisguised_post; + int HP_clif_navigate_to_pre; + int HP_clif_navigate_to_post; int HP_clif_bl_type_pre; int HP_clif_bl_type_post; int HP_clif_pWantToConnection_pre; @@ -9037,34 +9021,6 @@ struct { int HP_mail_deliveryfail_post; int HP_mail_invalid_operation_pre; int HP_mail_invalid_operation_post; - int HP_iMalloc_init_pre; - int HP_iMalloc_init_post; - int HP_iMalloc_final_pre; - int HP_iMalloc_final_post; - int HP_iMalloc_malloc_pre; - int HP_iMalloc_malloc_post; - int HP_iMalloc_calloc_pre; - int HP_iMalloc_calloc_post; - int HP_iMalloc_realloc_pre; - int HP_iMalloc_realloc_post; - int HP_iMalloc_reallocz_pre; - int HP_iMalloc_reallocz_post; - int HP_iMalloc_astrdup_pre; - int HP_iMalloc_astrdup_post; - int HP_iMalloc_astrndup_pre; - int HP_iMalloc_astrndup_post; - int HP_iMalloc_free_pre; - int HP_iMalloc_free_post; - int HP_iMalloc_memory_check_pre; - int HP_iMalloc_memory_check_post; - int HP_iMalloc_verify_ptr_pre; - int HP_iMalloc_verify_ptr_post; - int HP_iMalloc_usage_pre; - int HP_iMalloc_usage_post; - int HP_iMalloc_post_shutdown_pre; - int HP_iMalloc_post_shutdown_post; - int HP_iMalloc_init_messages_pre; - int HP_iMalloc_init_messages_post; int HP_map_zone_init_pre; int HP_map_zone_init_post; int HP_map_zone_remove_pre; @@ -10483,6 +10439,8 @@ struct { int HP_pc_process_chat_message_post; int HP_pc_check_supernovice_call_pre; int HP_pc_check_supernovice_call_post; + int HP_pc_check_basicskill_pre; + int HP_pc_check_basicskill_post; int HP_libpcre_compile_pre; int HP_libpcre_compile_post; int HP_libpcre_study_pre; @@ -11351,6 +11309,12 @@ struct { int HP_skill_validate_additional_fields_post; int HP_skill_validate_skilldb_pre; int HP_skill_validate_skilldb_post; + int HP_skill_validate_weapontype_sub_pre; + int HP_skill_validate_weapontype_sub_post; + int HP_skill_validate_ammotype_sub_pre; + int HP_skill_validate_ammotype_sub_post; + int HP_skill_validate_unit_flag_sub_pre; + int HP_skill_validate_unit_flag_sub_post; int HP_skill_read_skilldb_pre; int HP_skill_read_skilldb_post; int HP_skill_config_set_level_pre; @@ -12163,7 +12127,6 @@ struct { struct libconfig_interface libconfig; struct log_interface logs; struct mail_interface mail; - struct malloc_interface iMalloc; struct map_interface map; struct mapindex_interface mapindex; struct mapit_interface mapit; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 30ede196a..0a3dc10fe 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -723,6 +723,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->comparemergeitem, HP_clif_comparemergeitem) }, { HP_POP(clif->ackmergeitems, HP_clif_ackmergeitems) }, { HP_POP(clif->isdisguised, HP_clif_isdisguised) }, + { HP_POP(clif->navigate_to, HP_clif_navigate_to) }, { HP_POP(clif->bl_type, HP_clif_bl_type) }, { HP_POP(clif->pWantToConnection, HP_clif_pWantToConnection) }, { HP_POP(clif->pLoadEndAck, HP_clif_pLoadEndAck) }, @@ -1531,21 +1532,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mail->openmail, HP_mail_openmail) }, { HP_POP(mail->deliveryfail, HP_mail_deliveryfail) }, { HP_POP(mail->invalid_operation, HP_mail_invalid_operation) }, -/* malloc_interface */ - { HP_POP(iMalloc->init, HP_iMalloc_init) }, - { HP_POP(iMalloc->final, HP_iMalloc_final) }, - { HP_POP(iMalloc->malloc, HP_iMalloc_malloc) }, - { HP_POP(iMalloc->calloc, HP_iMalloc_calloc) }, - { HP_POP(iMalloc->realloc, HP_iMalloc_realloc) }, - { HP_POP(iMalloc->reallocz, HP_iMalloc_reallocz) }, - { HP_POP(iMalloc->astrdup, HP_iMalloc_astrdup) }, - { HP_POP(iMalloc->astrndup, HP_iMalloc_astrndup) }, - { HP_POP(iMalloc->free, HP_iMalloc_free) }, - { HP_POP(iMalloc->memory_check, HP_iMalloc_memory_check) }, - { HP_POP(iMalloc->verify_ptr, HP_iMalloc_verify_ptr) }, - { 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) }, /* map_interface */ { HP_POP(map->zone_init, HP_map_zone_init) }, { HP_POP(map->zone_remove, HP_map_zone_remove) }, @@ -2270,6 +2256,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->have_magnifier, HP_pc_have_magnifier) }, { HP_POP(pc->process_chat_message, HP_pc_process_chat_message) }, { HP_POP(pc->check_supernovice_call, HP_pc_check_supernovice_call) }, + { HP_POP(pc->check_basicskill, HP_pc_check_basicskill) }, /* pcre_interface */ { HP_POP(libpcre->compile, HP_libpcre_compile) }, { HP_POP(libpcre->study, HP_libpcre_study) }, @@ -2712,6 +2699,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(skill->validate_unit_flag, HP_skill_validate_unit_flag) }, { HP_POP(skill->validate_additional_fields, HP_skill_validate_additional_fields) }, { HP_POP(skill->validate_skilldb, HP_skill_validate_skilldb) }, + { HP_POP(skill->validate_weapontype_sub, HP_skill_validate_weapontype_sub) }, + { HP_POP(skill->validate_ammotype_sub, HP_skill_validate_ammotype_sub) }, + { HP_POP(skill->validate_unit_flag_sub, HP_skill_validate_unit_flag_sub) }, { HP_POP(skill->read_skilldb, HP_skill_read_skilldb) }, { HP_POP(skill->config_set_level, HP_skill_config_set_level) }, { HP_POP(skill->level_set_value, HP_skill_level_set_value) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 819c3b28c..7b8fac984 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -13447,14 +13447,14 @@ void HP_clif_openvending(struct map_session_data *sd, int id, struct s_vending * } return; } -void HP_clif_vendingreport(struct map_session_data *sd, int index, int amount) { +void HP_clif_vendingreport(struct map_session_data *sd, int index, int amount, uint32 char_id, int zeny) { int hIndex = 0; if( HPMHooks.count.HP_clif_vendingreport_pre ) { - void (*preHookFunc) (struct map_session_data **sd, int *index, int *amount); + void (*preHookFunc) (struct map_session_data **sd, int *index, int *amount, uint32 *char_id, int *zeny); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_vendingreport_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_clif_vendingreport_pre[hIndex].func; - preHookFunc(&sd, &index, &amount); + preHookFunc(&sd, &index, &amount, &char_id, &zeny); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -13462,13 +13462,13 @@ void HP_clif_vendingreport(struct map_session_data *sd, int index, int amount) { } } { - HPMHooks.source.clif.vendingreport(sd, index, amount); + HPMHooks.source.clif.vendingreport(sd, index, amount, char_id, zeny); } if( HPMHooks.count.HP_clif_vendingreport_post ) { - void (*postHookFunc) (struct map_session_data *sd, int index, int amount); + void (*postHookFunc) (struct map_session_data *sd, int index, int amount, uint32 char_id, int zeny); for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_vendingreport_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_clif_vendingreport_post[hIndex].func; - postHookFunc(sd, index, amount); + postHookFunc(sd, index, amount, char_id, zeny); } } return; @@ -17200,14 +17200,14 @@ void HP_clif_buyingstore_trade_failed_buyer(struct map_session_data *sd, short r } return; } -void HP_clif_buyingstore_update_item(struct map_session_data *sd, unsigned short nameid, unsigned short amount) { +void HP_clif_buyingstore_update_item(struct map_session_data *sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny) { int hIndex = 0; if( HPMHooks.count.HP_clif_buyingstore_update_item_pre ) { - void (*preHookFunc) (struct map_session_data **sd, unsigned short *nameid, unsigned short *amount); + void (*preHookFunc) (struct map_session_data **sd, unsigned short *nameid, unsigned short *amount, uint32 *char_id, int *zeny); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_update_item_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_clif_buyingstore_update_item_pre[hIndex].func; - preHookFunc(&sd, &nameid, &amount); + preHookFunc(&sd, &nameid, &amount, &char_id, &zeny); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -17215,13 +17215,13 @@ void HP_clif_buyingstore_update_item(struct map_session_data *sd, unsigned short } } { - HPMHooks.source.clif.buyingstore_update_item(sd, nameid, amount); + HPMHooks.source.clif.buyingstore_update_item(sd, nameid, amount, char_id, zeny); } if( HPMHooks.count.HP_clif_buyingstore_update_item_post ) { - void (*postHookFunc) (struct map_session_data *sd, unsigned short nameid, unsigned short amount); + void (*postHookFunc) (struct map_session_data *sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny); for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_update_item_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_clif_buyingstore_update_item_post[hIndex].func; - postHookFunc(sd, nameid, amount); + postHookFunc(sd, nameid, amount, char_id, zeny); } } return; @@ -18246,6 +18246,32 @@ bool HP_clif_isdisguised(struct block_list *bl) { } return retVal___; } +void HP_clif_navigate_to(struct map_session_data *sd, const char *mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id) { + int hIndex = 0; + if( HPMHooks.count.HP_clif_navigate_to_pre ) { + void (*preHookFunc) (struct map_session_data **sd, const char **mapname, uint16 *x, uint16 *y, uint8 *flag, bool *hideWindow, uint16 *mob_id); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_navigate_to_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_navigate_to_pre[hIndex].func; + preHookFunc(&sd, &mapname, &x, &y, &flag, &hideWindow, &mob_id); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.navigate_to(sd, mapname, x, y, flag, hideWindow, mob_id); + } + if( HPMHooks.count.HP_clif_navigate_to_post ) { + void (*postHookFunc) (struct map_session_data *sd, const char *mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_navigate_to_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_navigate_to_post[hIndex].func; + postHookFunc(sd, mapname, x, y, flag, hideWindow, mob_id); + } + } + return; +} unsigned char HP_clif_bl_type(struct block_list *bl) { int hIndex = 0; unsigned char retVal___ = 0; @@ -36946,11 +36972,11 @@ int HP_libconfig_setting_get_int(const struct config_setting_t *setting) { } return retVal___; } -long long HP_libconfig_setting_get_int64(const struct config_setting_t *setting) { +int64 HP_libconfig_setting_get_int64(const struct config_setting_t *setting) { int hIndex = 0; - long long retVal___ = 0; + int64 retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_get_int64_pre ) { - long long (*preHookFunc) (const struct config_setting_t **setting); + int64 (*preHookFunc) (const struct config_setting_t **setting); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_pre[hIndex].func; @@ -36965,7 +36991,7 @@ long long HP_libconfig_setting_get_int64(const struct config_setting_t *setting) retVal___ = HPMHooks.source.libconfig.setting_get_int64(setting); } if( HPMHooks.count.HP_libconfig_setting_get_int64_post ) { - long long (*postHookFunc) (long long retVal___, const struct config_setting_t *setting); + int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting); @@ -37108,11 +37134,11 @@ int HP_libconfig_setting_lookup_int(const struct config_setting_t *setting, cons } return retVal___; } -int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, long long *value) { +int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, int64 *value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_lookup_int64_pre ) { - int (*preHookFunc) (const struct config_setting_t **setting, const char **name, long long **value); + int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int64 **value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_pre[hIndex].func; @@ -37127,7 +37153,7 @@ int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, co retVal___ = HPMHooks.source.libconfig.setting_lookup_int64(setting, name, value); } if( HPMHooks.count.HP_libconfig_setting_lookup_int64_post ) { - int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, long long *value); + int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int64 *value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, name, value); @@ -37243,11 +37269,11 @@ int HP_libconfig_setting_set_int(struct config_setting_t *setting, int value) { } return retVal___; } -int HP_libconfig_setting_set_int64(struct config_setting_t *setting, long long value) { +int HP_libconfig_setting_set_int64(struct config_setting_t *setting, int64 value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_set_int64_pre ) { - int (*preHookFunc) (struct config_setting_t **setting, long long *value); + int (*preHookFunc) (struct config_setting_t **setting, int64 *value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_pre[hIndex].func; @@ -37262,7 +37288,7 @@ int HP_libconfig_setting_set_int64(struct config_setting_t *setting, long long v retVal___ = HPMHooks.source.libconfig.setting_set_int64(setting, value); } if( HPMHooks.count.HP_libconfig_setting_set_int64_post ) { - int (*postHookFunc) (int retVal___, struct config_setting_t *setting, long long value); + int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int64 value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, value); @@ -37432,11 +37458,11 @@ int HP_libconfig_setting_get_int_elem(const struct config_setting_t *setting, in } return retVal___; } -long long HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) { +int64 HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) { int hIndex = 0; - long long retVal___ = 0; + int64 retVal___ = 0; if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre ) { - long long (*preHookFunc) (const struct config_setting_t **setting, int *idx); + int64 (*preHookFunc) (const struct config_setting_t **setting, int *idx); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_pre[hIndex].func; @@ -37451,7 +37477,7 @@ long long HP_libconfig_setting_get_int64_elem(const struct config_setting_t *set retVal___ = HPMHooks.source.libconfig.setting_get_int64_elem(setting, idx); } if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_post ) { - long long (*postHookFunc) (long long retVal___, const struct config_setting_t *setting, int idx); + int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting, int idx); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx); @@ -37567,11 +37593,11 @@ struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, long long value) { +struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) { int hIndex = 0; struct config_setting_t* retVal___ = NULL; if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre ) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, long long *value); + struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_pre[hIndex].func; @@ -37586,7 +37612,7 @@ struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setti retVal___ = HPMHooks.source.libconfig.setting_set_int64_elem(setting, idx, value); } if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_post ) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, long long value); + struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -37944,11 +37970,11 @@ int HP_libconfig_lookup_int(const struct config_t *config, const char *filepath, } return retVal___; } -int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, long long *value) { +int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, int64 *value) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_libconfig_lookup_int64_pre ) { - int (*preHookFunc) (const struct config_t **config, const char **filepath, long long **value); + int (*preHookFunc) (const struct config_t **config, const char **filepath, int64 **value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_pre[hIndex].func; @@ -37963,7 +37989,7 @@ int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepat retVal___ = HPMHooks.source.libconfig.lookup_int64(config, filepath, value); } if( HPMHooks.count.HP_libconfig_lookup_int64_post ) { - int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, long long *value); + int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int64 *value); for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_post[hIndex].func; retVal___ = postHookFunc(retVal___, config, filepath, value); @@ -39272,379 +39298,6 @@ bool HP_mail_invalid_operation(struct map_session_data *sd) { } return retVal___; } -/* malloc_interface */ -void HP_iMalloc_init(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_init_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_init_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.init(); - } - if( HPMHooks.count.HP_iMalloc_init_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_init_post[hIndex].func; - postHookFunc(); - } - } - return; -} -void HP_iMalloc_final(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_final_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_final_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.final(); - } - if( HPMHooks.count.HP_iMalloc_final_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_final_post[hIndex].func; - postHookFunc(); - } - } - return; -} -void* HP_iMalloc_malloc(size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - void* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_malloc_pre ) { - void* (*preHookFunc) (size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_malloc_pre[hIndex].func; - retVal___ = preHookFunc(&size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.malloc(size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_malloc_post ) { - void* (*postHookFunc) (void* retVal___, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_malloc_post[hIndex].func; - retVal___ = postHookFunc(retVal___, size, file, line, func); - } - } - return retVal___; -} -void* HP_iMalloc_calloc(size_t num, size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - void* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_calloc_pre ) { - void* (*preHookFunc) (size_t *num, size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_calloc_pre[hIndex].func; - retVal___ = preHookFunc(&num, &size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.calloc(num, size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_calloc_post ) { - void* (*postHookFunc) (void* retVal___, size_t num, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_calloc_post[hIndex].func; - retVal___ = postHookFunc(retVal___, num, size, file, line, func); - } - } - return retVal___; -} -void* HP_iMalloc_realloc(void *p, size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - void* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_realloc_pre ) { - void* (*preHookFunc) (void **p, size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_realloc_pre[hIndex].func; - retVal___ = preHookFunc(&p, &size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.realloc(p, size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_realloc_post ) { - void* (*postHookFunc) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_realloc_post[hIndex].func; - retVal___ = postHookFunc(retVal___, p, size, file, line, func); - } - } - return retVal___; -} -void* HP_iMalloc_reallocz(void *p, size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - void* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_reallocz_pre ) { - void* (*preHookFunc) (void **p, size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_reallocz_pre[hIndex].func; - retVal___ = preHookFunc(&p, &size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.reallocz(p, size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_reallocz_post ) { - void* (*postHookFunc) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_reallocz_post[hIndex].func; - retVal___ = postHookFunc(retVal___, p, size, file, line, func); - } - } - return retVal___; -} -char* HP_iMalloc_astrdup(const char *p, const char *file, int line, const char *func) { - int hIndex = 0; - char* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_astrdup_pre ) { - char* (*preHookFunc) (const char **p, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_astrdup_pre[hIndex].func; - retVal___ = preHookFunc(&p, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.astrdup(p, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_astrdup_post ) { - char* (*postHookFunc) (char* retVal___, const char *p, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_astrdup_post[hIndex].func; - retVal___ = postHookFunc(retVal___, p, file, line, func); - } - } - return retVal___; -} -char* HP_iMalloc_astrndup(const char *p, size_t size, const char *file, int line, const char *func) { - int hIndex = 0; - char* retVal___ = NULL; - if( HPMHooks.count.HP_iMalloc_astrndup_pre ) { - char* (*preHookFunc) (const char **p, size_t *size, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrndup_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_astrndup_pre[hIndex].func; - retVal___ = preHookFunc(&p, &size, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.astrndup(p, size, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_astrndup_post ) { - char* (*postHookFunc) (char* retVal___, const char *p, size_t size, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrndup_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_astrndup_post[hIndex].func; - retVal___ = postHookFunc(retVal___, p, size, file, line, func); - } - } - return retVal___; -} -void HP_iMalloc_free(void *p, const char *file, int line, const char *func) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_free_pre ) { - void (*preHookFunc) (void **p, const char **file, int *line, const char **func); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_free_pre[hIndex].func; - preHookFunc(&p, &file, &line, &func); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.free(p, file, line, func); - } - if( HPMHooks.count.HP_iMalloc_free_post ) { - void (*postHookFunc) (void *p, const char *file, int line, const char *func); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_free_post[hIndex].func; - postHookFunc(p, file, line, func); - } - } - return; -} -void HP_iMalloc_memory_check(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_memory_check_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_memory_check_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.memory_check(); - } - if( HPMHooks.count.HP_iMalloc_memory_check_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_memory_check_post[hIndex].func; - postHookFunc(); - } - } - return; -} -bool HP_iMalloc_verify_ptr(void *ptr) { - int hIndex = 0; - bool retVal___ = false; - if( HPMHooks.count.HP_iMalloc_verify_ptr_pre ) { - bool (*preHookFunc) (void **ptr); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_pre[hIndex].func; - retVal___ = preHookFunc(&ptr); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.verify_ptr(ptr); - } - if( HPMHooks.count.HP_iMalloc_verify_ptr_post ) { - bool (*postHookFunc) (bool retVal___, void *ptr); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_post[hIndex].func; - retVal___ = postHookFunc(retVal___, ptr); - } - } - return retVal___; -} -size_t HP_iMalloc_usage(void) { - int hIndex = 0; - size_t retVal___ = 0; - if( HPMHooks.count.HP_iMalloc_usage_pre ) { - size_t (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_usage_pre[hIndex].func; - retVal___ = preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.iMalloc.usage(); - } - if( HPMHooks.count.HP_iMalloc_usage_post ) { - size_t (*postHookFunc) (size_t retVal___); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_usage_post[hIndex].func; - retVal___ = postHookFunc(retVal___); - } - } - return retVal___; -} -void HP_iMalloc_post_shutdown(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_post_shutdown_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.post_shutdown(); - } - if( HPMHooks.count.HP_iMalloc_post_shutdown_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_post[hIndex].func; - postHookFunc(); - } - } - return; -} -void HP_iMalloc_init_messages(void) { - int hIndex = 0; - if( HPMHooks.count.HP_iMalloc_init_messages_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_iMalloc_init_messages_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.iMalloc.init_messages(); - } - if( HPMHooks.count.HP_iMalloc_init_messages_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_iMalloc_init_messages_post[hIndex].func; - postHookFunc(); - } - } - return; -} /* map_interface */ void HP_map_zone_init(void) { int hIndex = 0; @@ -58994,6 +58647,33 @@ void HP_pc_check_supernovice_call(struct map_session_data *sd, const char *messa } return; } +bool HP_pc_check_basicskill(struct map_session_data *sd, int level) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_pc_check_basicskill_pre ) { + bool (*preHookFunc) (struct map_session_data **sd, int *level); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_basicskill_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pc_check_basicskill_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &level); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.check_basicskill(sd, level); + } + if( HPMHooks.count.HP_pc_check_basicskill_post ) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int level); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_basicskill_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pc_check_basicskill_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, level); + } + } + return retVal___; +} /* pcre_interface */ pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr) { int hIndex = 0; @@ -70906,6 +70586,87 @@ bool HP_skill_validate_skilldb(struct s_skill_db *skt, const char *source) { } return retVal___; } +int HP_skill_validate_weapontype_sub(const char *type, bool on, struct s_skill_db *sk) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_skill_validate_weapontype_sub_pre ) { + int (*preHookFunc) (const char **type, bool *on, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_weapontype_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_weapontype_sub_pre[hIndex].func; + retVal___ = preHookFunc(&type, &on, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.skill.validate_weapontype_sub(type, on, sk); + } + if( HPMHooks.count.HP_skill_validate_weapontype_sub_post ) { + int (*postHookFunc) (int retVal___, const char *type, bool on, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_weapontype_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_weapontype_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, type, on, sk); + } + } + return retVal___; +} +int HP_skill_validate_ammotype_sub(const char *type, bool on, struct s_skill_db *sk) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_skill_validate_ammotype_sub_pre ) { + int (*preHookFunc) (const char **type, bool *on, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_ammotype_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_ammotype_sub_pre[hIndex].func; + retVal___ = preHookFunc(&type, &on, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.skill.validate_ammotype_sub(type, on, sk); + } + if( HPMHooks.count.HP_skill_validate_ammotype_sub_post ) { + int (*postHookFunc) (int retVal___, const char *type, bool on, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_ammotype_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_ammotype_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, type, on, sk); + } + } + return retVal___; +} +int HP_skill_validate_unit_flag_sub(const char *type, bool on, struct s_skill_db *sk) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_skill_validate_unit_flag_sub_pre ) { + int (*preHookFunc) (const char **type, bool *on, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_unit_flag_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_unit_flag_sub_pre[hIndex].func; + retVal___ = preHookFunc(&type, &on, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.skill.validate_unit_flag_sub(type, on, sk); + } + if( HPMHooks.count.HP_skill_validate_unit_flag_sub_post ) { + int (*postHookFunc) (int retVal___, const char *type, bool on, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_unit_flag_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_unit_flag_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, type, on, sk); + } + } + return retVal___; +} bool HP_skill_read_skilldb(const char *filename) { int hIndex = 0; bool retVal___ = false; diff --git a/src/plugins/HPMHooking/HPMHooking_map.sources.inc b/src/plugins/HPMHooking/HPMHooking_map.sources.inc index 54861ed6f..0cc52b595 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.sources.inc @@ -52,7 +52,6 @@ memcpy(&HPMHooks.source.itemdb, itemdb, sizeof(struct itemdb_interface)); memcpy(&HPMHooks.source.libconfig, libconfig, sizeof(struct libconfig_interface)); memcpy(&HPMHooks.source.logs, logs, sizeof(struct log_interface)); memcpy(&HPMHooks.source.mail, mail, sizeof(struct mail_interface)); -memcpy(&HPMHooks.source.iMalloc, iMalloc, sizeof(struct malloc_interface)); 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)); diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c index af5ab99af..f801e4147 100644 --- a/src/plugins/db2sql.c +++ b/src/plugins/db2sql.c @@ -457,7 +457,7 @@ void itemdb2sql_tableheader(void) " `equip_jobs` bigint(20) UNSIGNED DEFAULT NULL,\n" " `equip_upper` tinyint(8) UNSIGNED DEFAULT NULL,\n" " `equip_genders` tinyint(2) UNSIGNED DEFAULT NULL,\n" - " `equip_locations` smallint(4) UNSIGNED DEFAULT NULL,\n" + " `equip_locations` mediumint(8) UNSIGNED DEFAULT NULL,\n" " `weapon_level` tinyint(2) UNSIGNED DEFAULT NULL,\n" " `equip_level_min` smallint(5) UNSIGNED DEFAULT NULL,\n" " `equip_level_max` smallint(5) UNSIGNED DEFAULT NULL,\n" diff --git a/src/plugins/dbghelpplug.c b/src/plugins/dbghelpplug.c index cf8be0901..78517419f 100644 --- a/src/plugins/dbghelpplug.c +++ b/src/plugins/dbghelpplug.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2012-2015 Hercules Dev Team + * Copyright (C) 2012-2016 Hercules Dev Team * Copyright (C) Athena Dev Teams * * Hercules is free software: you can redistribute it and/or modify |