我试图通过ildassemble和修改MSIL代码来修改程序集(我的).我只想弹出一个MessageBox.
这是我的代码:
.module extern Fusion.dll
.module extern kernel32.dll
.module extern advapi32.dll
.module extern aspnet_state.exe
.module extern webengine.dll
.module extern aspnet_wp.exe
.module extern mscorwks.dll
.module extern ole32.dll
.module extern mscoree.dll
.module extern Netapi32.dll
.assembly extern mscorlib
{
...
...
IL_0052: ldstr "ahahahahahah"
IL_0057: callvirt instance [mscorlib]System.Windows.Forms.MessageBox::Show(string)
IL_005c: ldloc.0
IL_005d: ret
} // end of method
...
我没有错误,但MessageBox没有出现:\
谢谢你的帮助!
应该
ldstr "ahahahahahah"
call valuetype [System.Windows.Forms]System.Windows.Forms.DialogResult[System.Windows.Forms]System.Windows.Forms.MessageBox::Show(string)
pop
ret
Run Code Online (Sandbox Code Playgroud)
顺便说一句,MessageBox
不应该在Web应用程序中工作,因为它与桌面用户交互
您的代码有什么问题:
callvirt instance [mscorlib]System.Windows.Forms.MessageBox::Show(string)
Run Code Online (Sandbox Code Playgroud)
call
b)没有instance
System.Windows.Forms
,而不在mscorlib
pop
结果,因为你不需要它