Answer the question
In order to leave comments, you need to log in
Running a byte array doesn't work?
FileStream fs = new FileStream(@"C:\Users\Родион\Desktop\chk.exe", FileMode.Open);
BinaryReader br = new BinaryReader(fs);
byte[] bin = br.ReadBytes(Convert.ToInt32(fs.Length));
fs.Close();
br.Close();
Assembly a = Assembly.Load(bin);
MethodInfo method = a.EntryPoint;
object o = a.CreateInstance(method.Name);
// invoke the application starting point
method.Invoke(o, null);
System.BadImageFormatException: "Не удалось загрузить файл или сборку "594432 bytes loaded from WindowsFormsApp7, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" либо одну из их зависимостей. Была сделана попытка загрузить программу, имеющую неверный формат."
Answer the question
In order to leave comments, you need to log in
is "chk.exe" exactly a .NET assembly?
does the .NET Framework version match?
Well, the digits must match...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question