mirror of
https://github.com/KingKDot/PowerCrypt
synced 2026-06-06 16:04:30 +00:00
39 lines
1.2 KiB
C#
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();
|
|
}
|
|
}
|
|
}
|