RDR Bypass Netch Directory

This commit is contained in:
ChsBuffer
2021-02-14 22:16:42 +08:00
parent fd410ea388
commit 3771d39fb0
2 changed files with 16 additions and 3 deletions

View File

@@ -270,6 +270,7 @@ namespace Netch.Controllers
}
aio_dial((int) NameList.TYPE_ADDNAME, @"NTT\.exe");
aio_dial((int) NameList.TYPE_BYPNAME, "^" + Global.NetchDir.ToRegexString() + @"((?!NTT\.exe).)*$");
}
#region NativeMethods
@@ -291,7 +292,6 @@ namespace Netch.Controllers
[DllImport("Redirector.bin", CallingConvention = CallingConvention.Cdecl)]
private static extern ulong aio_getDL();
public enum NameList
{
TYPE_FILTERLOOPBACK,

View File

@@ -1,10 +1,11 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace Netch.Utils
{
static class StringEx
public static class StringEx
{
public static bool IsNullOrEmpty(this string value)
{
@@ -42,5 +43,17 @@ namespace Netch.Utils
yield return line;
}
}
public static string ToRegexString(this string value)
{
var sb = new StringBuilder();
foreach (var t in value)
{
if (new[] {'\\', '(', ')', '[', ']', '.'}.Any(s => s == t))
sb.Append(@"\");
sb.Append(t);
}
return sb.ToString();
}
}
}
}