diff options
author | Hercules.ws <dev@herc.ws> | 2020-05-27 13:08:18 +0200 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2020-05-27 13:08:18 +0200 |
commit | 787e5996c7bb25fb33104d63ee4520994f1aa563 (patch) | |
tree | 6e06909349356f70f810a3cb4f94a724dd874aff /src/plugins | |
parent | f1755315045b90ae1bf752c772e9d4bc747c8671 (diff) | |
download | hercules-787e5996c7bb25fb33104d63ee4520994f1aa563.tar.gz hercules-787e5996c7bb25fb33104d63ee4520994f1aa563.tar.bz2 hercules-787e5996c7bb25fb33104d63ee4520994f1aa563.tar.xz hercules-787e5996c7bb25fb33104d63ee4520994f1aa563.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 26 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 52 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 13 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 343 |
4 files changed, 368 insertions, 66 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 6be5e2414..93f4ba960 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -5224,20 +5224,32 @@ typedef bool (*HPMHOOK_pre_mapit_exists) (struct s_mapiterator **iter); typedef bool (*HPMHOOK_post_mapit_exists) (bool retVal___, struct s_mapiterator *iter); #endif // MAP_MAP_H #ifdef MAP_MAPREG_H /* mapreg */ -typedef void (*HPMHOOK_pre_mapreg_init) (void); -typedef void (*HPMHOOK_post_mapreg_init) (void); -typedef void (*HPMHOOK_pre_mapreg_final) (void); -typedef void (*HPMHOOK_post_mapreg_final) (void); typedef int (*HPMHOOK_pre_mapreg_readreg) (int64 *uid); typedef int (*HPMHOOK_post_mapreg_readreg) (int retVal___, int64 uid); typedef char* (*HPMHOOK_pre_mapreg_readregstr) (int64 *uid); typedef char* (*HPMHOOK_post_mapreg_readregstr) (char* retVal___, int64 uid); +typedef bool (*HPMHOOK_pre_mapreg_set_num_db) (int64 *uid, const char **name, unsigned int *index, int *value); +typedef bool (*HPMHOOK_post_mapreg_set_num_db) (bool retVal___, int64 uid, const char *name, unsigned int index, int value); +typedef bool (*HPMHOOK_pre_mapreg_delete_num_db) (int64 *uid, const char **name, unsigned int *index); +typedef bool (*HPMHOOK_post_mapreg_delete_num_db) (bool retVal___, int64 uid, const char *name, unsigned int index); typedef bool (*HPMHOOK_pre_mapreg_setreg) (int64 *uid, int *val); typedef bool (*HPMHOOK_post_mapreg_setreg) (bool retVal___, int64 uid, int val); +typedef bool (*HPMHOOK_pre_mapreg_set_str_db) (int64 *uid, const char **name, unsigned int *index, const char **value); +typedef bool (*HPMHOOK_post_mapreg_set_str_db) (bool retVal___, int64 uid, const char *name, unsigned int index, const char *value); +typedef bool (*HPMHOOK_pre_mapreg_delete_str_db) (int64 *uid, const char **name, unsigned int *index); +typedef bool (*HPMHOOK_post_mapreg_delete_str_db) (bool retVal___, int64 uid, const char *name, unsigned int index); typedef bool (*HPMHOOK_pre_mapreg_setregstr) (int64 *uid, const char **str); typedef bool (*HPMHOOK_post_mapreg_setregstr) (bool retVal___, int64 uid, const char *str); +typedef void (*HPMHOOK_pre_mapreg_load_num_db) (void); +typedef void (*HPMHOOK_post_mapreg_load_num_db) (void); +typedef void (*HPMHOOK_pre_mapreg_load_str_db) (void); +typedef void (*HPMHOOK_post_mapreg_load_str_db) (void); typedef void (*HPMHOOK_pre_mapreg_load) (void); typedef void (*HPMHOOK_post_mapreg_load) (void); +typedef void (*HPMHOOK_pre_mapreg_save_num_db) (const char **name, unsigned int *index, int *value); +typedef void (*HPMHOOK_post_mapreg_save_num_db) (const char *name, unsigned int index, int value); +typedef void (*HPMHOOK_pre_mapreg_save_str_db) (const char **name, unsigned int *index, const char **value); +typedef void (*HPMHOOK_post_mapreg_save_str_db) (const char *name, unsigned int index, const char *value); typedef void (*HPMHOOK_pre_mapreg_save) (void); typedef void (*HPMHOOK_post_mapreg_save) (void); typedef int (*HPMHOOK_pre_mapreg_save_timer) (int *tid, int64 *tick, int *id, intptr_t *data); @@ -5246,6 +5258,12 @@ typedef int (*HPMHOOK_pre_mapreg_destroyreg) (union DBKey *key, struct DBData ** typedef int (*HPMHOOK_post_mapreg_destroyreg) (int retVal___, union DBKey key, struct DBData *data, va_list ap); typedef void (*HPMHOOK_pre_mapreg_reload) (void); typedef void (*HPMHOOK_post_mapreg_reload) (void); +typedef bool (*HPMHOOK_pre_mapreg_config_read_registry) (const char **filename, const struct config_setting_t **config, bool *imported); +typedef bool (*HPMHOOK_post_mapreg_config_read_registry) (bool retVal___, const char *filename, const struct config_setting_t *config, bool imported); +typedef void (*HPMHOOK_pre_mapreg_final) (void); +typedef void (*HPMHOOK_post_mapreg_final) (void); +typedef void (*HPMHOOK_pre_mapreg_init) (void); +typedef void (*HPMHOOK_post_mapreg_init) (void); #endif // MAP_MAPREG_H #ifdef COMMON_MD5CALC_H /* md5 */ typedef void (*HPMHOOK_pre_md5_string) (const char **string, char **output); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 82f67a8a3..df3a28bcb 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -3828,20 +3828,32 @@ struct { struct HPMHookPoint *HP_mapit_prev_post; struct HPMHookPoint *HP_mapit_exists_pre; struct HPMHookPoint *HP_mapit_exists_post; - struct HPMHookPoint *HP_mapreg_init_pre; - struct HPMHookPoint *HP_mapreg_init_post; - struct HPMHookPoint *HP_mapreg_final_pre; - struct HPMHookPoint *HP_mapreg_final_post; struct HPMHookPoint *HP_mapreg_readreg_pre; struct HPMHookPoint *HP_mapreg_readreg_post; struct HPMHookPoint *HP_mapreg_readregstr_pre; struct HPMHookPoint *HP_mapreg_readregstr_post; + struct HPMHookPoint *HP_mapreg_set_num_db_pre; + struct HPMHookPoint *HP_mapreg_set_num_db_post; + struct HPMHookPoint *HP_mapreg_delete_num_db_pre; + struct HPMHookPoint *HP_mapreg_delete_num_db_post; struct HPMHookPoint *HP_mapreg_setreg_pre; struct HPMHookPoint *HP_mapreg_setreg_post; + struct HPMHookPoint *HP_mapreg_set_str_db_pre; + struct HPMHookPoint *HP_mapreg_set_str_db_post; + struct HPMHookPoint *HP_mapreg_delete_str_db_pre; + struct HPMHookPoint *HP_mapreg_delete_str_db_post; struct HPMHookPoint *HP_mapreg_setregstr_pre; struct HPMHookPoint *HP_mapreg_setregstr_post; + struct HPMHookPoint *HP_mapreg_load_num_db_pre; + struct HPMHookPoint *HP_mapreg_load_num_db_post; + struct HPMHookPoint *HP_mapreg_load_str_db_pre; + struct HPMHookPoint *HP_mapreg_load_str_db_post; struct HPMHookPoint *HP_mapreg_load_pre; struct HPMHookPoint *HP_mapreg_load_post; + struct HPMHookPoint *HP_mapreg_save_num_db_pre; + struct HPMHookPoint *HP_mapreg_save_num_db_post; + struct HPMHookPoint *HP_mapreg_save_str_db_pre; + struct HPMHookPoint *HP_mapreg_save_str_db_post; struct HPMHookPoint *HP_mapreg_save_pre; struct HPMHookPoint *HP_mapreg_save_post; struct HPMHookPoint *HP_mapreg_save_timer_pre; @@ -3850,6 +3862,12 @@ struct { struct HPMHookPoint *HP_mapreg_destroyreg_post; struct HPMHookPoint *HP_mapreg_reload_pre; struct HPMHookPoint *HP_mapreg_reload_post; + struct HPMHookPoint *HP_mapreg_config_read_registry_pre; + struct HPMHookPoint *HP_mapreg_config_read_registry_post; + struct HPMHookPoint *HP_mapreg_final_pre; + struct HPMHookPoint *HP_mapreg_final_post; + struct HPMHookPoint *HP_mapreg_init_pre; + struct HPMHookPoint *HP_mapreg_init_post; struct HPMHookPoint *HP_md5_string_pre; struct HPMHookPoint *HP_md5_string_post; struct HPMHookPoint *HP_md5_binary_pre; @@ -10729,20 +10747,32 @@ struct { int HP_mapit_prev_post; int HP_mapit_exists_pre; int HP_mapit_exists_post; - int HP_mapreg_init_pre; - int HP_mapreg_init_post; - int HP_mapreg_final_pre; - int HP_mapreg_final_post; int HP_mapreg_readreg_pre; int HP_mapreg_readreg_post; int HP_mapreg_readregstr_pre; int HP_mapreg_readregstr_post; + int HP_mapreg_set_num_db_pre; + int HP_mapreg_set_num_db_post; + int HP_mapreg_delete_num_db_pre; + int HP_mapreg_delete_num_db_post; int HP_mapreg_setreg_pre; int HP_mapreg_setreg_post; + int HP_mapreg_set_str_db_pre; + int HP_mapreg_set_str_db_post; + int HP_mapreg_delete_str_db_pre; + int HP_mapreg_delete_str_db_post; int HP_mapreg_setregstr_pre; int HP_mapreg_setregstr_post; + int HP_mapreg_load_num_db_pre; + int HP_mapreg_load_num_db_post; + int HP_mapreg_load_str_db_pre; + int HP_mapreg_load_str_db_post; int HP_mapreg_load_pre; int HP_mapreg_load_post; + int HP_mapreg_save_num_db_pre; + int HP_mapreg_save_num_db_post; + int HP_mapreg_save_str_db_pre; + int HP_mapreg_save_str_db_post; int HP_mapreg_save_pre; int HP_mapreg_save_post; int HP_mapreg_save_timer_pre; @@ -10751,6 +10781,12 @@ struct { int HP_mapreg_destroyreg_post; int HP_mapreg_reload_pre; int HP_mapreg_reload_post; + int HP_mapreg_config_read_registry_pre; + int HP_mapreg_config_read_registry_post; + int HP_mapreg_final_pre; + int HP_mapreg_final_post; + int HP_mapreg_init_pre; + int HP_mapreg_init_post; int HP_md5_string_pre; int HP_md5_string_post; int HP_md5_binary_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 1e7145aa7..3720e8a51 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1960,17 +1960,26 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapit->prev, HP_mapit_prev) }, { HP_POP(mapit->exists, HP_mapit_exists) }, /* mapreg_interface */ - { HP_POP(mapreg->init, HP_mapreg_init) }, - { HP_POP(mapreg->final, HP_mapreg_final) }, { HP_POP(mapreg->readreg, HP_mapreg_readreg) }, { HP_POP(mapreg->readregstr, HP_mapreg_readregstr) }, + { HP_POP(mapreg->set_num_db, HP_mapreg_set_num_db) }, + { HP_POP(mapreg->delete_num_db, HP_mapreg_delete_num_db) }, { HP_POP(mapreg->setreg, HP_mapreg_setreg) }, + { HP_POP(mapreg->set_str_db, HP_mapreg_set_str_db) }, + { HP_POP(mapreg->delete_str_db, HP_mapreg_delete_str_db) }, { HP_POP(mapreg->setregstr, HP_mapreg_setregstr) }, + { HP_POP(mapreg->load_num_db, HP_mapreg_load_num_db) }, + { HP_POP(mapreg->load_str_db, HP_mapreg_load_str_db) }, { HP_POP(mapreg->load, HP_mapreg_load) }, + { HP_POP(mapreg->save_num_db, HP_mapreg_save_num_db) }, + { HP_POP(mapreg->save_str_db, HP_mapreg_save_str_db) }, { HP_POP(mapreg->save, HP_mapreg_save) }, { HP_POP(mapreg->save_timer, HP_mapreg_save_timer) }, { HP_POP(mapreg->destroyreg, HP_mapreg_destroyreg) }, { HP_POP(mapreg->reload, HP_mapreg_reload) }, + { HP_POP(mapreg->config_read_registry, HP_mapreg_config_read_registry) }, + { HP_POP(mapreg->final, HP_mapreg_final) }, + { HP_POP(mapreg->init, HP_mapreg_init) }, /* md5_interface */ { HP_POP(md5->string, HP_md5_string) }, { HP_POP(md5->binary, HP_md5_binary) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 7a8eac693..d5ab95ba2 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -50618,58 +50618,6 @@ bool HP_mapit_exists(struct s_mapiterator *iter) { return retVal___; } /* mapreg_interface */ -void HP_mapreg_init(void) { - int hIndex = 0; - if (HPMHooks.count.HP_mapreg_init_pre > 0) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_init_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapreg_init_pre[hIndex].func; - preHookFunc(); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.mapreg.init(); - } - if (HPMHooks.count.HP_mapreg_init_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_init_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapreg_init_post[hIndex].func; - postHookFunc(); - } - } - return; -} -void HP_mapreg_final(void) { - int hIndex = 0; - if (HPMHooks.count.HP_mapreg_final_pre > 0) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_final_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mapreg_final_pre[hIndex].func; - preHookFunc(); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.mapreg.final(); - } - if (HPMHooks.count.HP_mapreg_final_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_final_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mapreg_final_post[hIndex].func; - postHookFunc(); - } - } - return; -} int HP_mapreg_readreg(int64 uid) { int hIndex = 0; int retVal___ = 0; @@ -50724,6 +50672,60 @@ char* HP_mapreg_readregstr(int64 uid) { } return retVal___; } +bool HP_mapreg_set_num_db(int64 uid, const char *name, unsigned int index, int value) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_mapreg_set_num_db_pre > 0) { + bool (*preHookFunc) (int64 *uid, const char **name, unsigned int *index, int *value); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_set_num_db_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapreg_set_num_db_pre[hIndex].func; + retVal___ = preHookFunc(&uid, &name, &index, &value); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mapreg.set_num_db(uid, name, index, value); + } + if (HPMHooks.count.HP_mapreg_set_num_db_post > 0) { + bool (*postHookFunc) (bool retVal___, int64 uid, const char *name, unsigned int index, int value); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_set_num_db_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapreg_set_num_db_post[hIndex].func; + retVal___ = postHookFunc(retVal___, uid, name, index, value); + } + } + return retVal___; +} +bool HP_mapreg_delete_num_db(int64 uid, const char *name, unsigned int index) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_mapreg_delete_num_db_pre > 0) { + bool (*preHookFunc) (int64 *uid, const char **name, unsigned int *index); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_delete_num_db_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapreg_delete_num_db_pre[hIndex].func; + retVal___ = preHookFunc(&uid, &name, &index); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mapreg.delete_num_db(uid, name, index); + } + if (HPMHooks.count.HP_mapreg_delete_num_db_post > 0) { + bool (*postHookFunc) (bool retVal___, int64 uid, const char *name, unsigned int index); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_delete_num_db_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapreg_delete_num_db_post[hIndex].func; + retVal___ = postHookFunc(retVal___, uid, name, index); + } + } + return retVal___; +} bool HP_mapreg_setreg(int64 uid, int val) { int hIndex = 0; bool retVal___ = false; @@ -50751,6 +50753,60 @@ bool HP_mapreg_setreg(int64 uid, int val) { } return retVal___; } +bool HP_mapreg_set_str_db(int64 uid, const char *name, unsigned int index, const char *value) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_mapreg_set_str_db_pre > 0) { + bool (*preHookFunc) (int64 *uid, const char **name, unsigned int *index, const char **value); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_set_str_db_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapreg_set_str_db_pre[hIndex].func; + retVal___ = preHookFunc(&uid, &name, &index, &value); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mapreg.set_str_db(uid, name, index, value); + } + if (HPMHooks.count.HP_mapreg_set_str_db_post > 0) { + bool (*postHookFunc) (bool retVal___, int64 uid, const char *name, unsigned int index, const char *value); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_set_str_db_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapreg_set_str_db_post[hIndex].func; + retVal___ = postHookFunc(retVal___, uid, name, index, value); + } + } + return retVal___; +} +bool HP_mapreg_delete_str_db(int64 uid, const char *name, unsigned int index) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_mapreg_delete_str_db_pre > 0) { + bool (*preHookFunc) (int64 *uid, const char **name, unsigned int *index); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_delete_str_db_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapreg_delete_str_db_pre[hIndex].func; + retVal___ = preHookFunc(&uid, &name, &index); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mapreg.delete_str_db(uid, name, index); + } + if (HPMHooks.count.HP_mapreg_delete_str_db_post > 0) { + bool (*postHookFunc) (bool retVal___, int64 uid, const char *name, unsigned int index); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_delete_str_db_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapreg_delete_str_db_post[hIndex].func; + retVal___ = postHookFunc(retVal___, uid, name, index); + } + } + return retVal___; +} bool HP_mapreg_setregstr(int64 uid, const char *str) { int hIndex = 0; bool retVal___ = false; @@ -50778,6 +50834,58 @@ bool HP_mapreg_setregstr(int64 uid, const char *str) { } return retVal___; } +void HP_mapreg_load_num_db(void) { + int hIndex = 0; + if (HPMHooks.count.HP_mapreg_load_num_db_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_load_num_db_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapreg_load_num_db_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mapreg.load_num_db(); + } + if (HPMHooks.count.HP_mapreg_load_num_db_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_load_num_db_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapreg_load_num_db_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_mapreg_load_str_db(void) { + int hIndex = 0; + if (HPMHooks.count.HP_mapreg_load_str_db_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_load_str_db_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapreg_load_str_db_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mapreg.load_str_db(); + } + if (HPMHooks.count.HP_mapreg_load_str_db_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_load_str_db_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapreg_load_str_db_post[hIndex].func; + postHookFunc(); + } + } + return; +} void HP_mapreg_load(void) { int hIndex = 0; if (HPMHooks.count.HP_mapreg_load_pre > 0) { @@ -50804,6 +50912,58 @@ void HP_mapreg_load(void) { } return; } +void HP_mapreg_save_num_db(const char *name, unsigned int index, int value) { + int hIndex = 0; + if (HPMHooks.count.HP_mapreg_save_num_db_pre > 0) { + void (*preHookFunc) (const char **name, unsigned int *index, int *value); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_save_num_db_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapreg_save_num_db_pre[hIndex].func; + preHookFunc(&name, &index, &value); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mapreg.save_num_db(name, index, value); + } + if (HPMHooks.count.HP_mapreg_save_num_db_post > 0) { + void (*postHookFunc) (const char *name, unsigned int index, int value); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_save_num_db_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapreg_save_num_db_post[hIndex].func; + postHookFunc(name, index, value); + } + } + return; +} +void HP_mapreg_save_str_db(const char *name, unsigned int index, const char *value) { + int hIndex = 0; + if (HPMHooks.count.HP_mapreg_save_str_db_pre > 0) { + void (*preHookFunc) (const char **name, unsigned int *index, const char **value); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_save_str_db_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapreg_save_str_db_pre[hIndex].func; + preHookFunc(&name, &index, &value); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mapreg.save_str_db(name, index, value); + } + if (HPMHooks.count.HP_mapreg_save_str_db_post > 0) { + void (*postHookFunc) (const char *name, unsigned int index, const char *value); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_save_str_db_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapreg_save_str_db_post[hIndex].func; + postHookFunc(name, index, value); + } + } + return; +} void HP_mapreg_save(void) { int hIndex = 0; if (HPMHooks.count.HP_mapreg_save_pre > 0) { @@ -50916,6 +51076,85 @@ void HP_mapreg_reload(void) { } return; } +bool HP_mapreg_config_read_registry(const char *filename, const struct config_setting_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_mapreg_config_read_registry_pre > 0) { + bool (*preHookFunc) (const char **filename, const struct config_setting_t **config, bool *imported); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_config_read_registry_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapreg_config_read_registry_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mapreg.config_read_registry(filename, config, imported); + } + if (HPMHooks.count.HP_mapreg_config_read_registry_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_setting_t *config, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_config_read_registry_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapreg_config_read_registry_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +void HP_mapreg_final(void) { + int hIndex = 0; + if (HPMHooks.count.HP_mapreg_final_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_final_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapreg_final_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mapreg.final(); + } + if (HPMHooks.count.HP_mapreg_final_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_final_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapreg_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_mapreg_init(void) { + int hIndex = 0; + if (HPMHooks.count.HP_mapreg_init_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapreg_init_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mapreg.init(); + } + if (HPMHooks.count.HP_mapreg_init_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapreg_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} /* md5_interface */ void HP_md5_string(const char *string, char *output) { int hIndex = 0; |