From 815d7b6350bc13c97ff05ce11dd5f6a74d2d577c Mon Sep 17 00:00:00 2001 From: Eran-YT Date: Tue, 1 Jun 2021 14:43:56 +0300 Subject: [PATCH 1/2] Use standard .NET libraries instead of windows only libraries --- EvtxECmd/EvtxECmd.csproj | 11 ++++++----- evtx.Test/evtx.Test.csproj | 13 ++++--------- evtx/EventLog.cs | 18 +----------------- evtx/evtx.csproj | 13 +++---------- 4 files changed, 14 insertions(+), 41 deletions(-) diff --git a/EvtxECmd/EvtxECmd.csproj b/EvtxECmd/EvtxECmd.csproj index 093bc6bd..6cf1f73e 100644 --- a/EvtxECmd/EvtxECmd.csproj +++ b/EvtxECmd/EvtxECmd.csproj @@ -1,7 +1,7 @@  Exe - net462 + net46 true EvtxECmd Eric R. Zimmerman @@ -18,6 +18,7 @@ IDCard.ico + @@ -44,18 +45,18 @@ - + all - + all - - + + diff --git a/evtx.Test/evtx.Test.csproj b/evtx.Test/evtx.Test.csproj index 91d42f33..051f6474 100644 --- a/evtx.Test/evtx.Test.csproj +++ b/evtx.Test/evtx.Test.csproj @@ -1,6 +1,6 @@  - net461 + net46;net5.0 evtx.Test evtx.Test Copyright © 2019 @@ -11,17 +11,12 @@ - - - - - - - - + + + \ No newline at end of file diff --git a/evtx/EventLog.cs b/evtx/EventLog.cs index e6fbf193..b0229122 100644 --- a/evtx/EventLog.cs +++ b/evtx/EventLog.cs @@ -3,7 +3,6 @@ using System.IO; using System.Linq; using System.Text; -using Alphaleonis.Win32.Filesystem; using FluentValidation.Results; using Force.Crc32; using NLog; @@ -11,9 +10,6 @@ using ServiceStack.Text; using YamlDotNet.Core; using YamlDotNet.Serialization; -using Directory = Alphaleonis.Win32.Filesystem.Directory; -using File = Alphaleonis.Win32.Filesystem.File; -using Path = Alphaleonis.Win32.Filesystem.Path; //TODO rename project to EventLog? namespace evtx @@ -113,20 +109,8 @@ public static bool LoadMaps(string mapPath) { EventLogMaps = new Dictionary(); - var f = new DirectoryEnumerationFilters(); - f.InclusionFilter = fsei => fsei.Extension.ToUpperInvariant() == ".MAP"; - - f.RecursionFilter = null; //entryInfo => !entryInfo.IsMountPoint && !entryInfo.IsSymbolicLink; - - f.ErrorFilter = (errorCode, errorMessage, pathProcessed) => true; - - var dirEnumOptions = - DirectoryEnumerationOptions.Files | - DirectoryEnumerationOptions.SkipReparsePoints | DirectoryEnumerationOptions.ContinueOnException | - DirectoryEnumerationOptions.BasicSearch; - var mapFiles = - Directory.EnumerateFileSystemEntries(mapPath, dirEnumOptions, f).ToList(); + Directory.EnumerateFileSystemEntries(mapPath, "*.MAP").ToList(); var l = LogManager.GetLogger("LoadMaps"); diff --git a/evtx/evtx.csproj b/evtx/evtx.csproj index a3b9b6e3..8fbc01c2 100644 --- a/evtx/evtx.csproj +++ b/evtx/evtx.csproj @@ -8,9 +8,9 @@ Copyright © 2021 true MIT - 1.0.0.1 - 1.0.0.1 - 1.0.0.1 + 1.0.1 + 1.0.1 + 1.0.1 true @@ -22,17 +22,10 @@ - - - - - - - From 0c92a9b009c9205f5f5ceaaa1e6e4e72834bd350 Mon Sep 17 00:00:00 2001 From: Eran-YT Date: Wed, 2 Jun 2021 18:26:35 +0300 Subject: [PATCH 2/2] Fix map and fody version --- EvtxECmd/EvtxECmd.csproj | 2 +- evtx/EventLog.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/EvtxECmd/EvtxECmd.csproj b/EvtxECmd/EvtxECmd.csproj index 6cf1f73e..d0e2d93e 100644 --- a/EvtxECmd/EvtxECmd.csproj +++ b/EvtxECmd/EvtxECmd.csproj @@ -45,7 +45,7 @@ - + all diff --git a/evtx/EventLog.cs b/evtx/EventLog.cs index b0229122..b635b137 100644 --- a/evtx/EventLog.cs +++ b/evtx/EventLog.cs @@ -110,7 +110,7 @@ public static bool LoadMaps(string mapPath) EventLogMaps = new Dictionary(); var mapFiles = - Directory.EnumerateFileSystemEntries(mapPath, "*.MAP").ToList(); + Directory.EnumerateFileSystemEntries(mapPath, "*.map").ToList(); var l = LogManager.GetLogger("LoadMaps");