Builder and Renamer fixes

This commit is contained in:
MaxXor 2015-09-05 22:09:58 +02:00
parent 4927d1b230
commit 5b34f03ae1
3 changed files with 27 additions and 31 deletions

View File

@ -42,15 +42,7 @@ namespace xServer.Core.Build
{
// PHASE 1 - Settings
string encKey = FileHelper.GetRandomFilename(20);
AssemblyDefinition asmDef;
try
{
asmDef = AssemblyDefinition.ReadAssembly("client.bin");
}
catch (Exception ex)
{
throw new FileLoadException(ex.Message);
}
AssemblyDefinition asmDef = AssemblyDefinition.ReadAssembly("client.bin");
foreach (var typeDef in asmDef.Modules[0].Types)
{

View File

@ -56,14 +56,7 @@ namespace xServer.Core.Build
private void RenameInType(TypeDefinition typeDef)
{
if (typeDef.Namespace.StartsWith("xClient.Core.Compression")
|| typeDef.Namespace.StartsWith("xClient.Core.Networking")
|| typeDef.Namespace.StartsWith("xClient.Core.NetSerializer")
|| typeDef.Namespace.StartsWith("xClient.Core.ReverseProxy")
|| typeDef.Namespace.StartsWith("xClient.Core.MouseKeyHook")
|| typeDef.Namespace.StartsWith("xClient.Core.Packets")
|| typeDef.Namespace.StartsWith("xClient.Core.Recovery")
|| typeDef.HasInterfaces)
if (typeDef.Namespace.Contains("NetSerializer") || typeDef.HasInterfaces)
return;
_typeOverloader.GiveName(typeDef);
@ -79,7 +72,10 @@ namespace xServer.Core.Build
RenameInType(nestedType);
if (typeDef.HasMethods)
foreach (MethodDefinition methodDef in typeDef.Methods.Where(methodDef => !methodDef.IsConstructor))
foreach (MethodDefinition methodDef in
typeDef.Methods.Where(methodDef =>
!methodDef.IsConstructor && !methodDef.HasCustomAttributes &&
!methodDef.IsAbstract && !methodDef.IsVirtual))
methodOverloader.GiveName(methodDef);
if (typeDef.HasFields)

View File

@ -234,7 +234,14 @@ namespace xServer.Forms
if (password.Length < 3)
{
MessageBox.Show("Please enter a secure password with more than 3 characters.",
"Please enter a secure password", MessageBoxButtons.OK, MessageBoxIcon.Warning);
"Build failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (!File.Exists("client.bin"))
{
MessageBox.Show("Could not locate \"client.bin\" file. It should be in the same directory as Quasar.",
"Build failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
@ -262,13 +269,13 @@ namespace xServer.Forms
if (string.IsNullOrEmpty(output))
{
MessageBox.Show("Please choose a valid output path.", "Build failed", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("Please choose a valid output path.", "Build failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (chkIconChange.Checked && string.IsNullOrEmpty(icon))
{
MessageBox.Show("Please choose a valid icon path.", "Build failed", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("Please choose a valid icon path.", "Build failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
@ -277,11 +284,17 @@ namespace xServer.Forms
string[] asmInfo = null;
if (chkChangeAsmInfo.Checked)
{
if (!FormatHelper.IsValidVersionNumber(txtProductVersion.Text) ||
!FormatHelper.IsValidVersionNumber(txtFileVersion.Text))
if (!FormatHelper.IsValidVersionNumber(txtProductVersion.Text))
{
MessageBox.Show("Please enter a valid version number!\nExample: 1.0.0.0", "Build failed",
MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("Please enter a valid product version number!\nExample: 1.2.3.4", "Build failed",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (!FormatHelper.IsValidVersionNumber(txtFileVersion.Text))
{
MessageBox.Show("Please enter a valid file version number!\nExample: 1.2.3.4", "Build failed",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
@ -301,14 +314,9 @@ namespace xServer.Forms
chkHide.Checked, chkKeylogger.Checked, int.Parse(txtDelay.Text), GetInstallPath(), icon, asmInfo,
Application.ProductVersion);
MessageBox.Show("Successfully built client!", "Build Success", MessageBoxButtons.OK,
MessageBox.Show("Successfully built client!\nSaved to: " + output, "Build Success", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
catch (FileLoadException)
{
MessageBox.Show("Unable to load the Client Assembly Information.\nPlease re-build the Client.",
"Build failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (Exception ex)
{
MessageBox.Show(