feat: Add missing cleanup functions various iidx hook modules

Summary:

Test Plan:
This commit is contained in:
icex2
2024-08-15 13:24:47 +02:00
parent f5ed7f5231
commit 51f3b07acf
18 changed files with 93 additions and 1 deletions
+7 -1
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");
}
+2
View File
@@ -3,4 +3,6 @@
void acp_hook_init(void);
void acp_hook_fini();
#endif
+10
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)
+2
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.
+11
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;
}
+2
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