473,324 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Dotfuscator and reflect methods

Hi All,

I am a newbie to dotfuscator. I am trying to dotfuscate my application.
Everything seems ok except that when I try to run a method that has the
following command

poMsgObj.GetType()).GetMethod(psAfterMsg).Invoke(p oMsgObj,new string []
{asSelectedValue};

I got an error saying "Object reference not set to an instance of an
object". I don't know what I can do in order to get the dotfuscated
application to work. Please help!!
Nov 17 '05 #1
3 4654
The problem is that the obfuscation changes the names of types and methods (even
for reflection). The "psAfterMsg" probably contains the name of the method
before obfuscation and thus it doesn't match after obfuscation.

Here are some options:
1) Don't obfuscate methods that are used for reflection - I believe you can turn
off obfuscation for certain methods using the configuration files

2) Attach a custom attribute to the method that you can use to find it even if
its name gets obfuscated. Instead of GetMethod, you would search using the
custom attribute

Hope this helps.

--
Rodger Constandse

<http://www.SequenceDiagramEditor.com>
Sequence Diagram Editor - A quick and easy way to draw and edit sequence diagrams

Alan Mok wrote:
Hi All,

I am a newbie to dotfuscator. I am trying to dotfuscate my application.
Everything seems ok except that when I try to run a method that has the
following command

poMsgObj.GetType()).GetMethod(psAfterMsg).Invoke(p oMsgObj,new string []
{asSelectedValue};

I got an error saying "Object reference not set to an instance of an
object". I don't know what I can do in order to get the dotfuscated
application to work. Please help!!

Nov 17 '05 #2
How do you add the custom attribute?

"Rodger Constandse" wrote:
The problem is that the obfuscation changes the names of types and methods (even
for reflection). The "psAfterMsg" probably contains the name of the method
before obfuscation and thus it doesn't match after obfuscation.

Here are some options:
1) Don't obfuscate methods that are used for reflection - I believe you can turn
off obfuscation for certain methods using the configuration files

2) Attach a custom attribute to the method that you can use to find it even if
its name gets obfuscated. Instead of GetMethod, you would search using the
custom attribute

Hope this helps.

--
Rodger Constandse

<http://www.SequenceDiagramEditor.com>
Sequence Diagram Editor - A quick and easy way to draw and edit sequence diagrams

Alan Mok wrote:
Hi All,

I am a newbie to dotfuscator. I am trying to dotfuscate my application.
Everything seems ok except that when I try to run a method that has the
following command

poMsgObj.GetType()).GetMethod(psAfterMsg).Invoke(p oMsgObj,new string []
{asSelectedValue};

I got an error saying "Object reference not set to an instance of an
object". I don't know what I can do in order to get the dotfuscated
application to work. Please help!!

Nov 17 '05 #3
Also, I looked in some documents for dotfuscator, they mentioned that
dotfuscator will handle those renaming automatically. So does it mean it is
not really the case?

Thx

"Rodger Constandse" wrote:
The problem is that the obfuscation changes the names of types and methods (even
for reflection). The "psAfterMsg" probably contains the name of the method
before obfuscation and thus it doesn't match after obfuscation.

Here are some options:
1) Don't obfuscate methods that are used for reflection - I believe you can turn
off obfuscation for certain methods using the configuration files

2) Attach a custom attribute to the method that you can use to find it even if
its name gets obfuscated. Instead of GetMethod, you would search using the
custom attribute

Hope this helps.

--
Rodger Constandse

<http://www.SequenceDiagramEditor.com>
Sequence Diagram Editor - A quick and easy way to draw and edit sequence diagrams

Alan Mok wrote:
Hi All,

I am a newbie to dotfuscator. I am trying to dotfuscate my application.
Everything seems ok except that when I try to run a method that has the
following command

poMsgObj.GetType()).GetMethod(psAfterMsg).Invoke(p oMsgObj,new string []
{asSelectedValue};

I got an error saying "Object reference not set to an instance of an
object". I don't know what I can do in order to get the dotfuscated
application to work. Please help!!

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Darren | last post by:
OK, I'm trying to understand the need for this. If I understand correctly without this anyone can reverse engineer and obtain the source code of my application - is this correct? And this tool will...
1
by: John | last post by:
Hi, Does Dotfuscator really work? I mean is there no way to decompile your program when it's done? Or does it just make it more difficult to work with the decompiled code? Also, is there...
0
by: venky | last post by:
How can i integrate dotfuscator with my solution projects. Like when i build projects in my solution using visual studio.net, i want to be build using dotfuscator. Like i have a setup project...
3
by: Tom Bean | last post by:
I am using Dotfuscator Community Edition to obfuscate an application for Pocket PC written in C#. When I made the first pass with Dotfuscator, the app threw a MissingManifestResourceException. Of...
9
by: Just D. | last post by:
Guys, What's the current situation with obfuscating, dotfuscating, encryption and other tricks that we could do to .NET applications before deployment? It wasn't very good a year ago, was...
2
by: Tina | last post by:
I have a dll created from an asp.net component I wrote. I want to distribute it to other developers but I'm told it can be reverse engineered. I read the docs on dotfuscator thinking that this...
1
by: Tina | last post by:
I found the dotfuscator GUI interface. It wants me to open an xml file. My component project has no xml file. Also, is there a specific forum for dotfuscator issues? It's not mentioned in any...
4
by: scorpion53061 | last post by:
How can we obfuscate without disabling renaming and using a setup project a project which includes a custom dll? If I attempt to do so after I change the reference path to the obfuscated dll...
2
by: Andrew E Chapman | last post by:
Apologies if this seems to be a silly question, but... .... is there anything that can be done to stop other people from using your DLLs? For example, if you have a solution with three projects:...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.