diff --git a/ProcessInjector/ProcessInjector.csproj b/ProcessInjector/ProcessInjector.csproj
index db0edc5..7d6769a 100644
--- a/ProcessInjector/ProcessInjector.csproj
+++ b/ProcessInjector/ProcessInjector.csproj
@@ -28,7 +28,7 @@
X-NAS
true
publish.htm
- 28
+ 29
1.0.0.%2a
false
true
diff --git a/ProcessInjector/Properties/AssemblyInfo.cs b/ProcessInjector/Properties/AssemblyInfo.cs
index 1be3dbc..836763a 100644
--- a/ProcessInjector/Properties/AssemblyInfo.cs
+++ b/ProcessInjector/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
-[assembly: AssemblyVersion("1.0.0.27")]
+[assembly: AssemblyVersion("1.0.0.28")]
//[assembly: AssemblyVersion("1.0.0.21")]
//[assembly: AssemblyFileVersion("1.0.0.21")]
diff --git a/WPELibrary/Lib/Socket_Cache.cs b/WPELibrary/Lib/Socket_Cache.cs
index cf6de8f..2d125eb 100644
--- a/WPELibrary/Lib/Socket_Cache.cs
+++ b/WPELibrary/Lib/Socket_Cache.cs
@@ -8,7 +8,8 @@
namespace WPELibrary.Lib
{
public static class Socket_Cache
- {
+ {
+ private static string sLanguage_UI = "";
public static bool Interecept_Recv, Interecept_RecvFrom, Interecept_Send, Interecept_SendTo;
public static bool Display_Recv, Display_RecvFrom, Display_Send, Display_SendTo;
@@ -440,41 +441,50 @@ public static int GetFilterNum_ByFilterIndex(int FIndex)
#region//执行滤镜
public static void DoFilter(IntPtr ipBuff, int iLen)
{
+ int iFNum = 0;
+ string sFName = "", sFSearch = "", sModify = "";
+
try
{
byte[] bBuff = Socket_Operation.GetByteFromIntPtr(ipBuff, iLen);
- foreach (Socket_Filter_Info sfi in lstFilter)
+ if (bBuff.Length > 0)
{
- bool bCheck = sfi.IsCheck;
-
- if (bCheck)
+ foreach (Socket_Filter_Info sfi in lstFilter)
{
- int iFNum = sfi.FNum;
- string sFName = sfi.FName;
- string sFSearch = sfi.FSearch;
- string sModify = sfi.FModify;
+ bool bCheck = sfi.IsCheck;
- if (CheckFilterSearch_ByBuff(sFSearch, bBuff))
+ if (bCheck)
{
- if (!string.IsNullOrEmpty(sModify))
- {
- string[] ssModify = sModify.Split(',');
+ iFNum = sfi.FNum;
+ sFName = sfi.FName;
+ sFSearch = sfi.FSearch;
+ sModify = sfi.FModify;
- foreach (string sTemp in ssModify)
+ if (!string.IsNullOrEmpty(sFSearch) && !string.IsNullOrEmpty(sModify))
+ {
+ if (CheckFilterSearch_ByBuff(sFSearch, bBuff))
{
- string[] sModifyValue = sTemp.Split('|');
- int iIndex = int.Parse(sModifyValue[0].ToString().Trim());
- string sValue = sModifyValue[1].ToString().Trim();
+ string[] ssModify = sModify.Split(',');
- bBuff[iIndex] = Socket_Operation.Hex_To_Byte(sValue)[0];
- }
+ foreach (string sTemp in ssModify)
+ {
+ string[] sModifyValue = sTemp.Split('-');
+ int iIndex = int.Parse(sModifyValue[0].ToString().Trim());
+ string sValue = sModifyValue[1].ToString().Trim();
- bool bSetOK = Socket_Operation.SetByteToIntPtr(bBuff, ipBuff, iLen);
+ bBuff[iIndex] = Socket_Operation.Hex_To_Byte(sValue)[0];
+ }
- if (bSetOK)
- {
- break;
+ bool bSetOK = Socket_Operation.SetByteToIntPtr(bBuff, ipBuff, iLen);
+
+ if (bSetOK)
+ {
+ sLanguage_UI = MultiLanguage.GetDefaultLanguage("执行滤镜成功: ", "Filter execution successful: ");
+ Socket_Operation.DoLog(sLanguage_UI + sFName);
+
+ break;
+ }
}
}
}
@@ -483,7 +493,8 @@ public static void DoFilter(IntPtr ipBuff, int iLen)
}
catch (Exception ex)
{
- Socket_Operation.DoLog(ex.Message);
+ sLanguage_UI = MultiLanguage.GetDefaultLanguage("执行滤镜出错: ", "Error executing filter: ");
+ Socket_Operation.DoLog(sLanguage_UI + sFName + " | " + ex.Message);
}
}
#endregion
@@ -491,29 +502,39 @@ public static void DoFilter(IntPtr ipBuff, int iLen)
#region//检查是否匹配滤镜
private static bool CheckFilterSearch_ByBuff(string FSearch, byte[] bBuff)
{
- bool bResult = true;
+ bool bResult = true;
- if (!string.IsNullOrEmpty(FSearch))
+ try
{
- string[] ssSearch = FSearch.Split(',');
-
- foreach (string sSearch in ssSearch)
+ if (!string.IsNullOrEmpty(FSearch))
{
- string[] sSearchValue = sSearch.Split('|');
- int iIndex = int.Parse(sSearchValue[0].ToString().Trim());
- string sValue = sSearchValue[1].ToString().Trim();
+ string[] ssSearch = FSearch.Split(',');
+
+ foreach (string sSearch in ssSearch)
+ {
+ string[] sSearchValue = sSearch.Split('-');
+ int iIndex = int.Parse(sSearchValue[0].ToString().Trim());
+ string sValue = sSearchValue[1].ToString().Trim();
- string sBufferValue = bBuff[iIndex].ToString("X2");
+ string sBufferValue = bBuff[iIndex].ToString("X2");
- if (!sValue.Equals(sBufferValue))
- {
- bResult = false;
- break;
+ if (!sValue.Equals(sBufferValue))
+ {
+ bResult = false;
+ break;
+ }
}
}
+ else
+ {
+ bResult = false;
+ }
}
- else
- {
+ catch (Exception ex)
+ {
+ sLanguage_UI = MultiLanguage.GetDefaultLanguage("匹配滤镜出错: ", "Matching filter error: ");
+ Socket_Operation.DoLog(sLanguage_UI + ex.Message);
+
bResult = false;
}
diff --git a/WPELibrary/Socket_Form.cs b/WPELibrary/Socket_Form.cs
index 00997ff..775caab 100644
--- a/WPELibrary/Socket_Form.cs
+++ b/WPELibrary/Socket_Form.cs
@@ -71,7 +71,7 @@ private void InitSocketForm()
this.tlSystemInfo.Text = sInjectInfo;
Socket_Cache.SocketSendList.InitSendList();
- Socket_Cache.SocketFilterList.InitFilterList(FilterMAXNum);
+ Socket_Cache.SocketFilterList.InitFilterList(FilterMAXNum);
Socket_Operation.DoLog(sInjectInfo);
}
@@ -319,6 +319,8 @@ private void tSocketInfo_Tick(object sender, EventArgs e)
this.tlInterecept_CNT.Text = Socket_Cache.SocketQueue.Interecept_CNT.ToString();
this.tlCheck_CNT.Text = Socket_Operation.CheckCNT.ToString();
+ this.dgvFilterList.Refresh();
+
if (!bgwSocketList.IsBusy)
{
if (Socket_Cache.SocketQueue.qSocket_Packet.Count > 0)