Changeset 2538


Ignore:
Timestamp:
Jan 31, 2011, 11:49:48 AM (11 years ago)
Author:
Matthäus Wander
Message:

NetworkCapture:

  • Build new plugin for capturing packets from network device (requires WinPcap to be installed already)
  • Updated PacketDotNet.dll and SharpPcap.dll from pap solution
Location:
trunk
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/TextOutput/TextOutput.cs

    r2529 r2538  
    222222            else if (value is ICryptoolStream)
    223223            {
    224                 CStreamReader reader = ((ICryptoolStream)value).CreateReader();
    225                 // GuiLogMessage("Stream: Filling TextBoxes now...", NotificationLevel.Debug);
    226                 if (reader.Length > settings.MaxLength)
    227                     AddMessage("WARNING - Stream is too large (" + (reader.Length / 1024).ToString("0.00") + " kB), output will be truncated to " + (settings.MaxLength / 1024).ToString("0.00") + "kB", NotificationLevel.Warning);
    228                 byte[] byteValues = new byte[Math.Min(settings.MaxLength, reader.Length)];
    229                 int bytesRead;
    230                 reader.Seek(0, SeekOrigin.Begin);
    231                 bytesRead = reader.ReadFully(byteValues, 0, byteValues.Length);
    232                 fillValue = GetStringForSelectedEncoding(byteValues);
     224                using (CStreamReader reader = ((ICryptoolStream)value).CreateReader())
     225                {
     226                    // GuiLogMessage("Stream: Filling TextBoxes now...", NotificationLevel.Debug);
     227                    if (reader.Length > settings.MaxLength)
     228                        AddMessage("WARNING - Stream is too large (" + (reader.Length / 1024).ToString("0.00") + " kB), output will be truncated to " + (settings.MaxLength / 1024).ToString("0.00") + "kB", NotificationLevel.Warning);
     229                    byte[] byteValues = new byte[Math.Min(settings.MaxLength, reader.Length)];
     230                    int bytesRead;
     231                    reader.Seek(0, SeekOrigin.Begin);
     232                    bytesRead = reader.ReadFully(byteValues, 0, byteValues.Length);
     233                    fillValue = GetStringForSelectedEncoding(byteValues);   
     234                }
    233235            }
    234236            else if (value is byte[])
  • trunk/CrypTool 2.0.sln

    r2515 r2538  
    250250EndProject
    251251Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "T-310", "CrypPlugins\T-310\T-310.csproj", "{36F9DD52-9000-4E3D-8299-AD10C479B129}"
     252EndProject
     253Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetworkCapture", "CrypPlugins\NetworkCapture\NetworkCapture.csproj", "{52E69F19-74A3-4766-8FE5-6F2F0E569E25}"
    252254EndProject
    253255Global
     
    733735                {36F9DD52-9000-4E3D-8299-AD10C479B129}.Release|x86.ActiveCfg = Release|x86
    734736                {36F9DD52-9000-4E3D-8299-AD10C479B129}.Release|x86.Build.0 = Release|x86
     737                {52E69F19-74A3-4766-8FE5-6F2F0E569E25}.Debug|x86.ActiveCfg = Debug|x86
     738                {52E69F19-74A3-4766-8FE5-6F2F0E569E25}.Debug|x86.Build.0 = Debug|x86
     739                {52E69F19-74A3-4766-8FE5-6F2F0E569E25}.Release|x86.ActiveCfg = Release|x86
     740                {52E69F19-74A3-4766-8FE5-6F2F0E569E25}.Release|x86.Build.0 = Release|x86
    735741        EndGlobalSection
    736742        GlobalSection(SolutionProperties) = preSolution
     
    851857                {FF247A82-21AD-4010-B2FB-D93EE2B02677} = {88B851F6-9E3D-484F-A317-ECED5B98C618}
    852858                {36F9DD52-9000-4E3D-8299-AD10C479B129} = {88B851F6-9E3D-484F-A317-ECED5B98C618}
     859                {52E69F19-74A3-4766-8FE5-6F2F0E569E25} = {88B851F6-9E3D-484F-A317-ECED5B98C618}
    853860                {0946E1A6-5488-4711-AD10-D54D6A5D2F32} = {1E472920-3A9C-413A-98B2-8372F0E283C5}
    854861        EndGlobalSection
Note: See TracChangeset for help on using the changeset viewer.