注册算法 MD5
这是一个标准的MD5函数吗?这是某人在注册算法用到的C#函数。本人不懂C#,没法测试其运行结果,在将其对比查看VB的MD5函数时,总觉得它有问题。如:
obj15 = (short) 7;
object ac = -680876936;
md5_ff(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref obj15, ref ac);
这是第一轮循环的一次:ref obj15,ref ac就好像与正常的不一样!应该是ref ac,ref obj15。
作者是不是对MD5函数修改了,运行结果是非标准的MD5了?? 我在VB的对应位置把这两个调换一下,VB 中报错。
作者软件中的C#的MD5函数如下:
public static string md5(ref string smessage)
{
object obj10;
object obj12;
m_lonbits = 1;
m_lonbits = 3;
m_lonbits = 7;
m_lonbits = 15;
m_lonbits = 0x1f;
m_lonbits = 0x3f;
m_lonbits = 0x7f;
m_lonbits = 0xff;
m_lonbits = 0x1ff;
m_lonbits = 0x3ff;
m_lonbits = 0x7ff;
m_lonbits = 0xfff;
m_lonbits = 0x1fff;
m_lonbits = 0x3fff;
m_lonbits = 0x7fff;
m_lonbits = 0xffff;
m_lonbits = 0x1ffff;
m_lonbits = 0x3ffff;
m_lonbits = 0x7ffff;
m_lonbits = 0xfffff;
m_lonbits = 0x1fffff;
m_lonbits = 0x3fffff;
m_lonbits = 0x7fffff;
m_lonbits = 0xffffff;
m_lonbits = 0x1ffffff;
m_lonbits = 0x3ffffff;
m_lonbits = 0x7ffffff;
m_lonbits = 0xfffffff;
m_lonbits = 0x1fffffff;
m_lonbits = 0x3fffffff;
m_lonbits = 0x7fffffff;
m_l2power = 1;
m_l2power = 2;
m_l2power = 4;
m_l2power = 8;
m_l2power = 0x10;
m_l2power = 0x20;
m_l2power = 0x40;
m_l2power = 0x80;
m_l2power = 0x100;
m_l2power = 0x200;
m_l2power = 0x400;
m_l2power = 0x800;
m_l2power = 0x1000;
m_l2power = 0x2000;
m_l2power = 0x4000;
m_l2power = 0x8000;
m_l2power = 0x10000;
m_l2power = 0x20000;
m_l2power = 0x40000;
m_l2power = 0x80000;
m_l2power = 0x100000;
m_l2power = 0x200000;
m_l2power = 0x400000;
m_l2power = 0x800000;
m_l2power = 0x1000000;
m_l2power = 0x2000000;
m_l2power = 0x4000000;
m_l2power = 0x8000000;
m_l2power = 0x10000000;
m_l2power = 0x20000000;
m_l2power = 0x40000000;
object obj15 = smessage;
smessage = StringType.FromObject(obj15);
object[] objArray = (object[]) converttowordarray(ref obj15);
object obj2 = 0x67452301;
object obj4 = -271733879;
object obj6 = -1732584194;
object obj8 = 0x10325476;
if (FlowControl.ForLoopInitObj(obj10, 0, Information.UBound(objArray, 1), 0x10, ref obj12, ref obj10))
{
do
{
object objectValue = RuntimeHelpers.GetObjectValue(obj2);
object ly = RuntimeHelpers.GetObjectValue(obj4);
object obj7 = RuntimeHelpers.GetObjectValue(obj6);
object obj9 = RuntimeHelpers.GetObjectValue(obj8);
obj15 = (short) 7;
object ac = -680876936;
md5_ff(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref obj15, ref ac);
ac = (short) 12;
obj15 = -389564586;
md5_ff(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 0x11;
obj15 = 0x242070db;
md5_ff(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 0x16;
obj15 = -1044525330;
md5_ff(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 7;
obj15 = -176418897;
md5_ff(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 12;
obj15 = 0x4787c62a;
md5_ff(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 0x11;
obj15 = -1473231341;
md5_ff(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 0x16;
obj15 = -45705983;
md5_ff(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 7;
obj15 = 0x698098d8;
md5_ff(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 12;
obj15 = -1958414417;
md5_ff(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 0x11;
obj15 = -42063;
md5_ff(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 0x16;
obj15 = -1990404162;
md5_ff(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 7;
obj15 = 0x6b901122;
md5_ff(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 12;
obj15 = -40341101;
md5_ff(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 0x11;
obj15 = -1502002290;
md5_ff(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 0x16;
obj15 = 0x49b40821;
md5_ff(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 5;
obj15 = -165796510;
md5_gg(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 9;
obj15 = -1069501632;
md5_gg(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 14;
obj15 = 0x265e5a51;
md5_gg(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 20;
obj15 = -373897302;
md5_gg(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 5;
obj15 = -701558691;
md5_gg(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 9;
obj15 = 0x2441453;
md5_gg(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 14;
obj15 = -660478335;
md5_gg(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 20;
obj15 = -405537848;
md5_gg(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 5;
obj15 = 0x21e1cde6;
md5_gg(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 9;
obj15 = -1019803690;
md5_gg(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 14;
obj15 = -187363961;
md5_gg(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 20;
obj15 = 0x455a14ed;
md5_gg(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 5;
obj15 = -1444681467;
md5_gg(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 9;
obj15 = -51403784;
md5_gg(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 14;
obj15 = 0x676f02d9;
md5_gg(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 20;
obj15 = -1926607734;
md5_gg(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 4;
obj15 = -378558;
md5_hh(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 11;
obj15 = -2022574463;
md5_hh(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 0x10;
obj15 = 0x6d9d6122;
md5_hh(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 0x17;
obj15 = -35309556;
md5_hh(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 4;
obj15 = -1530992060;
md5_hh(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 11;
obj15 = 0x4bdecfa9;
md5_hh(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 0x10;
obj15 = -155497632;
md5_hh(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 0x17;
obj15 = -1094730640;
md5_hh(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 4;
obj15 = 0x289b7ec6;
md5_hh(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 11;
obj15 = -358537222;
md5_hh(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 0x10;
obj15 = -722521979;
md5_hh(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 0x17;
obj15 = 0x4881d05;
md5_hh(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 4;
obj15 = -640364487;
md5_hh(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 11;
obj15 = -421815835;
md5_hh(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 0x10;
obj15 = 0x1fa27cf8;
md5_hh(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 0x17;
obj15 = -995338651;
md5_hh(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 6;
obj15 = -198630844;
md5_ii(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 10;
obj15 = 0x432aff97;
md5_ii(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 15;
obj15 = -1416354905;
md5_ii(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 0x15;
obj15 = -57434055;
md5_ii(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 6;
obj15 = 0x655b59c3;
md5_ii(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 10;
obj15 = -1894986606;
md5_ii(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 15;
obj15 = -1051523;
md5_ii(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 0x15;
obj15 = -2054922799;
md5_ii(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 6;
obj15 = 0x6fa87e4f;
md5_ii(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 10;
obj15 = -30611744;
md5_ii(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 15;
obj15 = -1560198380;
md5_ii(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 0x15;
obj15 = 0x4e0811a1;
md5_ii(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
ac = (short) 6;
obj15 = -145523070;
md5_ii(ref obj2, ref obj4, ref obj6, ref obj8, ref objArray, ref ac, ref obj15);
ac = (short) 10;
obj15 = -1120210379;
md5_ii(ref obj8, ref obj2, ref obj4, ref obj6, ref objArray, ref ac, ref obj15);
ac = (short) 15;
obj15 = 0x2ad7d2bb;
md5_ii(ref obj6, ref obj8, ref obj2, ref obj4, ref objArray, ref ac, ref obj15);
ac = (short) 0x15;
obj15 = -343485551;
md5_ii(ref obj4, ref obj6, ref obj8, ref obj2, ref objArray, ref ac, ref obj15);
obj2 = RuntimeHelpers.GetObjectValue(addunsigned(ref obj2, ref objectValue));
obj4 = RuntimeHelpers.GetObjectValue(addunsigned(ref obj4, ref ly));
obj6 = RuntimeHelpers.GetObjectValue(addunsigned(ref obj6, ref obj7));
obj8 = RuntimeHelpers.GetObjectValue(addunsigned(ref obj8, ref obj9));
}
while (FlowControl.ForNextCheckObj(obj10, obj12, ref obj10));
}
return Strings.UCase(Strings.LCase(wordtohex(ref obj2) + wordtohex(ref obj4) + wordtohex(ref obj6) + wordtohex(ref obj8)));
}
另:
if (StringType.StrCmp(psw, StringType.FromInteger((IntegerType.FromString(ModRegister.gstrZhucema) ^ 0x4294bf) + 0x173fe5), false) != 0)
{
goto Label_0050;
}
我把StringType.FromInteger((IntegerType.FromString(ModRegister.gstrZhucema) ^ 0x4294bf) + 0x173fe5)
在VB中直接转换为:
AA = Val(funcGetZhucema(Text1.Text)) Xor 4363455 (4363455是0x4294bf转的十进制,直接用Xor 0x4294bf出错,所以转换了)
Text2.Text = AA + 1523685 (1523685是0x173fe5转的十进制,直接用Xor 0x173fe5出错,所以转换了)
对吗??
最后运行出的结果与原软件有出入??总不对。。
[ 本帖最后由 xxhkzyt 于 2009-11-20 11:26 编辑 ] MD5算法有标准的,还有非标的,有的软件采用非标准的MD5验证,所以要看好是不是标准的MD5才行。 谢谢2楼回复,能帮看一下吗?确认是不是标准的MD5?如果不是怎么把其转换为对应的VB代码。就应该不麻烦吧。如果看懂。我可以把VB的MD5函数贴上来。对比看。 编译一下,与常规的计算器对比一下结果就知道标不标了 问题是我编译时,总出错。。。对C#不太了解。。。
问题如下:
---------- complier ----------
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
md5.cs(1,15): error CS1518: Expected class, delegate, enum, inte**ce, or struct
md5.cs(5,11): error CS1001: Identifier expected
md5.cs(6,11): error CS1001: Identifier expected
md5.cs(7,11): error CS1001: Identifier expected
md5.cs(8,11): error CS1001: Identifier expected
md5.cs(9,11): error CS1001: Identifier expected
md5.cs(10,11): error CS1001: Identifier expected
md5.cs(11,11): error CS1001: Identifier expected
。。。。。。。。。。。。。。。。。。。。。。。。。。。
md5.cs(69,30): error CS1518: Expected class, delegate, enum, inte**ce, or struct
md5.cs(84,113): error CS1518: Expected class, delegate, enum, inte**ce, or struct
md5.cs(87,113): error CS1518: Expected class, delegate, enum, inte**ce, or struct
md5.cs(90,113): error CS1518: Expected class, delegate, enum, inte**ce, or struct
md5.cs(93,113): error CS1518: Expected class, delegate, enum, inte**ce, or struct
md5.cs(96,113): error CS1518: Expected class, delegate, enum, inte**ce, or struct
md5.cs(99,113): error CS1518: Expected class, delegate, enum, inte**ce, or struct
md5.cs(102,113): error CS1518: Expected class, delegate, enum, inte**ce, or struct
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
md5.cs(278,1): error CS1022: Type or namespace definition, or end-of-file expected
md5.cs(6,10): error CS0101: The namespace '<global namespace>' already contains a definition for '?'
md5.cs(5,10): (Location of symbol related to previous error)
md5.cs(7,10): error CS0101: The namespace '<global namespace>' already contains a definition for '?'
md5.cs(5,10): (Location of symbol related to previous error)
md5.cs(8,10): error CS0101: The namespace '<global namespace>' already contains a definition for '?'
md5.cs(5,10): (Location of symbol related to previous error)
md5.cs(9,10): error CS0101: The namespace '<global namespace>' already contains a definition for '?'
md5.cs(5,10): (Location of symbol related to previous error)
md5.cs(10,10): error CS0101: The namespace '<global namespace>' already contains a definition for '?'
。。。。。。。。。。。。。。。。。 学习一下:/:014
页:
[1]