diff --git a/platform/dns.c b/platform/dns.c index b457365..649aa1a 100644 --- a/platform/dns.c +++ b/platform/dns.c @@ -79,6 +79,12 @@ HRESULT dns_platform_hook_init(const struct dns_config *cfg) return hr; } + hr = dns_hook_push(L"stable.garm.nbgi-amnet.jp", cfg->startup); + + if (FAILED(hr)) { + return hr; + } + // if your ISP resolves bad domains, it will kill the network. These 2 // *cannot* resolve diff --git a/platform/es3sec.c b/platform/es3sec.c index be29cd2..f78158a 100644 --- a/platform/es3sec.c +++ b/platform/es3sec.c @@ -7,11 +7,12 @@ #include "hook/table.h" #include "hook/iohook.h" +#include "hook/procaddr.h" #include "hooklib/setupapi.h" #include "util/dprintf.h" #include "util/str.h" -#include "es3sec.h" +#include "platform/es3sec.h" #define DONGLE_STR_IDX_MANUFACTURER 1 #define DONGLE_STR_IDX_PRODUCT 2 @@ -195,7 +196,9 @@ HRESULT es3sec_hook_init( return hr; } - hook_table_apply(NULL, "setupapi.dll", cm_syms, _countof(cm_syms)); + es3sec_insert_hooks(NULL); + //hook_table_apply(NULL, "setupapi.dll", cm_syms, _countof(cm_syms)); + proc_addr_table_push(NULL, "setupapi.dll", cm_syms, _countof(cm_syms)); CM_Locate_DevNodeW(&root_dev_inst, NULL, CM_LOCATE_DEVNODE_NORMAL); @@ -215,6 +218,14 @@ HRESULT es3sec_hook_init( return S_OK; } +void es3sec_insert_hooks(HMODULE target) { + hook_table_apply( + target, + "setupapi.dll", + cm_syms, + _countof(cm_syms)); +} + static HRESULT es3sec_handle_hub_irp(struct irp *irp) { assert(irp != NULL); @@ -332,6 +343,8 @@ static HRESULT es3sec_hub_handle_roothub(struct irp *irp) size_t size_of_hub_name = sizeof(DEVNAME_HUB); ULONG actual_length = size_of_hub_name + sizeof(USB_ROOT_HUB_NAME); HRESULT hr; + + dprintf("ES3 Dongle: Request root hub\n"); if (irp->read.nbytes == sizeof(USB_ROOT_HUB_NAME)) { // Root hub name size USB_ROOT_HUB_NAME rhub; diff --git a/platform/es3sec.h b/platform/es3sec.h index c9dd8b1..a0c572b 100644 --- a/platform/es3sec.h +++ b/platform/es3sec.h @@ -13,3 +13,5 @@ HRESULT es3sec_hook_init( USHORT pid, const wchar_t *manufacturer, const wchar_t *product); + +void es3sec_insert_hooks(HMODULE target); diff --git a/taikohook/amfw.c b/taikohook/amfw.c index c59b213..4a63f86 100644 --- a/taikohook/amfw.c +++ b/taikohook/amfw.c @@ -1,7 +1,7 @@ #include #include -#include "taikohook/config.h" +#include "platform/es3sec.h" #include "hook/table.h" #include "hook/iohook.h" @@ -10,6 +10,7 @@ #include "hooklib/path.h" #include "hooklib/setupapi.h" #include "hooklib/serial.h" +#include "hook/procaddr.h" #include "util/dprintf.h" @@ -22,8 +23,8 @@ */ static const wchar_t *target_modules[] = { - L"AMFrameWork.dll", L"nbamUsbfinder.dll", + L"bngrw.dll", }; static const size_t target_modules_len = _countof(target_modules); @@ -48,7 +49,7 @@ static const struct hook_symbol kernel32_syms[] = { } }; -HRESULT amfw_hook_init(wchar_t serial[13]) +HRESULT amfw_hook_init() { HANDLE hMod; @@ -66,8 +67,8 @@ HRESULT amfw_hook_init(wchar_t serial[13]) dprintf("AMFW: Found AMFrameWork Handle\n"); path_hook_insert_hooks(hMod); - dll_hook_insert_hooks(hMod); setupapi_hook_insert_hooks(hMod); + proc_addr_insert_hooks(hMod); serial_hook_apply_hooks(hMod); iohook_apply_hooks(hMod); @@ -157,8 +158,9 @@ static HMODULE WINAPI hook_LoadLibraryW(const wchar_t *name) dprintf("Taiko: Hooked %S\n", target_module); dll_hook_insert_hooks(result); - // path_hook_insert_hooks(result); + path_hook_insert_hooks(result); setupapi_hook_insert_hooks(result); + es3sec_insert_hooks(result); serial_hook_apply_hooks(result); iohook_apply_hooks(result); diff --git a/taikohook/amfw.h b/taikohook/amfw.h index 7489b5b..35dcff4 100644 --- a/taikohook/amfw.h +++ b/taikohook/amfw.h @@ -1,4 +1,4 @@ #pragma once #include -HRESULT amfw_hook_init(wchar_t *serial); \ No newline at end of file +HRESULT amfw_hook_init(); \ No newline at end of file diff --git a/taikohook/dllmain.c b/taikohook/dllmain.c index 9d56ed8..05132c0 100644 --- a/taikohook/dllmain.c +++ b/taikohook/dllmain.c @@ -71,7 +71,7 @@ static DWORD CALLBACK taiko_pre_startup(void) ExitProcess(EXIT_FAILURE); } - hr = amfw_hook_init(taiko_hook_cfg.platform.dongle.serial); + hr = amfw_hook_init(); if (FAILED(hr)) { ExitProcess(EXIT_FAILURE);