IL操作码修改
语言:VB.NET 3.5
IL 操作码:
718 ldarg.0
719 callvirt System.Windows.Forms.Button RClient.RClient::get_cmd1()
724 ldarg.0
725 ldfld System.String[] RClient.RClient::ButtonStrings
730 ldc.i4.5
731 ldelem.ref
732 callvirt System.Void System.Windows.Forms.ButtonBase::set_Text(System.String)
737 ldarg.0
对应于:
Me.cmd1.Text = Me.ButtonStrings(5)
至少我相信是这样。 我必须对 IL 进行哪些更改才能反映这一点:
Me.cmd1.Text = "some string"
Language: VB.NET 3.5
IL opcodes:
718 ldarg.0
719 callvirt System.Windows.Forms.Button RClient.RClient::get_cmd1()
724 ldarg.0
725 ldfld System.String[] RClient.RClient::ButtonStrings
730 ldc.i4.5
731 ldelem.ref
732 callvirt System.Void System.Windows.Forms.ButtonBase::set_Text(System.String)
737 ldarg.0
Corresponds to:
Me.cmd1.Text = Me.ButtonStrings(5)
At least I believe it does.
What changes to the IL would I have to make to reflect this instead:
Me.cmd1.Text = "some string"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第 1 行将
Me
压入堆栈。第 2 行执行方法get_cmd1
,该方法对应于堆栈顶部对象的属性cmd1
的 getter。因此,这一行将 gettercmd1
的结果从栈顶的对象中压入,从而在进程中弹出栈顶。第 3 行将字符串"some string"
压入堆栈。此时,堆栈顶部是字符串"some string"
,堆栈中的下一项是Me.cmd1
。第 4 行执行方法set_Text
,字符串参数位于堆栈顶部。这对应于堆栈上第二个项目的Text
设置器。堆栈上的第二项是Me.cmd1
。因此这些行相当于Me.cmd1.Text = "some string"
。Line 1 pushes
Me
onto the stack. Line 2 executes the methodget_cmd1
which corresponds to the getter for the propertycmd1
for the object on the top of the stack. So, this line pushes the result of the gettercmd1
from the object on the top of the stack, popping the top of the stack in the process. Line 3 pushes the string"some string"
on the stack. At this point the top of the stack is the string"some string"
and the next item on the stack isMe.cmd1
. Line 4 executes the methodset_Text
with string parameter being the top of the stack. This corresponds to the setter forText
for the second item on the stack. The second item on the stack isMe.cmd1
. So these lines are equivalent toMe.cmd1.Text = "some string"
.