Object reference not set to an instance of object

Explore, browse and analyze .NET assemblies

Moderators: Luke Jefferson, Charles Brown, StephenC, Alex.Davies, Greg.Tillman, melvyn.harbour

Object reference not set to an instance of object

Postby alehandro » Tue Nov 16, 2010 12:22 am

Hi, interesting bug found

while decompiling one deobfuscated dll I've found that Reflector cant handle a tricky case.

Description:

Please refer to the assembly.
For some methods of c0000a0, for example, "aqc10xGJ6", it has a custom attribute:

.custom /*0C00052B:060009FA*/ instance void NS021.c0000a0/*020000A0*//attr161Attribute/*020000A1*/::.ctor(object) /* 060009FA */
= {object(type(class 'c0000a2[[System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]][]'))}
// = ( 01 00 50 67 63 30 30 30 30 61 32 5B 5B 53 79 73 // ..Pgc0000a2[[Sys
// 74 65 6D 2E 4F 62 6A 65 63 74 2C 20 6D 73 63 6F // tem.Object, msco
// 72 6C 69 62 2C 20 56 65 72 73 69 6F 6E 3D 32 2E // rlib, Version=2.
// 30 2E 30 2E 30 2C 20 43 75 6C 74 75 72 65 3D 6E // 0.0.0, Culture=n
// 65 75 74 72 61 6C 2C 20 50 75 62 6C 69 63 4B 65 // eutral, PublicKe
// 79 54 6F 6B 65 6E 3D 62 37 37 61 35 63 35 36 31 // yToken=b77a5c561
// 39 33 34 65 30 38 39 5D 5D 5B 5D 00 00 ) // 934e089]][]..

When .Net Reflector read this custom attribute, it try to parse "b77a5c561934e089]]" as PublicKeyToken, so internal exception occurs and prevent it from decompiling the method.

If you remove the custom attribute, the method should be ok in Reflector.

here is the deobfuscated assembly
http://www.multiupload.com/JG51HXCKME

Please let me know if Reflector could understand that custom attribute is not a real PublicKeyToken so it stop crashing on lots of assemblies!
alehandro
 
Posts: 35
Joined: Tue Nov 16, 2010 12:08 am

Postby Clive Tong » Tue Nov 16, 2010 9:25 am

Thanks for reporting this.

As you say, the token parsing code is trying to parse the hex values of the token with the ]] appended.

I've logged it in our bug tracking database as issue 774.
Clive Tong
 
Posts: 283
Joined: Thu Dec 04, 2008 5:42 pm

Re:

Postby alehandro » Tue Nov 16, 2010 12:50 pm

Clive Tong wrote:Thanks for reporting this.

As you say, the token parsing code is trying to parse the hex values of the token with the ]] appended.

I've logged it in our bug tracking database as issue 774.


Hi, Clive
Thanks for your reply
Are there any schedules for releasing new version?
alehandro
 
Posts: 35
Joined: Tue Nov 16, 2010 12:08 am

Postby Clive Tong » Tue Nov 16, 2010 2:47 pm

It should be fixed for the next EAP release. That will probably be in the next couple of months.
Clive Tong
 
Posts: 283
Joined: Thu Dec 04, 2008 5:42 pm

Re:

Postby alehandro » Tue Nov 16, 2010 3:05 pm

Clive Tong wrote:It should be fixed for the next EAP release. That will probably be in the next couple of months.


Last question: it'll be fixed for both products (Refl & Refl Pro) ?
alehandro
 
Posts: 35
Joined: Tue Nov 16, 2010 12:08 am

Postby Clive Tong » Tue Nov 16, 2010 3:10 pm

Yes.
Clive Tong
 
Posts: 283
Joined: Thu Dec 04, 2008 5:42 pm

Re:

Postby nmpham » Wed Nov 17, 2010 9:57 am

Clive Tong wrote:It should be fixed for the next EAP release. That will probably be in the next couple of months.


Can we have a hotfix for this, because Reflector crashes on a lot of assembly now
nmpham
 
Posts: 12
Joined: Tue Jun 28, 2005 2:23 pm


Return to .Net Reflector 6.x and .NET Reflector 6.x Pro

Who is online

Users browsing this forum: No registered users and 1 guest