Arr = Split(Mw, "-")
Tmp1 = Split(Arr(0), ".")
Tmp2 = Split(Arr(1), ".")
For i = 0 To UBound(Tmp1)
Jm = (Tmp1(i) + i + 2) / (i + 2)
Js1 = Js1 + Jm
Next
Str = Js1 & "c2lf"
此处为VBA的逆向参数的示例代码
三、GetInfo注册程序
我们现在来看看GetInfo注册验证的过程。
[Asm] 纯文本查看复制代码
public static bool GetInfo(string Key, ref int WMin, ref int WMax, ref int HMin, ref int HMax)
{
string[] array = Key.Split(new char[]
{
'-'
});
if (array.Count<string>() != 4)
{
WMin = 1;
WMax = 1;
HMin = 1;
HMax = 1;
return false;
}
object[] array2 = new object[4];
int num = 0;
do
{
array2[num] = Conversion.Val(array[num]);
num++;
}
while (num <= 3);
ManagementObjectSearcher managementObjectSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive");
ulong num2;
try
{
ManagementObjectCollection.ManagementObjectEnumerator enumerator = managementObjectSearcher.Get().GetEnumerator();
if (enumerator.MoveNext())
{
ManagementBaseObject managementBaseObject = enumerator.Current;
if (managementBaseObject["signature"] != null)
{
string text = managementBaseObject["signature"].ToString() + "c2lf";
int i = 0;
int length = text.Length;
while (i < length)
{
char @string = text[i];
num2 = Convert.ToUInt64(decimal.Add(new decimal(num2), new decimal(Strings.Asc(@string))));
i++;
}
}
else if (managementBaseObject["serialnumber"] != null)
{
string text2 = managementBaseObject["serialnumber"].ToString() + "c2lf";
int j = 0;
int length2 = text2.Length;
while (j < length2)
{
char string2 = text2[j];
num2 = Convert.ToUInt64(decimal.Add(new decimal(num2), new decimal(Strings.Asc(string2))));
j++;
}
}
else
{
string text3 = "479583c2lf";
int k = 0;
int length3 = text3.Length;
while (k < length3)
{
char string3 = text3[k];
num2 = Convert.ToUInt64(decimal.Add(new decimal(num2), new decimal(Strings.Asc(string3))));
k++;
}
}
}
}
finally
{
ManagementObjectCollection.ManagementObjectEnumerator enumerator;
if (enumerator != null)
{
((IDisposable)enumerator).Dispose();
}
}
ulong num3 = 1UL;
string text4 = num2.ToString() + "c2lf";
int l = 0;
int length4 = text4.Length;
while (l < length4)
{
char string4 = text4[l];
num3 = Convert.ToUInt64(decimal.Multiply(new decimal(num3), new decimal(Strings.Asc(string4))));
l++;
}
ManagementObjectSearcher managementObjectSearcher2 = new ManagementObjectSearcher("SELECT * FROM Win32_Processor");
ulong num4;
try
{
foreach (ManagementBaseObject managementBaseObject2 in managementObjectSearcher2.Get())
{
string text5 = managementBaseObject2["ProcessorId"].ToString() + "c2lf";
int m = 0;
int length5 = text5.Length;
while (m < length5)
{
char string5 = text5[m];
num4 = Convert.ToUInt64(decimal.Add(new decimal(num4), new decimal(Strings.Asc(string5))));
m++;
}
}
}
finally
{
ManagementObjectCollection.ManagementObjectEnumerator enumerator2;
if (enumerator2 != null)
{
((IDisposable)enumerator2).Dispose();
}
}
ulong num5 = 1UL;
string text6 = num4.ToString() + "c2lf";
int n = 0;
int length6 = text6.Length;
while (n < length6)
{
char string6 = text6[n];
num5 = Convert.ToUInt64(decimal.Multiply(new decimal(num5), new decimal(Strings.Asc(string6))));
n++;
}
if (Operators.ConditionalCompareObjectEqual(Operators.ModObject(array2[0], num2), 0, false) && Operators.ConditionalCompareObjectGreater(Operators.IntDivideObject(array2[0], num2), 0, false) && Operators.ConditionalCompareObjectEqual(Operators.ModObject(array2[1], num3), 0, false) && Operators.ConditionalCompareObjectGreater(Operators.IntDivideObject(array2[1], num3), 0, false) && Operators.ConditionalCompareObjectEqual(Operators.ModObject(array2[2], num4), 0, false) && Operators.ConditionalCompareObjectGreater(Operators.IntDivideObject(array2[2], num4), 0, false) && Operators.ConditionalCompareObjectEqual(Operators.ModObject(array2[3], num5), 0, false) && Operators.ConditionalCompareObjectGreater(Operators.IntDivideObject(array2[3], num5), 0, false))
{
WMin = Conversions.ToInteger(Operators.IntDivideObject(array2[0], num2));
WMax = Conversions.ToInteger(Operators.IntDivideObject(array2[1], num3));
HMin = Conversions.ToInteger(Operators.IntDivideObject(array2[2], num4));
HMax = Conversions.ToInteger(Operators.IntDivideObject(array2[3], num5));
return true;
}
WMin = 1;
WMax = 1;
HMin = 1;
HMax = 1;
return false;
}
public static string GenToKey(string Key, int WMin, int WMax, int HMin, int HMax)
此处的函数,有几个参数,一个是Key,就是我们的假码,以及WMin、WMax、HMin、HMax,这几个参数,分别表示水平、垂直画面。
该条函数的验证过程为,
num=2的参数用来计算水平画面的数量,Num=3的参数用来计算垂直画面的数量。
[Asm] 纯文本查看复制代码
{
string[] array = Key.Split(new char[]
{
'-'
});
if (array.Count<string>() != 4)
{
WMin = 1;
WMax = 1;
HMin = 1;
HMax = 1;
return false;
}
object[] array2 = new object[4];
int num = 0;
do
{
array2[num] = Conversion.Val(array[num]);
num++;
}
while (num <= 3);
此处将假码split进数组Array2,用于和计算出来的真码进行对比。
[Asm] 纯文本查看复制代码
ManagementBaseObject managementBaseObject = enumerator.Current;
if (managementBaseObject["signature"] != null)
{
string text = managementBaseObject["signature"].ToString() + "c2lf";
int i = 0;
int length = text.Length;
while (i < length)
{
char @string = text[i];
num2 = Convert.ToUInt64(decimal.Add(new decimal(num2), new decimal(Strings.Asc(@string))));
i++;
}
}