cmdlet pscmdlet dll obfuscation not possible with SA?

.NET obfuscator and automated error reporting

Moderators: Luke Jefferson, melvyn.harbour, dom.smith

cmdlet pscmdlet dll obfuscation not possible with SA?

Postby LiveForTechnology » Fri Feb 07, 2014 4:38 am

Hello,

I'm trying to determine whether SA can properly and fully obfuscate a csharp cmdlet dll including all strings methods etc. I've read conflicting info about dll's and public and whether or not SA can be forced to operate properly with examples of "ExcludePublicMembers" or "KeepPublicMembersAccessible". Are there parameters like these that are required for cmdlet dll's?

As popular as this product is I'm hoping someone can help answer whether a csharp dll implemented as a cmdlet or pscmdlet can be obfuscated with SA, or whether it requires a different obfuscator product?

Thank you for any help you can provide me!

Jaiden
LiveForTechnology
 
Posts: 3
Joined: Fri Feb 07, 2014 4:29 am

Postby jessica.ramos » Sat Feb 08, 2014 1:41 am

Hi Jaiden!

So long as the cmdlet DLL is purely managed, it can be processed and obfuscated by SmartAssembly.

However, SmartAssembly may not obfuscate *everything* in the DLL. It will automatically exclude anything from obfuscation that it thinks may break calls to the DLL--this means that it won't obfuscate any public members of the DLL (that is, assuming it is being obfuscated individually, rather than as a merged dependency of an EXE or other DLL).

There is no way to force the DLLs' public members to be obfuscated, I'm sorry to say. :/

Regarding the two attributes...
If you apply obfuscation to a DLL that has been merged to an EXE or other DLL, then its public members will become internal and SmartAssembly will obfuscate them by default. The KeepPublicMembersAccessible attribute allows for an easy way to turn this behavior off if you do want to keep the public members unobfuscated and accessible. (this attribute used to be 'ExcludePublicMembers' in older versions of SmartAssembly.)

I hope this helps and sorry for any confusion on this topic!
Jessica Ramos
Technical Support
Red Gate Software Ltd.
jessica.ramos
 
Posts: 235
Joined: Mon Apr 23, 2012 1:13 pm

Postby LiveForTechnology » Sun Feb 09, 2014 9:50 pm

So only when the option to do ANY level of "Control Flow Obfuscation" does the build of this cmdlet dll fail every time. If set to none but other settings left enabled, the build succeeds.

Here's the end of the log. Does this tell you anything as to what's causing this failure? Should SA be able to properly do control flow obfuscation on a net3.5 csharp cmdlet dll?


2014-02-09 14:35:39,892 INFO SmartAssembly.ProcessingAssembly: Obfuscating assembly code...
2014-02-09 14:35:40,001 ERROR SmartAssembly.ProcessingProject: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at System.Collections.ObjectModel.Collection`1.get_Item(Int32 index)
at ?.?.(IList`1 , Int32 )
at ?.?.( , IList`1 )
at ?.?.( )
at ..()
at ?.?.( )
at ?.?.( )
at ?..()
LiveForTechnology
 
Posts: 3
Joined: Fri Feb 07, 2014 4:29 am

Postby jessica.ramos » Mon Feb 10, 2014 7:58 pm

There aren't any known issues with cmdlet DLLs and SmartAssembly, but from the error you provided, it actually looks like you may be running into something else that we have seen before.. This particular bug is triggered by certain applications that have both Control Flow Obfuscation and the 'I want to reduce unused allocated memory' enabled.

Could you kindly try disabling the "unused allocated memory" option to see if that helps?

Please let us know how you get on!
Jessica Ramos
Technical Support
Red Gate Software Ltd.
jessica.ramos
 
Posts: 235
Joined: Mon Apr 23, 2012 1:13 pm

Postby LiveForTechnology » Tue Feb 11, 2014 2:42 am

Hi Jessica, that worked! That is really weird that it failed with the reduce memory allocation enabled but thank you! Is that going to be fixed in the next release?
LiveForTechnology
 
Posts: 3
Joined: Fri Feb 07, 2014 4:29 am

Postby jessica.ramos » Tue Feb 11, 2014 5:37 pm

So glad to hear that helped! : )

There's no timeline set for it yet, but sorry to say it might not be fixed in the near future as the devs are currently focusing on other tools.

Just a bit more information on reducing unused allocated memory: The memory optimization option works by releasing unused pages of memory back to the operating system when the application is idle. It doesn't really have a massive impact- you may find the application uses less memory but at a (slight) performance expense; so if memory usage is a ticking point for your particular application then it's worth trying, but for most applications it won't make too big of a difference
Jessica Ramos
Technical Support
Red Gate Software Ltd.
jessica.ramos
 
Posts: 235
Joined: Mon Apr 23, 2012 1:13 pm


Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 1 guest

cron