Obfuscating code with embbeded cursor resourse

  • Thread starter Thread starter Manel G
  • Start date Start date
M

Manel G

Hi

This line works both in the debug and release mode:

Me.Cursor = New Cursor(Me.GetType(), "NoCur.cur")


After obfuscating the release exe I got this error message:

System.ArgumentNullException: Value cannot be null.
Parameter name: dataStream
at System.Windows.Forms.Cursor..ctor(Stream stream)
at System.Windows.Forms.Cursor..ctor(Type type, String resource)


How can I change the code to work after obfuscation?


Thanks in advance

MG
 
Manel G said:
This line works both in the debug and release mode:

Me.Cursor = New Cursor(Me.GetType(), "NoCur.cur")


After obfuscating the release exe I got this error message:

System.ArgumentNullException: Value cannot be null.
Parameter name: dataStream
at System.Windows.Forms.Cursor..ctor(Stream stream)
at System.Windows.Forms.Cursor..ctor(Type type, String resource)


How can I change the code to work after obfuscation?

What options does your obfuscator give you in terms of obfuscation of
resources?
 
Jon said:
What options does your obfuscator give you in terms of obfuscation of
resources?

I am using the Dotfuscator Comunity Edition that comes with VS NET 2003.

I can't find 'NoCur.cur' in the Rename tree.

Thank you

MG
 
Manel G said:
I am using the Dotfuscator Comunity Edition that comes with VS NET 2003.

I haven't used that myself - does it give you any options?

I wonder whether the problem is that the type name itself has been
obfuscated, but the resource name *hasn't* been changed appropriately.
I can't find 'NoCur.cur' in the Rename tree.

If you run ildasm on the assembly and look in the resources, can you
find it there?
 
Jon said:
I haven't used that myself - does it give you any options?

I wonder whether the problem is that the type name itself has been
obfuscated, but the resource name *hasn't* been changed appropriately.




If you run ildasm on the assembly and look in the resources, can you
find it there?
Yes

Please don't take more time. I found an alternative syntaxe supported by
the Dotfuscator:

Me.Cursor = New Cursor(ResourceStream("NoCur.cur"))

ResourceStream is a function that returns a stream

Thanks for taking your time

MG
 
Back
Top