diff --git a/UEVR/ExecutableFilter.cs b/UEVR/ExecutableFilter.cs index 46cd1bc..a19139b 100644 --- a/UEVR/ExecutableFilter.cs +++ b/UEVR/ExecutableFilter.cs @@ -1,57 +1,26 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Reflection; -using Newtonsoft.Json; -using System.IO; -using System.Security.Cryptography; +using System.Text.Json; -namespace UEVR { - public class ExecutableFilter { - private HashSet m_invalidExecutables = new HashSet(); +namespace UEVR; - public ExecutableFilter() { - var filter = LoadFilterList(); - if (filter != null) { - m_invalidExecutables = new HashSet(filter); - } - } - - private List? LoadFilterList() { - var assembly = Assembly.GetExecutingAssembly(); - var resourceName = "UEVR.FilteredExecutables.json"; +public class ExecutableFilter { + const string RESOURCE_NAME = "UEVR.PlainTextFilteredExecutables.json"; - using (Stream? stream = assembly.GetManifestResourceStream(resourceName)) { - if (stream == null) { - return new List(); - } + readonly List invalidExecutableNames = new(); - using (StreamReader reader = new StreamReader(stream)) { - string json = reader.ReadToEnd(); - return JsonConvert.DeserializeObject>(json); - } - } - } + public ExecutableFilter() { + var assembly = Assembly.GetExecutingAssembly(); - private string HashString(string text) { - using (SHA256 sha256 = SHA256.Create()) { - byte[] hash = sha256.ComputeHash(Encoding.UTF8.GetBytes(text)); - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < hash.Length; i++) { - sb.Append(hash[i].ToString("X2")); - } - return sb.ToString(); - } - } - - public bool IsValidExecutable(string executableName) { - // Hash the incoming executable name - string hashedExecutableName = HashString(executableName); - - // Return true if the hashed executable is not in the list of non-games - return !m_invalidExecutables.Contains(hashedExecutableName); + using (var stream = assembly.GetManifestResourceStream(RESOURCE_NAME)) { + if (stream == null) return; + var deserializedList = JsonSerializer.Deserialize>(stream); + if (deserializedList != null) invalidExecutableNames = deserializedList; } } -} \ No newline at end of file + + public bool IsValidExecutable(string executableName) + => !invalidExecutableNames.Any(n => string.Equals(executableName, n, StringComparison.OrdinalIgnoreCase)); +} diff --git a/UEVR/FilteredExecutables.json b/UEVR/FilteredExecutables.json deleted file mode 100644 index c2beaa1..0000000 --- a/UEVR/FilteredExecutables.json +++ /dev/null @@ -1,51 +0,0 @@ -[ - "1C467339C960A107AB9EE5FF63B38009797416C964F988B224710773CC38796A", - "177D568460A8D87E949937EF332B91B5FA6EDD404E3B507CAAC093185253FCF1", - "7F964B389AB24D3166D212D6A25F8DB6ABD988F1BE23C595B4D599CBA06FFFAA", - "16E5F60F207A1A0073451C35A9D315D17FDC17D7FAB66449B00CDFAADC8B249E", - "9390EF32ADDF32BFDEA786BC1E20679592498068BCBFCD357EA10AB64EA35E47", - "434D125BBAB34A530B7581A524BA681C24A8B7A3933C8465742698B8D5307AE0", - "8C2522C0E5090978264106586CDA99ECB430B9BCB6C650E1533565D6E0DCF164", - "3DFD8A864A1A43E6CD6D54CC2DFC5BFC298DA7C018ACBFBED806E6F8E2C62038", - "329DAAAE022AA0F08AD2C260EF0402B7EEA5E2F962D720B7CA74C9838C45CF94", - "D80C80233AB3CC52912530C760B63EE7AFEE9C149E6EF3AB75FC7FFEBB6FD963", - "D13C14C90BC21593B4550C243EA7EDBCDC7D31CDE2F7146E188D5288A66AE841", - "3D4A97562AF0A9A58226B6839B04E07BD8FDB01E53499954E74D96D95E791618", - "3F1F29444C093E2890D2163174CCE5D5DB40386B84168E015EC9DA46CFF1A6F9", - "C0B20990E67E46F43D7DC816B963DBC593A0BB872ECC7C7C96031E904CD0F6A7", - "01D8716D3F6C8FE7A12CA49B50EE1069F7DAE0C1127E943E9D90A507FC76BB0E", - "8663499567DAD1789CE0AA0663999EF32AD7F7925ABF94FAF75799079B5BE46F", - "0B6A5E46237BA37831AC053F1140DFCB550B783B2FDF557031C5B63834351665", - "7E5043F0A68E7900F3CC3732B1B7B274F621B615603FF47E95971EA9AA050145", - "F91BC30EC85F7DE487A0D05D2D1500D4CF29F3C158B43CDF5FB0531976ED81C0", - "26E4E7A5AA13DAFDCC3F12B9D0F7BD4F445AE87FABF04CA004FCE7D26601E402", - "BB6B24BF13999272B27006F7711965F77861A326A30B43B9B1852A500AD68AC7", - "1C2BF84496BA5C94ABBAEAA2D624098DBABF0677B8844E22CC55B6623DF73D15", - "2B78DA3DC866654E6EA7CB2F654DF44746B6F02876ACBB2A05726AB3D915E47E", - "1D1D3BC79E162C4F09350BDD8D1E34B4089CE4731BBEAF20E74A657B265871D6", - "733580FFEAE4FC3DF4023E7C3A02F7F9980B48FDAFCFA37D8EA89E71C4A61C33", - "284B034892C85E0006F5770A89D1997AA95EF227CFB81C2EA2B83F3578FCE807", - "11BCFD23D55B523545EC3A25F491858B4A6D188D7BC2EB44292471EA2DEFAD63", - "672764B706DDC6B68678281B7F9B8ED3FF9232163DDEB439624327003443A62B", - "5F7EBFF425D2D44667D01429C0F768EBD412B2EB1CDFF0782187C04373045006", - "06152EE820AEB8807809963FB7383A65995A46C2AEFD138468AECFD3EF992114", - "BFCABAA7B1347B6266D8ECFB1F9B98B762CFB38828830B9C5DBB75247639A258", - "5ADD10DA27AA9037D3576DDC76512CEB0F99C5C139E844EA84F8B2CAFE3811DA", - "A8A6D9DCD6B8C85034EB3C18A2A5725ECCF05A44CB54DDF9EAD08432283632C7", - "EF3AC703C3547F28010C60C8B667D05389FC0999E78E60D8004FB2B3ACAE7888", - "3BE404BFEAFE49285F4035BCCD1840C1972A202E1A7664FFC196284B97A99797", - "832A2AF0F11278E77F64B7D94417FB6223439F8115D85D417A329148F4CC4142", - "AEDBA2C710C4B11558F65ABDD1AE26A484D9B15AB63927A841BFD32983B7E193", - "E248981DFCF7C8CC8E12999CB2F16A0C79059B6880AD7D4796083C67E35CDD4E", - "32E834DA46935DDA125C14D1405164739CF9525CC06C3C3509DCED9BE4DCC71D", - "7C42472C9A264BB8589C1F0B9B8D4E1FA13146C429ADE1ED9D5CDC1ED19E01B6", - "3F4A09B92CCF3382D71C8E3937B06B7945C6F1E42338D3F7E4C8577F220D810B", - "A70085E25FB569FF73A71AED14BD63955311400DA9068ED3ACFC2CE6EB947D21", - "50B5441A681EE4EECB8EDBED45E5DC402E96E2EB476D6EF1A817C369FC49C56E", - "65DB8C764322E4F5CB81A915C6000717AD9643CE4E4439A4BCB1C320A817A0B0", - "590E3BFD41EE9CA5CEEF44BFCBA6EA2D789CBDCE86DB90CB1353880ED50E52FF", - "B7B479E0123D49074FAC95B0D264AB37897447A8C3B0CE7CF7AC655C0DC5A2C7", - "4311AC12BE0E93D50A0127BE38F17BE912927C99604271C93C030595EBC95B5E", - "91C29761F7EEF29E6DC06BF8C051A1F6F35FE83793023F39E71292EC2C7AEB9F", - "3F40462915A3E6026A4D790127B95DED4D870F6AB18D9AF2FCBC454168255237" -] \ No newline at end of file diff --git a/UEVR/PlainTextFilteredExecutables.json b/UEVR/PlainTextFilteredExecutables.json index 1470999..1df5fae 100644 --- a/UEVR/PlainTextFilteredExecutables.json +++ b/UEVR/PlainTextFilteredExecutables.json @@ -1,51 +1,55 @@ [ + "adobe audition", + "adobe media encoder", + "applicationframehost", + "calculatorapp", + "chrome", + "devenv", + "ds4windows", + "epicgameslauncher", + "excel", "explorer", - "svchost", - "systemsettings", "firefox", - "chrome", + "holoshellapp", + "hxcalendarappimm", + "hxoutlook", + "ida", + "ida64", + "illustrator", + "mpv", "msedge", - "calculatorapp", - "applicationframehost", - "wwahost", + "microsoft.media.player", + "microsoft.msn.weather", + "notepad", + "notepad++", "nvidia share", - "textinputhost", - "devenv", - "steam", - "steamwebhelper", + "obs64", "oculusclient", "oculusdebugtool", + "outlook", "ovrserver_x64", - "vrmonitor", - "microsoft.media.player", - "microsoft.msn.weather", - "ida", - "ida64", + "photoshop", + "powerpnt", + "sharex", "spotify", - "hxoutlook", - "hxcalendarappimm", + "steam", + "steamvr_desktop_game_theater", + "steamwebhelper", "sublime_merge", "sublime_text", - "xboxpcapp", - "xboxapp", - "winstore.app", - "virtualdesktop.streamer", - "steamvr_desktop_game_theater", - "ds4windows", - "epicgameslauncher", - "sharex", - "holoshellapp", - "winrar", + "svchost", + "systemsettings", "taskmgr", + "telegram", + "textinputhost", + "virtualdesktop.streamer", + "vrmonitor", "vrserver", "windowsterminal", - "photoshop", - "adobe audition", - "adobe media encoder", - "illustrator", - "obs64", - "notepad", - "notepad++", - "mpv", - "telegram" + "winrar", + "winword", + "winstore.app", + "wwahost", + "xboxapp", + "xboxpcapp" ] \ No newline at end of file diff --git a/UEVR/UEVR.csproj b/UEVR/UEVR.csproj index 31c8d3c..ba35717 100644 --- a/UEVR/UEVR.csproj +++ b/UEVR/UEVR.csproj @@ -23,8 +23,8 @@ - + @@ -34,7 +34,7 @@ - + @@ -42,7 +42,6 @@ - @@ -52,10 +51,6 @@ - - - - True