Skip to content

Less7 deobuf #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CodeReflectionLess6/CodeReflectionLess6.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
124 changes: 124 additions & 0 deletions CodeReflectionLess6/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;

namespace Less6
{
/// <summary>
/// После рефлексии 6 задание
/// </summary>


class Program
{
static void Main(string[] args)
{
string stringa = new string('=', 30);
Console.WriteLine("Task Manager");
Process[] ps = Process.GetProcesses();
List<Process> list = new List<Process>();
for (;;)
{
int count = 0;
list.AddRange(ps);
Console.WriteLine(string.Format("Кол-во запущуенный {0}", list.Count));
Console.WriteLine(stringa);
list = (from x in list
orderby x.ProcessName
select x).ToList<Process>();
foreach (Process proc in list)
{
Console.WriteLine(string.Format("[{0}]\t{1}\t{2}\t{3}", new object[] { count, proc.Id, proc.ProcessName, proc.BasePriority }));
count++;
}
Console.Write("Ввести Id для закрытия = ");
string ids = Console.ReadLine();
int id = -1;
int.TryParse(ids, out id);
bool flag2 = id >= 0;
if (flag2)
{
Process procdel = list.FirstOrDefault((Process p) => p.Id == id);
bool flag3 = procdel != null;
if (flag3)
{
string tempName = procdel.ProcessName;
try
{
procdel.Kill();
Console.WriteLine(stringa);
Console.WriteLine("close " + tempName + " ");
Console.WriteLine(stringa);
list.Remove(procdel);
Console.WriteLine(string.Format("Кол-во запущуенный {0}", list.Count));
}
catch (InvalidOperationException)
{
Console.WriteLine("Process " + tempName + " not found!");
}
catch (Exception ex)
{
Console.WriteLine("Информация об ошибке: " + ex.StackTrace);
}
Console.WriteLine("Закрыть еще процессы или выйти из приложения, y/n ");
string sl = Console.ReadLine().ToLower();
bool flag = sl == "y";
bool flag4 = !flag;
if (flag4)
{
Environment.Exit(0);
}
}
}
else
{
Console.WriteLine("Введено не верно");
}
}
}

public Program()
{
}

[CompilerGenerated]
[Serializable]
sealed class __c
{
// Note: this type is marked as 'beforefieldinit'.
static __c()
{
}

public __c()
{
}

internal string _Main_b__0_0(Process x)
{
return x.ProcessName;
}

public static readonly Program.__c __9 = new Program.__c();

public static Func<Process, string> __9__0_0;
}

[CompilerGenerated]
sealed class __c__DisplayClass0_0
{
public __c__DisplayClass0_0()
{
}

internal bool _Main_b__1(Process p)
{
return p.Id == this.id;
}

public int id;
}
}
}
Binary file not shown.
Binary file added Embedd/2
Binary file not shown.
Binary file added Embedd/3
Binary file not shown.
Binary file added Embedd/4
Binary file not shown.
29 changes: 29 additions & 0 deletions Embedd/Embedd.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<None Remove="1Š™–œvŒœœqœŸg‰”v.‡“8‹™4›‰qeyft4l" />
<None Remove="2" />
<None Remove="3" />
<None Remove="4" />
<None Remove="_" />
<None Remove="˜1" />
</ItemGroup>

<ItemGroup>
<ApplicationDefinition Include="1Š™–œvŒœœqœŸg‰”v.‡“8‹™4›‰qeyft4l" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="2" />
<EmbeddedResource Include="3" />
<EmbeddedResource Include="4" />
<EmbeddedResource Include="_" />
<EmbeddedResource Include="˜1" />
</ItemGroup>

</Project>
175 changes: 175 additions & 0 deletions Embedd/Program.cs
Original file line number Diff line number Diff line change
@@ -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<string> list = new List<string>();
//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<string>();
}
}
}
Binary file added Embedd/_
Binary file not shown.
Binary file added Embedd/˜1
Binary file not shown.
8 changes: 8 additions & 0 deletions Less6/Less6.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

</Project>
Loading