From 0242c5efc8a805fdca226ce92fbddef3ec8ae3fa Mon Sep 17 00:00:00 2001 From: Tau Date: Sat, 7 Sep 2019 13:49:04 -0400 Subject: [PATCH] platform/dns.c: Intercept router host names --- platform/config.c | 8 ++++++++ platform/config.h | 1 + platform/dns.c | 12 ++++++++++++ 3 files changed, 21 insertions(+) diff --git a/platform/config.c b/platform/config.c index e722824..5906287 100644 --- a/platform/config.c +++ b/platform/config.c @@ -63,6 +63,14 @@ void dns_config_load(struct dns_config *cfg, const wchar_t *filename) _countof(default_), filename); + GetPrivateProfileStringW( + L"dns", + L"router", + default_, + cfg->router, + _countof(cfg->router), + filename); + GetPrivateProfileStringW( L"dns", L"startup", diff --git a/platform/config.h b/platform/config.h index 37ae555..d954292 100644 --- a/platform/config.h +++ b/platform/config.h @@ -12,6 +12,7 @@ struct amvideo_config { struct dns_config { bool enable; + wchar_t router[128]; wchar_t startup[128]; wchar_t billing[128]; wchar_t aimedb[128]; diff --git a/platform/dns.c b/platform/dns.c index 8a8ea46..a69d47e 100644 --- a/platform/dns.c +++ b/platform/dns.c @@ -17,6 +17,18 @@ HRESULT dns_platform_hook_init(const struct dns_config *cfg) return S_FALSE; } + hr = dns_hook_push(L"tenporouter.loc", cfg->router); + + if (FAILED(hr)) { + return hr; + } + + hr = dns_hook_push(L"bbrouter.loc", cfg->router); + + if (FAILED(hr)) { + return hr; + } + hr = dns_hook_push(L"naominet.jp", cfg->startup); if (FAILED(hr)) {