summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-11-15 04:01:03 +0100
committerGitHub <noreply@github.com>2018-11-15 04:01:03 +0100
commit47d6523817646f2d4f081b93ec44a971a01fce25 (patch)
tree39f5f62367fed1efe1dd734a2f3a588f2e44a9f4 /src/plugins
parent3b93418544f84f142ea2a6e2bcdf1621267ff989 (diff)
parent1f237031a63567d8c96bca4a28ab9557ebe1459e (diff)
downloadhercules-47d6523817646f2d4f081b93ec44a971a01fce25.tar.gz
hercules-47d6523817646f2d4f081b93ec44a971a01fce25.tar.bz2
hercules-47d6523817646f2d4f081b93ec44a971a01fce25.tar.xz
hercules-47d6523817646f2d4f081b93ec44a971a01fce25.zip
Merge pull request #2321 from 4144/packetlen
Add complete packet len table
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/HPMHooking.c1
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc16
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc21
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc6
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.Hooks.inc143
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.sources.inc1
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc21
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc6
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.Hooks.inc143
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.sources.inc1
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc21
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc6
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc143
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.sources.inc1
14 files changed, 510 insertions, 20 deletions
diff --git a/src/plugins/HPMHooking.c b/src/plugins/HPMHooking.c
index b477cb5c3..64337d8f4 100644
--- a/src/plugins/HPMHooking.c
+++ b/src/plugins/HPMHooking.c
@@ -25,6 +25,7 @@
#include "common/memmgr.h"
#include "common/mmo.h"
#include "common/socket.h"
+#include "common/packets.h"
PRAGMA_GCC5(GCC diagnostic push)
PRAGMA_GCC5(GCC diagnostic ignored "-Wdiscarded-qualifiers")
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 0a70f6d1a..7139bfa6c 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -5675,6 +5675,16 @@ typedef int (*HPMHOOK_post_npc_secure_timeout_timer) (int retVal___, int tid, in
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
+#ifdef COMMON_PACKETS_H /* packets */
+typedef void (*HPMHOOK_pre_packets_init) (void);
+typedef void (*HPMHOOK_post_packets_init) (void);
+typedef void (*HPMHOOK_pre_packets_final) (void);
+typedef void (*HPMHOOK_post_packets_final) (void);
+typedef void (*HPMHOOK_pre_packets_addLens) (void);
+typedef void (*HPMHOOK_post_packets_addLens) (void);
+typedef void (*HPMHOOK_pre_packets_addLen) (int *id, int *len);
+typedef void (*HPMHOOK_post_packets_addLen) (int id, int len);
+#endif // COMMON_PACKETS_H
#ifdef MAP_PARTY_H /* party */
typedef void (*HPMHOOK_pre_party_init) (bool *minimal);
typedef void (*HPMHOOK_post_party_init) (bool minimal);
@@ -7454,12 +7464,14 @@ typedef int (*HPMHOOK_pre_sockt_realloc_fifo) (int *fd, unsigned int *rfifo_size
typedef int (*HPMHOOK_post_sockt_realloc_fifo) (int retVal___, int fd, unsigned int rfifo_size, unsigned int wfifo_size);
typedef int (*HPMHOOK_pre_sockt_realloc_writefifo) (int *fd, size_t *addition);
typedef int (*HPMHOOK_post_sockt_realloc_writefifo) (int retVal___, int fd, size_t addition);
-typedef int (*HPMHOOK_pre_sockt_wfifoset) (int *fd, size_t *len);
-typedef int (*HPMHOOK_post_sockt_wfifoset) (int retVal___, int fd, size_t len);
+typedef int (*HPMHOOK_pre_sockt_wfifoset) (int *fd, size_t *len, bool *validate);
+typedef int (*HPMHOOK_post_sockt_wfifoset) (int retVal___, int fd, size_t len, bool validate);
typedef int (*HPMHOOK_pre_sockt_rfifoskip) (int *fd, size_t *len);
typedef int (*HPMHOOK_post_sockt_rfifoskip) (int retVal___, int fd, size_t len);
typedef void (*HPMHOOK_pre_sockt_close) (int *fd);
typedef void (*HPMHOOK_post_sockt_close) (int fd);
+typedef void (*HPMHOOK_pre_sockt_validateWfifo) (int *fd, size_t *len);
+typedef void (*HPMHOOK_post_sockt_validateWfifo) (int fd, size_t len);
typedef bool (*HPMHOOK_pre_sockt_session_is_valid) (int *fd);
typedef bool (*HPMHOOK_post_sockt_session_is_valid) (bool retVal___, int fd);
typedef bool (*HPMHOOK_pre_sockt_session_is_active) (int *fd);
diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
index 2b0291453..839be6ebc 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
@@ -1322,6 +1322,14 @@ struct {
struct HPMHookPoint *HP_mutex_cond_broadcast_post;
struct HPMHookPoint *HP_nullpo_assert_report_pre;
struct HPMHookPoint *HP_nullpo_assert_report_post;
+ struct HPMHookPoint *HP_packets_init_pre;
+ struct HPMHookPoint *HP_packets_init_post;
+ struct HPMHookPoint *HP_packets_final_pre;
+ struct HPMHookPoint *HP_packets_final_post;
+ struct HPMHookPoint *HP_packets_addLens_pre;
+ struct HPMHookPoint *HP_packets_addLens_post;
+ struct HPMHookPoint *HP_packets_addLen_pre;
+ struct HPMHookPoint *HP_packets_addLen_post;
struct HPMHookPoint *HP_pincode_handle_pre;
struct HPMHookPoint *HP_pincode_handle_post;
struct HPMHookPoint *HP_pincode_decrypt_pre;
@@ -1400,6 +1408,8 @@ struct {
struct HPMHookPoint *HP_sockt_rfifoskip_post;
struct HPMHookPoint *HP_sockt_close_pre;
struct HPMHookPoint *HP_sockt_close_post;
+ struct HPMHookPoint *HP_sockt_validateWfifo_pre;
+ struct HPMHookPoint *HP_sockt_validateWfifo_post;
struct HPMHookPoint *HP_sockt_session_is_valid_pre;
struct HPMHookPoint *HP_sockt_session_is_valid_post;
struct HPMHookPoint *HP_sockt_session_is_active_pre;
@@ -2945,6 +2955,14 @@ struct {
int HP_mutex_cond_broadcast_post;
int HP_nullpo_assert_report_pre;
int HP_nullpo_assert_report_post;
+ int HP_packets_init_pre;
+ int HP_packets_init_post;
+ int HP_packets_final_pre;
+ int HP_packets_final_post;
+ int HP_packets_addLens_pre;
+ int HP_packets_addLens_post;
+ int HP_packets_addLen_pre;
+ int HP_packets_addLen_post;
int HP_pincode_handle_pre;
int HP_pincode_handle_post;
int HP_pincode_decrypt_pre;
@@ -3023,6 +3041,8 @@ struct {
int HP_sockt_rfifoskip_post;
int HP_sockt_close_pre;
int HP_sockt_close_post;
+ int HP_sockt_validateWfifo_pre;
+ int HP_sockt_validateWfifo_post;
int HP_sockt_session_is_valid_pre;
int HP_sockt_session_is_valid_post;
int HP_sockt_session_is_active_pre;
@@ -3301,6 +3321,7 @@ struct {
struct md5_interface md5;
struct mutex_interface mutex;
struct nullpo_interface nullpo;
+ struct packets_interface packets;
struct pincode_interface pincode;
struct rnd_interface rnd;
struct showmsg_interface showmsg;
diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
index cb6ae1bb8..101dddd53 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
@@ -703,6 +703,11 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mutex->cond_broadcast, HP_mutex_cond_broadcast) },
/* nullpo_interface */
{ HP_POP(nullpo->assert_report, HP_nullpo_assert_report) },
+/* packets_interface */
+ { HP_POP(packets->init, HP_packets_init) },
+ { HP_POP(packets->final, HP_packets_final) },
+ { HP_POP(packets->addLens, HP_packets_addLens) },
+ { HP_POP(packets->addLen, HP_packets_addLen) },
/* pincode_interface */
{ HP_POP(pincode->handle, HP_pincode_handle) },
{ HP_POP(pincode->decrypt, HP_pincode_decrypt) },
@@ -746,6 +751,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sockt->wfifoset, HP_sockt_wfifoset) },
{ HP_POP(sockt->rfifoskip, HP_sockt_rfifoskip) },
{ HP_POP(sockt->close, HP_sockt_close) },
+ { HP_POP(sockt->validateWfifo, HP_sockt_validateWfifo) },
{ HP_POP(sockt->session_is_valid, HP_sockt_session_is_valid) },
{ HP_POP(sockt->session_is_active, HP_sockt_session_is_active) },
{ HP_POP(sockt->flush, HP_sockt_flush) },
diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
index 767c7d24e..df39880b6 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
@@ -17357,6 +17357,111 @@ void HP_nullpo_assert_report(const char *file, int line, const char *func, const
}
return;
}
+/* packets_interface */
+void HP_packets_init(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_packets_init_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_packets_init_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.packets.init();
+ }
+ if (HPMHooks.count.HP_packets_init_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_packets_init_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_packets_final(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_packets_final_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_packets_final_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.packets.final();
+ }
+ if (HPMHooks.count.HP_packets_final_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_packets_final_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_packets_addLens(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_packets_addLens_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_addLens_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_packets_addLens_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.packets.addLens();
+ }
+ if (HPMHooks.count.HP_packets_addLens_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_addLens_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_packets_addLens_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_packets_addLen(int id, int len) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_packets_addLen_pre > 0) {
+ void (*preHookFunc) (int *id, int *len);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_addLen_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_packets_addLen_pre[hIndex].func;
+ preHookFunc(&id, &len);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.packets.addLen(id, len);
+ }
+ if (HPMHooks.count.HP_packets_addLen_post > 0) {
+ void (*postHookFunc) (int id, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_addLen_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_packets_addLen_post[hIndex].func;
+ postHookFunc(id, len);
+ }
+ }
+ return;
+}
/* pincode_interface */
void HP_pincode_handle(int fd, struct char_session_data *sd) {
int hIndex = 0;
@@ -18317,15 +18422,15 @@ int HP_sockt_realloc_writefifo(int fd, size_t addition) {
}
return retVal___;
}
-int HP_sockt_wfifoset(int fd, size_t len) {
+int HP_sockt_wfifoset(int fd, size_t len, bool validate) {
int hIndex = 0;
int retVal___ = 0;
if (HPMHooks.count.HP_sockt_wfifoset_pre > 0) {
- int (*preHookFunc) (int *fd, size_t *len);
+ int (*preHookFunc) (int *fd, size_t *len, bool *validate);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_wfifoset_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &len);
+ retVal___ = preHookFunc(&fd, &len, &validate);
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -18333,13 +18438,13 @@ int HP_sockt_wfifoset(int fd, size_t len) {
}
}
{
- retVal___ = HPMHooks.source.sockt.wfifoset(fd, len);
+ retVal___ = HPMHooks.source.sockt.wfifoset(fd, len, validate);
}
if (HPMHooks.count.HP_sockt_wfifoset_post > 0) {
- int (*postHookFunc) (int retVal___, int fd, size_t len);
+ int (*postHookFunc) (int retVal___, int fd, size_t len, bool validate);
for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_wfifoset_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, fd, len);
+ retVal___ = postHookFunc(retVal___, fd, len, validate);
}
}
return retVal___;
@@ -18397,6 +18502,32 @@ void HP_sockt_close(int fd) {
}
return;
}
+void HP_sockt_validateWfifo(int fd, size_t len) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_sockt_validateWfifo_pre > 0) {
+ void (*preHookFunc) (int *fd, size_t *len);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_validateWfifo_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_sockt_validateWfifo_pre[hIndex].func;
+ preHookFunc(&fd, &len);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.sockt.validateWfifo(fd, len);
+ }
+ if (HPMHooks.count.HP_sockt_validateWfifo_post > 0) {
+ void (*postHookFunc) (int fd, size_t len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_validateWfifo_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_sockt_validateWfifo_post[hIndex].func;
+ postHookFunc(fd, len);
+ }
+ }
+ return;
+}
bool HP_sockt_session_is_valid(int fd) {
int hIndex = 0;
bool retVal___ = false;
diff --git a/src/plugins/HPMHooking/HPMHooking_char.sources.inc b/src/plugins/HPMHooking/HPMHooking_char.sources.inc
index 0d69cd755..7fb575afe 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.sources.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.sources.inc
@@ -54,6 +54,7 @@ HPMHooks.source.mapindex = *mapindex;
HPMHooks.source.md5 = *md5;
HPMHooks.source.mutex = *mutex;
HPMHooks.source.nullpo = *nullpo;
+HPMHooks.source.packets = *packets;
HPMHooks.source.pincode = *pincode;
HPMHooks.source.rnd = *rnd;
HPMHooks.source.showmsg = *showmsg;
diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
index 5300ca3a6..89f201c09 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
@@ -512,6 +512,14 @@ struct {
struct HPMHookPoint *HP_mutex_cond_broadcast_post;
struct HPMHookPoint *HP_nullpo_assert_report_pre;
struct HPMHookPoint *HP_nullpo_assert_report_post;
+ struct HPMHookPoint *HP_packets_init_pre;
+ struct HPMHookPoint *HP_packets_init_post;
+ struct HPMHookPoint *HP_packets_final_pre;
+ struct HPMHookPoint *HP_packets_final_post;
+ struct HPMHookPoint *HP_packets_addLens_pre;
+ struct HPMHookPoint *HP_packets_addLens_post;
+ struct HPMHookPoint *HP_packets_addLen_pre;
+ struct HPMHookPoint *HP_packets_addLen_post;
struct HPMHookPoint *HP_rnd_init_pre;
struct HPMHookPoint *HP_rnd_init_post;
struct HPMHookPoint *HP_rnd_final_pre;
@@ -558,6 +566,8 @@ struct {
struct HPMHookPoint *HP_sockt_rfifoskip_post;
struct HPMHookPoint *HP_sockt_close_pre;
struct HPMHookPoint *HP_sockt_close_post;
+ struct HPMHookPoint *HP_sockt_validateWfifo_pre;
+ struct HPMHookPoint *HP_sockt_validateWfifo_post;
struct HPMHookPoint *HP_sockt_session_is_valid_pre;
struct HPMHookPoint *HP_sockt_session_is_valid_post;
struct HPMHookPoint *HP_sockt_session_is_active_pre;
@@ -1293,6 +1303,14 @@ struct {
int HP_mutex_cond_broadcast_post;
int HP_nullpo_assert_report_pre;
int HP_nullpo_assert_report_post;
+ int HP_packets_init_pre;
+ int HP_packets_init_post;
+ int HP_packets_final_pre;
+ int HP_packets_final_post;
+ int HP_packets_addLens_pre;
+ int HP_packets_addLens_post;
+ int HP_packets_addLen_pre;
+ int HP_packets_addLen_post;
int HP_rnd_init_pre;
int HP_rnd_init_post;
int HP_rnd_final_pre;
@@ -1339,6 +1357,8 @@ struct {
int HP_sockt_rfifoskip_post;
int HP_sockt_close_pre;
int HP_sockt_close_post;
+ int HP_sockt_validateWfifo_pre;
+ int HP_sockt_validateWfifo_post;
int HP_sockt_session_is_valid_pre;
int HP_sockt_session_is_valid_post;
int HP_sockt_session_is_active_pre;
@@ -1605,6 +1625,7 @@ struct {
struct md5_interface md5;
struct mutex_interface mutex;
struct nullpo_interface nullpo;
+ struct packets_interface packets;
struct rnd_interface rnd;
struct showmsg_interface showmsg;
struct socket_interface sockt;
diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
index 6eb2e8121..f50b7666d 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
@@ -286,6 +286,11 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mutex->cond_broadcast, HP_mutex_cond_broadcast) },
/* nullpo_interface */
{ HP_POP(nullpo->assert_report, HP_nullpo_assert_report) },
+/* packets_interface */
+ { HP_POP(packets->init, HP_packets_init) },
+ { HP_POP(packets->final, HP_packets_final) },
+ { HP_POP(packets->addLens, HP_packets_addLens) },
+ { HP_POP(packets->addLen, HP_packets_addLen) },
/* rnd_interface */
{ HP_POP(rnd->init, HP_rnd_init) },
{ HP_POP(rnd->final, HP_rnd_final) },
@@ -312,6 +317,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sockt->wfifoset, HP_sockt_wfifoset) },
{ HP_POP(sockt->rfifoskip, HP_sockt_rfifoskip) },
{ HP_POP(sockt->close, HP_sockt_close) },
+ { HP_POP(sockt->validateWfifo, HP_sockt_validateWfifo) },
{ HP_POP(sockt->session_is_valid, HP_sockt_session_is_valid) },
{ HP_POP(sockt->session_is_active, HP_sockt_session_is_active) },
{ HP_POP(sockt->flush, HP_sockt_flush) },
diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
index e432da70d..4cf0e85ce 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
@@ -6532,6 +6532,111 @@ void HP_nullpo_assert_report(const char *file, int line, const char *func, const
}
return;
}
+/* packets_interface */
+void HP_packets_init(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_packets_init_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_packets_init_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.packets.init();
+ }
+ if (HPMHooks.count.HP_packets_init_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_packets_init_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_packets_final(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_packets_final_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_packets_final_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.packets.final();
+ }
+ if (HPMHooks.count.HP_packets_final_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_packets_final_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_packets_addLens(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_packets_addLens_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_addLens_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_packets_addLens_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.packets.addLens();
+ }
+ if (HPMHooks.count.HP_packets_addLens_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_addLens_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_packets_addLens_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_packets_addLen(int id, int len) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_packets_addLen_pre > 0) {
+ void (*preHookFunc) (int *id, int *len);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_addLen_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_packets_addLen_pre[hIndex].func;
+ preHookFunc(&id, &len);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.packets.addLen(id, len);
+ }
+ if (HPMHooks.count.HP_packets_addLen_post > 0) {
+ void (*postHookFunc) (int id, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_addLen_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_packets_addLen_post[hIndex].func;
+ postHookFunc(id, len);
+ }
+ }
+ return;
+}
/* rnd_interface */
void HP_rnd_init(void) {
int hIndex = 0;
@@ -7072,15 +7177,15 @@ int HP_sockt_realloc_writefifo(int fd, size_t addition) {
}
return retVal___;
}
-int HP_sockt_wfifoset(int fd, size_t len) {
+int HP_sockt_wfifoset(int fd, size_t len, bool validate) {
int hIndex = 0;
int retVal___ = 0;
if (HPMHooks.count.HP_sockt_wfifoset_pre > 0) {
- int (*preHookFunc) (int *fd, size_t *len);
+ int (*preHookFunc) (int *fd, size_t *len, bool *validate);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_wfifoset_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &len);
+ retVal___ = preHookFunc(&fd, &len, &validate);
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -7088,13 +7193,13 @@ int HP_sockt_wfifoset(int fd, size_t len) {
}
}
{
- retVal___ = HPMHooks.source.sockt.wfifoset(fd, len);
+ retVal___ = HPMHooks.source.sockt.wfifoset(fd, len, validate);
}
if (HPMHooks.count.HP_sockt_wfifoset_post > 0) {
- int (*postHookFunc) (int retVal___, int fd, size_t len);
+ int (*postHookFunc) (int retVal___, int fd, size_t len, bool validate);
for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_wfifoset_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, fd, len);
+ retVal___ = postHookFunc(retVal___, fd, len, validate);
}
}
return retVal___;
@@ -7152,6 +7257,32 @@ void HP_sockt_close(int fd) {
}
return;
}
+void HP_sockt_validateWfifo(int fd, size_t len) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_sockt_validateWfifo_pre > 0) {
+ void (*preHookFunc) (int *fd, size_t *len);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_validateWfifo_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_sockt_validateWfifo_pre[hIndex].func;
+ preHookFunc(&fd, &len);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.sockt.validateWfifo(fd, len);
+ }
+ if (HPMHooks.count.HP_sockt_validateWfifo_post > 0) {
+ void (*postHookFunc) (int fd, size_t len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_validateWfifo_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_sockt_validateWfifo_post[hIndex].func;
+ postHookFunc(fd, len);
+ }
+ }
+ return;
+}
bool HP_sockt_session_is_valid(int fd) {
int hIndex = 0;
bool retVal___ = false;
diff --git a/src/plugins/HPMHooking/HPMHooking_login.sources.inc b/src/plugins/HPMHooking/HPMHooking_login.sources.inc
index 78c506043..552aad578 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.sources.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.sources.inc
@@ -42,6 +42,7 @@ HPMHooks.source.loginlog = *loginlog;
HPMHooks.source.md5 = *md5;
HPMHooks.source.mutex = *mutex;
HPMHooks.source.nullpo = *nullpo;
+HPMHooks.source.packets = *packets;
HPMHooks.source.rnd = *rnd;
HPMHooks.source.showmsg = *showmsg;
HPMHooks.source.sockt = *sockt;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 5573e4a14..b1dfbed80 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -4250,6 +4250,14 @@ struct {
struct HPMHookPoint *HP_npc_secure_timeout_timer_post;
struct HPMHookPoint *HP_nullpo_assert_report_pre;
struct HPMHookPoint *HP_nullpo_assert_report_post;
+ struct HPMHookPoint *HP_packets_init_pre;
+ struct HPMHookPoint *HP_packets_init_post;
+ struct HPMHookPoint *HP_packets_final_pre;
+ struct HPMHookPoint *HP_packets_final_post;
+ struct HPMHookPoint *HP_packets_addLens_pre;
+ struct HPMHookPoint *HP_packets_addLens_post;
+ struct HPMHookPoint *HP_packets_addLen_pre;
+ struct HPMHookPoint *HP_packets_addLen_post;
struct HPMHookPoint *HP_party_init_pre;
struct HPMHookPoint *HP_party_init_post;
struct HPMHookPoint *HP_party_final_pre;
@@ -5974,6 +5982,8 @@ struct {
struct HPMHookPoint *HP_sockt_rfifoskip_post;
struct HPMHookPoint *HP_sockt_close_pre;
struct HPMHookPoint *HP_sockt_close_post;
+ struct HPMHookPoint *HP_sockt_validateWfifo_pre;
+ struct HPMHookPoint *HP_sockt_validateWfifo_post;
struct HPMHookPoint *HP_sockt_session_is_valid_pre;
struct HPMHookPoint *HP_sockt_session_is_valid_post;
struct HPMHookPoint *HP_sockt_session_is_active_pre;
@@ -10859,6 +10869,14 @@ struct {
int HP_npc_secure_timeout_timer_post;
int HP_nullpo_assert_report_pre;
int HP_nullpo_assert_report_post;
+ int HP_packets_init_pre;
+ int HP_packets_init_post;
+ int HP_packets_final_pre;
+ int HP_packets_final_post;
+ int HP_packets_addLens_pre;
+ int HP_packets_addLens_post;
+ int HP_packets_addLen_pre;
+ int HP_packets_addLen_post;
int HP_party_init_pre;
int HP_party_init_post;
int HP_party_final_pre;
@@ -12583,6 +12601,8 @@ struct {
int HP_sockt_rfifoskip_post;
int HP_sockt_close_pre;
int HP_sockt_close_post;
+ int HP_sockt_validateWfifo_pre;
+ int HP_sockt_validateWfifo_post;
int HP_sockt_session_is_valid_pre;
int HP_sockt_session_is_valid_post;
int HP_sockt_session_is_active_pre;
@@ -13284,6 +13304,7 @@ struct {
struct npc_chat_interface npc_chat;
struct npc_interface npc;
struct nullpo_interface nullpo;
+ struct packets_interface packets;
struct party_interface party;
struct path_interface path;
struct pc_groups_interface pcg;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 601441a61..378eb77eb 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2178,6 +2178,11 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(npc->secure_timeout_timer, HP_npc_secure_timeout_timer) },
/* nullpo_interface */
{ HP_POP(nullpo->assert_report, HP_nullpo_assert_report) },
+/* packets_interface */
+ { HP_POP(packets->init, HP_packets_init) },
+ { HP_POP(packets->final, HP_packets_final) },
+ { HP_POP(packets->addLens, HP_packets_addLens) },
+ { HP_POP(packets->addLen, HP_packets_addLen) },
/* party_interface */
{ HP_POP(party->init, HP_party_init) },
{ HP_POP(party->final, HP_party_final) },
@@ -3054,6 +3059,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sockt->wfifoset, HP_sockt_wfifoset) },
{ HP_POP(sockt->rfifoskip, HP_sockt_rfifoskip) },
{ HP_POP(sockt->close, HP_sockt_close) },
+ { HP_POP(sockt->validateWfifo, HP_sockt_validateWfifo) },
{ HP_POP(sockt->session_is_valid, HP_sockt_session_is_valid) },
{ HP_POP(sockt->session_is_active, HP_sockt_session_is_active) },
{ HP_POP(sockt->flush, HP_sockt_flush) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 7a75f57e2..db191064c 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -56477,6 +56477,111 @@ void HP_nullpo_assert_report(const char *file, int line, const char *func, const
}
return;
}
+/* packets_interface */
+void HP_packets_init(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_packets_init_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_packets_init_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.packets.init();
+ }
+ if (HPMHooks.count.HP_packets_init_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_packets_init_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_packets_final(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_packets_final_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_packets_final_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.packets.final();
+ }
+ if (HPMHooks.count.HP_packets_final_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_packets_final_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_packets_addLens(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_packets_addLens_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_addLens_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_packets_addLens_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.packets.addLens();
+ }
+ if (HPMHooks.count.HP_packets_addLens_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_addLens_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_packets_addLens_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_packets_addLen(int id, int len) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_packets_addLen_pre > 0) {
+ void (*preHookFunc) (int *id, int *len);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_addLen_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_packets_addLen_pre[hIndex].func;
+ preHookFunc(&id, &len);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.packets.addLen(id, len);
+ }
+ if (HPMHooks.count.HP_packets_addLen_post > 0) {
+ void (*postHookFunc) (int id, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_packets_addLen_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_packets_addLen_post[hIndex].func;
+ postHookFunc(id, len);
+ }
+ }
+ return;
+}
/* party_interface */
void HP_party_init(bool minimal) {
int hIndex = 0;
@@ -79839,15 +79944,15 @@ int HP_sockt_realloc_writefifo(int fd, size_t addition) {
}
return retVal___;
}
-int HP_sockt_wfifoset(int fd, size_t len) {
+int HP_sockt_wfifoset(int fd, size_t len, bool validate) {
int hIndex = 0;
int retVal___ = 0;
if (HPMHooks.count.HP_sockt_wfifoset_pre > 0) {
- int (*preHookFunc) (int *fd, size_t *len);
+ int (*preHookFunc) (int *fd, size_t *len, bool *validate);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_wfifoset_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &len);
+ retVal___ = preHookFunc(&fd, &len, &validate);
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -79855,13 +79960,13 @@ int HP_sockt_wfifoset(int fd, size_t len) {
}
}
{
- retVal___ = HPMHooks.source.sockt.wfifoset(fd, len);
+ retVal___ = HPMHooks.source.sockt.wfifoset(fd, len, validate);
}
if (HPMHooks.count.HP_sockt_wfifoset_post > 0) {
- int (*postHookFunc) (int retVal___, int fd, size_t len);
+ int (*postHookFunc) (int retVal___, int fd, size_t len, bool validate);
for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_wfifoset_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, fd, len);
+ retVal___ = postHookFunc(retVal___, fd, len, validate);
}
}
return retVal___;
@@ -79919,6 +80024,32 @@ void HP_sockt_close(int fd) {
}
return;
}
+void HP_sockt_validateWfifo(int fd, size_t len) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_sockt_validateWfifo_pre > 0) {
+ void (*preHookFunc) (int *fd, size_t *len);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_validateWfifo_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_sockt_validateWfifo_pre[hIndex].func;
+ preHookFunc(&fd, &len);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.sockt.validateWfifo(fd, len);
+ }
+ if (HPMHooks.count.HP_sockt_validateWfifo_post > 0) {
+ void (*postHookFunc) (int fd, size_t len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_validateWfifo_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_sockt_validateWfifo_post[hIndex].func;
+ postHookFunc(fd, len);
+ }
+ }
+ return;
+}
bool HP_sockt_session_is_valid(int fd) {
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 151a5d8a1..9d5390bb4 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.sources.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.sources.inc
@@ -65,6 +65,7 @@ HPMHooks.source.mutex = *mutex;
HPMHooks.source.npc_chat = *npc_chat;
HPMHooks.source.npc = *npc;
HPMHooks.source.nullpo = *nullpo;
+HPMHooks.source.packets = *packets;
HPMHooks.source.party = *party;
HPMHooks.source.path = *path;
HPMHooks.source.pcg = *pcg;