2021-03-24 10:43:23 -07:00
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Proxy
|
|
|
|
|
{
|
|
|
|
|
static class DnsBlacklist
|
|
|
|
|
{
|
2021-03-29 15:55:53 -07:00
|
|
|
|
const RegexOptions RegexOpts = RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.Compiled;
|
|
|
|
|
|
2021-03-24 10:43:23 -07:00
|
|
|
|
private static readonly Regex[] BlockedHosts = new Regex[]
|
|
|
|
|
{
|
2022-01-02 23:57:03 -08:00
|
|
|
|
new Regex(@"^(.*)\-lp1\.(n|s)\.n\.srv\.nintendo\.net$", RegexOpts),
|
2022-01-10 23:58:57 -08:00
|
|
|
|
new Regex(@"^(.*)\-lp1\.lp1\.t\.npln\.srv\.nintendo\.net$", RegexOpts),
|
2022-01-02 23:57:03 -08:00
|
|
|
|
new Regex(@"^(.*)\-lp1\.(znc|p)\.srv\.nintendo\.net$", RegexOpts),
|
2021-03-29 15:55:53 -07:00
|
|
|
|
new Regex(@"^(.*)\-sb\-api\.accounts\.nintendo\.com$", RegexOpts),
|
|
|
|
|
new Regex(@"^(.*)\-sb\.accounts\.nintendo\.com$", RegexOpts),
|
|
|
|
|
new Regex(@"^accounts\.nintendo\.com$", RegexOpts)
|
2021-03-24 10:43:23 -07:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static bool IsHostBlocked(string host)
|
|
|
|
|
{
|
|
|
|
|
foreach (Regex regex in BlockedHosts)
|
|
|
|
|
{
|
|
|
|
|
if (regex.IsMatch(host))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|