/// <summary> /// Rebuilds the assembly and saves it to the specified file path. /// </summary> /// <param name="path"></param> /// <param name="writingParameters"></param> public void Rebuild(string path, WritingParameters writingParameters) { using (FileStream fileStream = new FileStream(path, FileMode.Create, FileAccess.Write)) { Rebuild(fileStream, writingParameters); fileStream.Flush(); } }
/// <summary> /// Rebuilds the assembly and writes it to the specified stream. /// </summary> /// <param name="outputStream"></param> /// <param name="writingParameters"></param> public void Rebuild(Stream outputStream, WritingParameters writingParameters) { PEWriter writer = new PEWriter(this, writingParameters); writer.WriteExecutable(outputStream); }
/// <summary> /// Rebuilds the assembly and writes it to the specified stream. /// </summary> /// <param name="outputStream"></param> /// <param name="writingParameters"></param> public void Rebuild(Stream outputStream, WritingParameters writingParameters) { PEConstructor constructor = new PEConstructor(this); constructor.RebuildAndWrite(writingParameters); }