-
Notifications
You must be signed in to change notification settings - Fork 2
/
Save.cs
55 lines (50 loc) · 1.82 KB
/
Save.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using dnlib.DotNet;
using dnlib.DotNet.Writer;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace App_Translator
{
public partial class Save : Form
{
public Save()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SaveFileDialog sv = new SaveFileDialog();
sv.FileName = Global.module.Assembly.Name + "_translated.exe";
if (sv.ShowDialog() == DialogResult.OK)
{
ModuleWriterOptions moduleWriterOptions = new ModuleWriterOptions(Global.module);
moduleWriterOptions.MetaDataOptions.Flags = moduleWriterOptions.MetaDataOptions.Flags | MetaDataFlags.PreserveAll;
moduleWriterOptions.MetaDataOptions.Flags = moduleWriterOptions.MetaDataOptions.Flags | MetaDataFlags.KeepOldMaxStack;
moduleWriterOptions.Logger = DummyLogger.NoThrowInstance;
Global.module.Write(sv.FileName, moduleWriterOptions);
Application.Exit();
}
}
private void Save_Load(object sender, EventArgs e)
{
label1.Text = "String chenged: " + Global.changed.ToString();
label2.Text = "Name: " + Global.module.Assembly.Name;
label3.Text = "Version: " + Global.module.Assembly.Version;
}
private void button2_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void Save_FormClosed(object sender, FormClosedEventArgs e)
{
Application.Exit();
}
}
}