feat: Add missing cleanup functions various iidx hook modules

Summary:

Test Plan:
This commit is contained in:
icex2 2024-08-15 13:24:43 +02:00
parent f5ed7f5231
commit 51f3b07acf
18 changed files with 93 additions and 1 deletions

View File

@ -64,5 +64,11 @@ static NTSTATUS NTAPI my_RtlMultiByteToUnicodeN(
void acp_hook_init(void)
{
hook_table_apply(NULL, "ntdll.dll", acp_hook_syms, lengthof(acp_hook_syms));
log_info("ACP Hook enabled");
log_info("Inserted ACP hook");
}
void acp_hook_fini()
{
hook_table_revert(NULL, "ntdll.dll", acp_hook_syms, lengthof(acp_hook_syms));
log_info("Removed ACP hook");
}

View File

@ -3,4 +3,6 @@
void acp_hook_init(void);
void acp_hook_fini();
#endif

View File

@ -117,6 +117,16 @@ void adapter_hook_init(void)
{
hook_table_apply(
NULL, "iphlpapi.dll", adapter_hook_syms, lengthof(adapter_hook_syms));
log_info("Inserted adapter hooks");
}
void adapter_hook_fini()
{
hook_table_revert(
NULL, "iphlpapi.dll", adapter_hook_syms, lengthof(adapter_hook_syms));
log_info("Removed adapter hooks");
}
void adapter_hook_override(const char *adapter_address)

View File

@ -7,6 +7,8 @@
*/
void adapter_hook_init(void);
void adapter_hook_fini();
/**
* Uses the provided address to try and match a network adapter.
* This adapter is then returned as the only adapter.

View File

@ -361,3 +361,14 @@ void hook_setupapi_init(const struct hook_setupapi_data *data)
log_info(
"Hooked setupapi for %s, %s", data->device_path, data->device_desc);
}
void hook_setupapi_fini()
{
hook_table_revert(
NULL, "setupapi.dll", setupapi_hook_syms, lengthof(setupapi_hook_syms));
log_info(
"Removed hooks setupapi for %s, %s", hook_setupapi_data->device_path, hook_setupapi_data->device_desc);
hook_setupapi_data = NULL;
}

View File

@ -15,4 +15,6 @@ struct hook_setupapi_data {
void hook_setupapi_init(const struct hook_setupapi_data *data);
void hook_setupapi_fini();
#endif

View File

@ -31,3 +31,11 @@ void iidxhook_util_clock_hook_init(void)
log_info("Inserted clock hooks");
}
void iidxhook_util_clock_hook_fini()
{
hook_table_revert(
NULL, "kernel32.dll", clock_hook_syms, lengthof(clock_hook_syms));
log_info("Removed clock hooks");
}

View File

@ -8,4 +8,6 @@
*/
void iidxhook_util_clock_hook_init(void);
void iidxhook_util_clock_hook_fini();
#endif

View File

@ -120,6 +120,14 @@ void eamuse_hook_init(void)
log_info("Inserted eamuse hooks");
}
void eamuse_hook_fini()
{
hook_table_revert(
NULL, "ws2_32.dll", eamuse_hook_syms, lengthof(eamuse_hook_syms));
log_info("Removed eamuse hooks");
}
void eamuse_set_addr(const struct net_addr *addr)
{
char *tmp_str;

View File

@ -9,6 +9,8 @@
*/
void eamuse_hook_init(void);
void eamuse_hook_fini();
/**
* Set a net_addr to a eamuse server for the game to connect to.
*

View File

@ -81,3 +81,11 @@ void effector_hook_init(void)
log_info("Inserted rteffect hooks");
}
void effector_hook_fini()
{
hook_table_revert(
NULL, "rteffect.dll", effector_hook_syms, lengthof(effector_hook_syms));
log_info("Removed rteffect hooks");
}

View File

@ -8,4 +8,6 @@
*/
void effector_hook_init(void);
void effector_hook_fini();
#endif

View File

@ -100,6 +100,14 @@ void settings_hook_init(void)
log_info("Inserted settings hooks, settings path: %s", settings_path);
}
void settings_hook_fini()
{
hook_table_revert(
NULL, "kernel32.dll", settings_hook_syms, lengthof(settings_hook_syms));
log_info("Removed settings hooks for settings path: %s", settings_path);
}
void settings_hook_set_path(const char *path)
{
size_t len;

View File

@ -12,6 +12,8 @@
*/
void settings_hook_init(void);
void settings_hook_fini();
/**
* Change the path where settings file are stored.
*

View File

@ -232,3 +232,10 @@ void ezusb_mon_hook_init(void)
log_info("Inserted ezusb mon hooks");
}
void ezusb_mon_hook_fini()
{
hook_table_revert(NULL, "ezusb.dll", ezusb_mon_hook_syms, lengthof(ezusb_mon_hook_syms));
log_info("Removed ezusb mon hooks");
}

View File

@ -9,4 +9,6 @@
*/
void ezusb_mon_hook_init(void);
void ezusb_mon_hook_fini();
#endif

View File

@ -49,3 +49,11 @@ void ezusb_log_hook_init(void)
log_info("Inserted ezusb log hooks");
}
void ezusb_log_hook_fini()
{
hook_table_revert(
NULL, "user32.dll", ezusb_log_hook_syms, lengthof(ezusb_log_hook_syms));
log_info("Removed ezusb log hooks");
}

View File

@ -7,4 +7,6 @@
*/
void ezusb_log_hook_init(void);
void ezusb_log_hook_fini();
#endif