.method public hidebysig instance string
KeyMd5(string str,
int32 t1) cil managed
{
// 代码大小 54 (0x36)
.maxstack 3
.locals init ([0] string md5str,
[1] int32 i,
[2] string CS$1$0000,
[3] bool CS$4$0001)
IL_0000: nop
IL_0001: ldarg.1
IL_0002: stloc.0
IL_0003: ldc.i4.0
IL_0004: stloc.1
IL_0005: br.s IL_0028
IL_0007: nop
IL_0008: ldloc.0
IL_0009: ldstr "MD5"
IL_000e: call string [System.Web]System.Web.Security.FormsAuthentication::HashPasswordForStoringInConfigFile(string,
string)
IL_0013: ldstr "A"
IL_0018: ldstr "F"
IL_001d: callvirt instance string [mscorlib]System.String::Replace(string,
string)
IL_0022: stloc.0
IL_0023: nop
IL_0024: ldloc.1
IL_0025: ldc.i4.1
IL_0026: add
IL_0027: stloc.1
IL_0028: ldloc.1
IL_0029: ldarg.2
IL_002a: clt
IL_002c: stloc.3
IL_002d: ldloc.3
IL_002e: brtrue.s IL_0007
IL_0030: ldloc.0
IL_0031: stloc.2
IL_0032: br.s IL_0034
IL_0034: ldloc.2
IL_0035: ret
} // end of method MyWebKey::KeyMd5
这段代码是什么意思。
KeyMd5(string str,
int32 t1) cil managed
{
// 代码大小 54 (0x36)
.maxstack 3
.locals init ([0] string md5str,
[1] int32 i,
[2] string CS$1$0000,
[3] bool CS$4$0001)
IL_0000: nop
IL_0001: ldarg.1
IL_0002: stloc.0
IL_0003: ldc.i4.0
IL_0004: stloc.1
IL_0005: br.s IL_0028
IL_0007: nop
IL_0008: ldloc.0
IL_0009: ldstr "MD5"
IL_000e: call string [System.Web]System.Web.Security.FormsAuthentication::HashPasswordForStoringInConfigFile(string,
string)
IL_0013: ldstr "A"
IL_0018: ldstr "F"
IL_001d: callvirt instance string [mscorlib]System.String::Replace(string,
string)
IL_0022: stloc.0
IL_0023: nop
IL_0024: ldloc.1
IL_0025: ldc.i4.1
IL_0026: add
IL_0027: stloc.1
IL_0028: ldloc.1
IL_0029: ldarg.2
IL_002a: clt
IL_002c: stloc.3
IL_002d: ldloc.3
IL_002e: brtrue.s IL_0007
IL_0030: ldloc.0
IL_0031: stloc.2
IL_0032: br.s IL_0034
IL_0034: ldloc.2
IL_0035: ret
} // end of method MyWebKey::KeyMd5
这段代码是什么意思。
String::Replace(string,
string)
密文:39C438BB7CD47DD8444B482798E56DF2
我试过把明文MD5后把A换成F,但是还是不对,大家继续研究。
ldarg.1 第一个参数入栈
stloc.0 栈顶元素出栈,并赋值给索引为0的变量
ldc.i4.0 一个4字节的整数,值为0,入栈
stloc.1 栈顶元素出栈,并赋值给索引为1的变量
....
....
楼主感兴趣自己上msdn学吧,看这个就是累点,但不难。
.NET中間語言(IL)