Red Gate forums :: View topic - Dlls/ExcludePublicMembers: Private methods signature?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

Dlls/ExcludePublicMembers: Private methods signature?

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
mclarke



Joined: 01 Feb 2012
Posts: 6

PostPosted: Thu Feb 02, 2012 11:35 am    Post subject: Dlls/ExcludePublicMembers: Private methods signature? Reply with quote

Hi,

I'm obfuscating a DLL (SA 6.6.1.44) and I'm a little surprised that the signature of the private methods aren't changing. What I mean is if I had a class as follows:

Code:
public class MyImportantClass {
//... public stuff here

private void MyComplicatedMethod(object aNameThatGivesAClue) {
 //... important stuff here
}

}


The private method gets obfuscated to:

Code:
private void *unprintablecharacter*(object aNameThatGivesAClue) {
 //... obfuscated code, but with the object name everywhere!!
}


I would have expected something along the lines of:

Code:
private void *unprintablecharacter*(object xasih) {
 //... obfuscated code, unclear what xasih is for.
}



I don't know if I've overlooked something, so I'd like to clarify if I'm doing something wrong?

If not, as it makes the code that much more readable, could this be included as a feature please? The same behaviour happens if you specify ExcludePublicMembers in the .saproj file for an exe.

Martin
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 546

PostPosted: Fri Feb 03, 2012 12:09 pm    Post subject: Reply with quote

Can you try the pruning feature in addition please?
Back to top
View user's profile Send private message
mclarke



Joined: 01 Feb 2012
Posts: 6

PostPosted: Fri Feb 03, 2012 12:46 pm    Post subject: Reply with quote

Pruning doesn't seem to work where the parameter is opitonal.

For example...

Code:
    public class Program
    {
        public void DoIt()
        {
            MyImportantMethod();
            MyImportantMethod("Test");
        }
        private object MyImportantMethod(string AnImportantMethod = "Test")
        {

            if (AnImportantMethod != null && AnImportantMethod.Length < 5)
                // trivial...
                return new object();
            else
                // trivial...
                return null;

        }
    }


returns the following sig for the private method.

Code:
private object \u0001(string AnImportantMethod = "Test")
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 546

PostPosted: Mon Feb 06, 2012 4:35 pm    Post subject: Reply with quote

This is because it is now necessary to include this information at runtime.

I will ask our development team if we can improve the behaviour. I cannot promise anything, however.
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 546

PostPosted: Fri Feb 10, 2012 3:05 pm    Post subject: Reply with quote

I have been notified that this will categorically be fixed in the next product update- this is due in 1 month's time.
Back to top
View user's profile Send private message
dom.smith



Joined: 03 Jun 2010
Posts: 83
Location: Cambridge, UK

PostPosted: Fri Feb 10, 2012 5:25 pm    Post subject: Reply with quote

Hi Martin,

Just to update you on what Chris said, we're going to try to get a patch out for this at the start of next week (hopefully Monday 13th).

Thank you for reporting this.

Dom.
_________________
Dominic Smith,
Project Manager,
Red Gate Software.
Back to top
View user's profile Send private message
mclarke



Joined: 01 Feb 2012
Posts: 6

PostPosted: Mon Feb 13, 2012 10:20 am    Post subject: Reply with quote

Dom/Chris,

Thanks for the update, that is great news regarding a patch. Should I just keep an eye on the forum for the patch being released?

Thanks,
Martin
Back to top
View user's profile Send private message
dom.smith



Joined: 03 Jun 2010
Posts: 83
Location: Cambridge, UK

PostPosted: Mon Feb 13, 2012 10:41 am    Post subject: Reply with quote

I'll post an update in this thread when we release the patch but, yes, it will also be announced in a separate post on this forum.
_________________
Dominic Smith,
Project Manager,
Red Gate Software.
Back to top
View user's profile Send private message
dom.smith



Joined: 03 Jun 2010
Posts: 83
Location: Cambridge, UK

PostPosted: Wed Feb 15, 2012 7:24 pm    Post subject: Reply with quote

Hi Martin,

Just a quick update for you. You have probably noticed that we haven't managed to release SmartAssembly 6.2.2 quite as quickly as we'd hoped. We're now aiming to make this release on Friday. Again, I'll let you know here when that happens.

Sorry for the delay,

Dom.
_________________
Dominic Smith,
Project Manager,
Red Gate Software.
Back to top
View user's profile Send private message
mclarke



Joined: 01 Feb 2012
Posts: 6

PostPosted: Thu Feb 16, 2012 10:27 am    Post subject: Reply with quote

Thanks for the update Dom.
Back to top
View user's profile Send private message
dom.smith



Joined: 03 Jun 2010
Posts: 83
Location: Cambridge, UK

PostPosted: Fri Feb 17, 2012 4:58 pm    Post subject: Reply with quote

Hi Martin,

I've just released SmartAssembly 6.6.2.35. You should be able to download it by clicking on 'Check for updates' in SmartAssembly.

Thanks for your patience,

Dom.
_________________
Dominic Smith,
Project Manager,
Red Gate Software.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group