Skip to content

Commit

Permalink
add arguments support
Browse files Browse the repository at this point in the history
  • Loading branch information
0xb11a1 committed May 14, 2023
1 parent 1cfab7f commit 36ea5a8
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions yetAnotherObfuscator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Program
public static string path = "";
public static string obf_path = "";
static void Main(string[] args){
HelpPage();
HelpPage(args);

Assembly Default_Assembly;
Default_Assembly = System.Reflection.Assembly.UnsafeLoadFrom(path);
Expand All @@ -31,28 +31,38 @@ static void Main(string[] args){
Console.WriteLine("[+] Saving the obfuscated file");
SaveToFile(Module, path);

Console.WriteLine("[+] Changing exe GUID");
Console.WriteLine("[+] Changing exe GUID if it exists");
ChangeGUID(Default_Assembly);

Console.WriteLine("[+] All done, the obfuscated exe in: " + obf_path);
Console.Read();
}
static void HelpPage() {
static void HelpPage(string[] args) {
Console.WriteLine(@" __ __ ______ _____ ");
Console.WriteLine(@" /\ \ /\ \/\ _ \/\ __`\ ");
Console.WriteLine(@" \ `\`\\/'/\ \ \L\ \ \ \/\ \ ");
Console.WriteLine(@" `\ `\ /' \ \ __ \ \ \ \ \ ");
Console.WriteLine(@" `\ \ \ \ \ \/\ \ \ \_\ \ ");
Console.WriteLine(@" \ \_\ \ \_\ \_\ \_____\ ");
Console.WriteLine(@" \/_/ \/_/\/_/\/_____/ ");

if (args.Length == 1) {
path = args[0].ToString();
}
else {
do {
Console.Write("Enter exe path: ");
path = Console.ReadLine().Trim();

do {
Console.Write("Enter exe path: ");
path = Console.ReadLine().Trim();
obf_path = path + "._obf.exe";
Console.WriteLine("[+] Working on: " + path);

} while (path.Length == 0 );
} while (path.Length == 0 );
}
if (! File.Exists(path)) {
Console.WriteLine("[-] the path '" + path + "' does not exists");
System.Environment.Exit(1);
}

obf_path = path + "._obf.exe";
Console.WriteLine("[+] Working on: " + path);

}

Expand Down

0 comments on commit 36ea5a8

Please sign in to comment.