Files
KingKDot-PowerCrypt/PowerCrypt/Obfuscator/Methods/FunctionObfuscation/FunctionOBF.cs
T
2025-02-10 18:17:56 -06:00

39 lines
1.2 KiB
C#

using PowerCrypt.Obfuscator.Helpers.globals;
using PowerCrypt.Obfuscator.Methods.RandomHelper;
namespace PowerCrypt.Obfuscator.Methods.FunctionObfuscation
{
public class FunctionOBF
{
public static string ObfuscateFunctionSimple(string ObfuscateFunction)
{
string randomString = Helper.GetRandomString(10);
string randomLetter = Helper.GetRandomString(1, true);
randomString = randomLetter + randomString;
if (ObfuscateFunction == Globals.CompressFunctionName)
{
Console.WriteLine("Function name is the same as the compress function name, changing it to a random string");
Globals.CompressFunctionName = randomString;
}
//add backticks to captial letters
var modifiedString = new System.Text.StringBuilder();
foreach (char c in randomString)
{
if (char.IsUpper(c))
{
modifiedString.Append('`').Append(c);
}
else
{
modifiedString.Append(c);
}
}
return modifiedString.ToString();
}
}
}