summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHercules.ws <dev@herc.ws>2020-04-05 19:38:09 +0200
committerHerculesWSAPI <dev@herc.ws>2020-04-05 19:38:09 +0200
commite827fed09af22b18ffa54ca5dc9991eff464f7ab (patch)
treea9b6a3ceeacd9523b015753067cf7b01b0e54116
parent0c7baa39ae58eaf7f823f04a57247e1cc7ab604f (diff)
downloadhercules-e827fed09af22b18ffa54ca5dc9991eff464f7ab.tar.gz
hercules-e827fed09af22b18ffa54ca5dc9991eff464f7ab.tar.bz2
hercules-e827fed09af22b18ffa54ca5dc9991eff464f7ab.tar.xz
hercules-e827fed09af22b18ffa54ca5dc9991eff464f7ab.zip
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc8
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.Hooks.inc52
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc8
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.Hooks.inc52
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc8
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc52
10 files changed, 190 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 28f81b97f..f01d0250d 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -5830,6 +5830,10 @@ typedef int (*HPMHOOK_pre_npc_secure_timeout_timer) (int *tid, int64 *tick, int
typedef int (*HPMHOOK_post_npc_secure_timeout_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
#endif // MAP_NPC_H
#ifdef COMMON_NULLPO_H /* nullpo */
+typedef void (*HPMHOOK_pre_nullpo_init) (void);
+typedef void (*HPMHOOK_post_nullpo_init) (void);
+typedef void (*HPMHOOK_pre_nullpo_final) (void);
+typedef void (*HPMHOOK_post_nullpo_final) (void);
typedef void (*HPMHOOK_pre_nullpo_assert_report) (const char **file, int *line, const char **func, const char **targetname, const char **title);
typedef void (*HPMHOOK_post_nullpo_assert_report) (const char *file, int line, const char *func, const char *targetname, const char *title);
#endif // COMMON_NULLPO_H
diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
index 20f57dcb9..ab34a4f18 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
@@ -1308,6 +1308,10 @@ struct {
struct HPMHookPoint *HP_mutex_cond_signal_post;
struct HPMHookPoint *HP_mutex_cond_broadcast_pre;
struct HPMHookPoint *HP_mutex_cond_broadcast_post;
+ struct HPMHookPoint *HP_nullpo_init_pre;
+ struct HPMHookPoint *HP_nullpo_init_post;
+ struct HPMHookPoint *HP_nullpo_final_pre;
+ struct HPMHookPoint *HP_nullpo_final_post;
struct HPMHookPoint *HP_nullpo_assert_report_pre;
struct HPMHookPoint *HP_nullpo_assert_report_post;
struct HPMHookPoint *HP_packets_init_pre;
@@ -2933,6 +2937,10 @@ struct {
int HP_mutex_cond_signal_post;
int HP_mutex_cond_broadcast_pre;
int HP_mutex_cond_broadcast_post;
+ int HP_nullpo_init_pre;
+ int HP_nullpo_init_post;
+ int HP_nullpo_final_pre;
+ int HP_nullpo_final_post;
int HP_nullpo_assert_report_pre;
int HP_nullpo_assert_report_post;
int HP_packets_init_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
index e8e211f8b..238580b83 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
@@ -696,6 +696,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mutex->cond_signal, HP_mutex_cond_signal) },
{ HP_POP(mutex->cond_broadcast, HP_mutex_cond_broadcast) },
/* nullpo_interface */
+ { HP_POP(nullpo->init, HP_nullpo_init) },
+ { HP_POP(nullpo->final, HP_nullpo_final) },
{ HP_POP(nullpo->assert_report, HP_nullpo_assert_report) },
/* packets_interface */
{ HP_POP(packets->init, HP_packets_init) },
diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
index a022abb54..8c1dec681 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
@@ -17160,6 +17160,58 @@ void HP_mutex_cond_broadcast(struct cond_data *c) {
return;
}
/* nullpo_interface */
+void HP_nullpo_init(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_nullpo_init_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_nullpo_init_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.nullpo.init();
+ }
+ if (HPMHooks.count.HP_nullpo_init_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_nullpo_init_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_nullpo_final(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_nullpo_final_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_nullpo_final_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.nullpo.final();
+ }
+ if (HPMHooks.count.HP_nullpo_final_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_nullpo_final_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
void HP_nullpo_assert_report(const char *file, int line, const char *func, const char *targetname, const char *title) {
int hIndex = 0;
if (HPMHooks.count.HP_nullpo_assert_report_pre > 0) {
diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
index c638a1ef6..2875df334 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
@@ -520,6 +520,10 @@ struct {
struct HPMHookPoint *HP_mutex_cond_signal_post;
struct HPMHookPoint *HP_mutex_cond_broadcast_pre;
struct HPMHookPoint *HP_mutex_cond_broadcast_post;
+ struct HPMHookPoint *HP_nullpo_init_pre;
+ struct HPMHookPoint *HP_nullpo_init_post;
+ struct HPMHookPoint *HP_nullpo_final_pre;
+ struct HPMHookPoint *HP_nullpo_final_post;
struct HPMHookPoint *HP_nullpo_assert_report_pre;
struct HPMHookPoint *HP_nullpo_assert_report_post;
struct HPMHookPoint *HP_packets_init_pre;
@@ -1325,6 +1329,10 @@ struct {
int HP_mutex_cond_signal_post;
int HP_mutex_cond_broadcast_pre;
int HP_mutex_cond_broadcast_post;
+ int HP_nullpo_init_pre;
+ int HP_nullpo_init_post;
+ int HP_nullpo_final_pre;
+ int HP_nullpo_final_post;
int HP_nullpo_assert_report_pre;
int HP_nullpo_assert_report_post;
int HP_packets_init_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
index ef6081f41..61864325b 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
@@ -290,6 +290,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mutex->cond_signal, HP_mutex_cond_signal) },
{ HP_POP(mutex->cond_broadcast, HP_mutex_cond_broadcast) },
/* nullpo_interface */
+ { HP_POP(nullpo->init, HP_nullpo_init) },
+ { HP_POP(nullpo->final, HP_nullpo_final) },
{ HP_POP(nullpo->assert_report, HP_nullpo_assert_report) },
/* packets_interface */
{ HP_POP(packets->init, HP_packets_init) },
diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
index 20c709bce..1c1817276 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
@@ -6638,6 +6638,58 @@ void HP_mutex_cond_broadcast(struct cond_data *c) {
return;
}
/* nullpo_interface */
+void HP_nullpo_init(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_nullpo_init_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_nullpo_init_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.nullpo.init();
+ }
+ if (HPMHooks.count.HP_nullpo_init_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_nullpo_init_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_nullpo_final(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_nullpo_final_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_nullpo_final_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.nullpo.final();
+ }
+ if (HPMHooks.count.HP_nullpo_final_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_nullpo_final_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
void HP_nullpo_assert_report(const char *file, int line, const char *func, const char *targetname, const char *title) {
int hIndex = 0;
if (HPMHooks.count.HP_nullpo_assert_report_pre > 0) {
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index f94606bab..24635d7e3 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -4420,6 +4420,10 @@ struct {
struct HPMHookPoint *HP_npc_questinfo_clear_post;
struct HPMHookPoint *HP_npc_secure_timeout_timer_pre;
struct HPMHookPoint *HP_npc_secure_timeout_timer_post;
+ struct HPMHookPoint *HP_nullpo_init_pre;
+ struct HPMHookPoint *HP_nullpo_init_post;
+ struct HPMHookPoint *HP_nullpo_final_pre;
+ struct HPMHookPoint *HP_nullpo_final_post;
struct HPMHookPoint *HP_nullpo_assert_report_pre;
struct HPMHookPoint *HP_nullpo_assert_report_post;
struct HPMHookPoint *HP_packets_init_pre;
@@ -11295,6 +11299,10 @@ struct {
int HP_npc_questinfo_clear_post;
int HP_npc_secure_timeout_timer_pre;
int HP_npc_secure_timeout_timer_post;
+ int HP_nullpo_init_pre;
+ int HP_nullpo_init_post;
+ int HP_nullpo_final_pre;
+ int HP_nullpo_final_post;
int HP_nullpo_assert_report_pre;
int HP_nullpo_assert_report_post;
int HP_packets_init_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index a360b3f53..cc8d59844 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2263,6 +2263,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(npc->questinfo_clear, HP_npc_questinfo_clear) },
{ HP_POP(npc->secure_timeout_timer, HP_npc_secure_timeout_timer) },
/* nullpo_interface */
+ { HP_POP(nullpo->init, HP_nullpo_init) },
+ { HP_POP(nullpo->final, HP_nullpo_final) },
{ HP_POP(nullpo->assert_report, HP_nullpo_assert_report) },
/* packets_interface */
{ HP_POP(packets->init, HP_packets_init) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 592279cc4..a9ed12c31 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -58718,6 +58718,58 @@ int HP_npc_secure_timeout_timer(int tid, int64 tick, int id, intptr_t data) {
return retVal___;
}
/* nullpo_interface */
+void HP_nullpo_init(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_nullpo_init_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_nullpo_init_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.nullpo.init();
+ }
+ if (HPMHooks.count.HP_nullpo_init_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_nullpo_init_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_nullpo_final(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_nullpo_final_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_nullpo_final_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.nullpo.final();
+ }
+ if (HPMHooks.count.HP_nullpo_final_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_nullpo_final_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
void HP_nullpo_assert_report(const char *file, int line, const char *func, const char *targetname, const char *title) {
int hIndex = 0;
if (HPMHooks.count.HP_nullpo_assert_report_pre > 0) {