.net MSIL代码问题
我试图通过ildassembling和修改MSIL代码来修改程序集(我的)。 我只想打开一个信息框 这是我的密码:.net MSIL代码问题,.net,cil,.net,Cil,我试图通过ildassembling和修改MSIL代码来修改程序集(我的)。 我只想打开一个信息框 这是我的密码: .module extern Fusion.dll .module extern kernel32.dll .module extern advapi32.dll .module extern aspnet\u state.exe .module extern webengine.dll .module extern aspnet\u wp.exe .module extern m
.module extern Fusion.dll
.module extern kernel32.dll
.module extern advapi32.dll
.module extern aspnet\u state.exe
.module extern webengine.dll
.module extern aspnet\u wp.exe
.module extern mscorwks.dll
.module extern ole32.dll
.module extern mscoree.dll
.module extern Netapi32.dll
.assembly extern mscorlib
{
…
…
IL\u 0052:ldstr“ahahahahahahah”
IL\u 0057:callvirt实例[mscorlib]System.Windows.Forms.MessageBox::Show(string)
IL\u 005c:ldloc.0
IL_005d:ret
}//方法结束
…
我没有错误,但是MessageBox没有出现:\
谢谢你的帮助 应该是
ldstr "ahahahahahah"
call valuetype [System.Windows.Forms]System.Windows.Forms.DialogResult[System.Windows.Forms]System.Windows.Forms.MessageBox::Show(string)
pop
ret
顺便说一句,MessageBox
不应该在web应用程序中工作,因为它与桌面用户交互
您的代码有什么问题:
callvirt instance [mscorlib]System.Windows.Forms.MessageBox::Show(string)
调用
b)没有实例
System.Windows.Forms
中,而不是mscorlib
pop
result,因为您不需要它MessageBox是System.windows.Forms.dll中的一个windows窗体函数,因此您需要为此添加一个外部程序并删除调用[mscorlib]位……但我认为这不会有什么帮助 ASPX页面将如何生成Winforms消息框? 您唯一可以做的就是发出Javascript“警报(消息)”以获取网页样式的消息框,但这不是通过修改MSIL轻松做到的 也许您应该添加如下内容:
call void [System]System.Diagnostics.Trace::Write(string)
通过对快速控制台应用程序进行反编译,消息框调用的工作方式如下:
ldstr "blah"
stloc.0
ldloc.0
call valuetype [System.Windows.Forms]System.Windows.Forms.DialogResult [System.Windows.Forms]System.Windows.Forms.MessageBox::Show(string)
pop
好的,谢谢你的帮助,现在更清楚了 如果无法从aspx文件中抛出MessageBox,我会尝试在文件中写入一些内容
IL_0034: ldstr "C:\\...\\WebSite1\\toto.txt"
IL_0039: newobj instance void [mscorlib]System.IO.StreamWriter::.ctor(string)
IL_003e: stloc.1
IL_003f: ldloc.1
IL_0040: ldstr "hello world"
IL_0045: callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string)
IL_004a: nop
IL_004b: ldloc.1
IL_004c: callvirt instance void [mscorlib]System.IO.TextWriter::Close()
IL_0051: nop
加载网页时没有错误或异常,但未创建或修改文件:\
我不明白为什么,因为如果我把同样的代码直接放在C#中的.aspx中,就可以了 否:(我确定它是一个web.net应用程序(file.aspx)