拜托大神帮忙写下算号程序
本帖最后由 zyjsuper 于 2021-8-2 22:34 编辑C#源码:
internal static class Class1
{
// Token: 0x06000072 RID: 114 RVA: 0x0000A274 File Offset: 0x00008474
public static string smethod_0(string string_0)
{
if (string_0.IndexOf('-') < 0)
{
return string_0;
}
string str = "DBV";
string_0 = string_0.Replace("-", string.Empty);
string_0 = string_0.Replace('Q', '4');
string_0 = string_0.Replace('G', '4');
string_0 = string_0.Replace('V', '0');
string_0 = string_0.Replace('N', '3');
str + string_0;
byte[] array = new byte;
for (int i = 0; i < string_0.Length; i += 2)
{
byte b;
byte.TryParse(new string(new char[]
{
string_0,
string_0
}), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out b);
array = b;
}
string text = Encoding.ASCII.GetString(array);
text = text.Insert(1, ":");
text = text.Insert(5, ":");
text = text.Insert(9, ":");
if (text.Length > 13)
{
text = text.Insert(13, ":");
}
return text;
}
// Token: 0x06000073 RID: 115 RVA: 0x0000A384 File Offset: 0x00008584
public static bool smethod_1(string string_0)
{
bool flag = true;
string a = string_0.Substring(4, 5);
if (a == "IALV")
{
flag = false;
}
if (string_0 != 'F')
{
flag = false;
}
int num = int.Parse(string_0.ToString(), NumberStyles.HexNumber);
if (num > 16)
{
flag = false;
}
if (a != "I:ALV")
{
flag = false;
}
num = int.Parse(string_0.ToString(), NumberStyles.HexNumber);
if (num > 16)
{
flag = false;
}
if (!int.TryParse(string_0.Substring(10, 3), out num))
{
flag = false;
}
if (string_0.Length <= 14)
{
throw new ApplicationException("Invalid Unlock Code");
}
int num2 = int.Parse(string_0.Substring(15, 1));
if (num2 != 2 && num2 != 3)
{
throw new ApplicationException("Incorrect Code for Version");
}
string s = string_0.Substring(0, 16);
string b = string_0.Substring(16);
int num3 = 0;
byte[] bytes = Encoding.ASCII.GetBytes(s);
for (int i = 0; i < bytes.Length; i++)
{
if (bytes % 2 == 0)
{
num3++;
}
}
return !(num3.ToString("00") != b) && flag;
}
}
自己整理的python代码,只是按照源码转义,不具备算号能力
class generate_unlockcode:
def smethod_0(self,string_0):
if string_0.count('-') < 0:
return string_0
#str_pre = 'DBV'
string_0 = string_0.replace("-", "")
string_0 = string_0.replace('Q', '4')
string_0 = string_0.replace('G', '4')
string_0 = string_0.replace('V', '0')
string_0 = string_0.replace('N', '3')
#string_0 = str_pre + string_0
b = []
for i in range(0, len(string_0), 2):
b.append(string_0)
#print(b)
try:
result =
result.insert(1,':')
result.insert(5,':')
result.insert(9,':')
if len(result)> 13:
result.insert(13,':')
result = ''.join(result)
return result
except:
pass
def smethod_1(self):
string_0 = self.smethod_0('46363449414C56-39343434333132')
flag = True
a = string_0
if a == "IALV":
flag = False
return flag
if string_0 != 'F':
flag = False
return flag
num = int(str(string_0),16)
if num > 16:
flag = False
return flag
if a != "I:ALV":
flag = False
return flag
num1 = int(str(string_0), 16)
if num1 > 16:
flag = False
return flag
str1 = string_0
#print(str1.isdecimal())
if str1.isdecimal() == False:
flag = False
return flag
if len(string_0) <= 14:
print("Invalid Unlock Code")
flag = False
return flag
num2 = int(string_0)
if num2 != 2 and num2 != 3:
print("Incorrect Code for Version")
flag = False
return flag
result = []
s = string_0
b = string_0
num3 = 0
for i in s:
if i.isdecimal() != True:
result.append(ord(i))
else:
result.append(int(i,16))
for i in range(0,len(result)):
if result %2 == 0:
num3 += 1
if int(num3) != int(b):
flag = False
print(flag)
return flag
if __name__ == '__main__':
obj = generate_unlockcode()
obj.smethod_1()
支持一下不会C语言 什么软件的算号程序啊 有点看不懂啊,一句注释都没有 你转义的怎么多出来一组字串? 免費勞力啊 什麽程序 發出來玩 这些个计算和机器码长度也有关系的,这些参数没有,人家帮你写也和你给出来的代码一样,只能修复中间那一个错 误罢了
页:
[1]