-
-
[求助] Quick way to crash Reflector .NET
-
发表于: 2010-6-24 01:31 1200
-
A quick way to 'protect' your code (or Howto crash Reflector .NET)
.method static object Foo(object obj)
{
ldarg.0
dup
brtrue.s L1
ret
L1:
callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
ret
}
While there is no way* you can write this in C#, it is still valid and verifiable IL.
I picked this up when writing an accessor for chained properties to do null checks without having to store and load from locals (which is a 'tad' more complex than the example shown above).
.method static object Foo(object obj)
{
ldarg.0
dup
brtrue.s L1
ret
L1:
callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
ret
}
While there is no way* you can write this in C#, it is still valid and verifiable IL.
I picked this up when writing an accessor for chained properties to do null checks without having to store and load from locals (which is a 'tad' more complex than the example shown above).
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)
赞赏
他的文章
看原图
赞赏
雪币:
留言: