public NetProtect(string input_file, string output_file, string aes_key, string upload_url = "") { this.UPLOAD_URL = upload_url; WorkDirectory = $"{Path.GetTempPath()}\\NetProtect"; Directory.CreateDirectory(WorkDirectory); this.output_file = output_file; this.aes_key = aes_key; Assembly = new ProtectableAssembly(input_file); }
private void WriteToDisk(bool temp = false, string file_name = "temp_asm.exe") { if (temp) { string file_path = WorkDirectory + "\\" + file_name; //use mono to write our assembly Assembly.Assembly.Write(file_path); this.Assembly = new ProtectableAssembly(file_path);//? why is this here } else { //write our bytes File.WriteAllBytes(output_file, this.Assembly.Data); } }