From 77b72c7b82a1af205a58225b09e917b4593d770a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 6 Nov 2018 22:45:34 +0300 Subject: Update HPM hooks. --- src/plugins/HPMHooking/HPMHooking_login.Hooks.inc | 38 +++++++++++++++++++---- 1 file changed, 32 insertions(+), 6 deletions(-) (limited to 'src/plugins/HPMHooking/HPMHooking_login.Hooks.inc') diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 5e3d7b28d..4cf0e85ce 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -7177,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; @@ -7193,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___; @@ -7257,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; -- cgit v1.2.3-70-g09d2