| Author |
Message |
sergey
Joined: 02 Dec 2010 Posts: 1
|
Posted: Thu Dec 02, 2010 12:46 pm Post subject: Obfuscation problem |
|
|
Hi guys,
I am using SmartAssembly 5.5 to obfuscate my assembly and it seems an unexpected problem occurred: A few internal classes and enums is partially obfuscated - namespace and class name aren't changed after obfuscation, although their members in classes are obfuscated and the ones aren't obfuscated in enums. Nevertheless, other internal classes in my code were obfuscated normally. I cannot found any differences for these classes in source code. Could you explain me what is the reason of this problem?
| Code: |
namespace Html.Model
{
internal enum TextVAlignType
{
Baseline,
Bottom,
Middle,
Top,
Sub,
Super,
TextBottom,
TextTop
}
}
|
or
| Code: |
internal class SupportClass {
...
}
|
Here is my sa project
| Code: |
SmartAssemblyProject ProjectId="{ae26c659-45c9-4856-9773-bda43a46f02d}" Version="2.0">
<MainAssemblyFileName>..\..\build-out\NET20\MyAssembly.dll</MainAssemblyFileName>
<FriendlyName>MyAssembly</FriendlyName>
<CompanyName>MyAssembly</CompanyName>
<Configuration Name="Release">
<ApplicationName>MyAssembly</ApplicationName>
<Destination DestinationFileName="..\..\build-out\Obfuscated\NET20\MyAssembly.dll" />
<Assemblies>
<Assembly AssemblyName="MyAssembly, Culture=neutral, PublicKeyToken=716fcc553a201e56">
<Merging>
<ResourcesCompression Compress="1" />
<MemberRefsProxy Proxy="0" />
<Pruning Prune="1">
<Exclusion />
</Pruning>
<Obfuscation Obfuscate="1">
<Exclusion />
</Obfuscation>
<ControlFlow Obfuscate="1" ObfuscationLevel="2" />
<ResourcesPruning />
</Merging>
</Assembly>
<Assembly AssemblyName="{smartassembly}.ResourceResolver, Culture=neutral, PublicKeyToken=7f465a1c156d4d57">
<Merging>
<Obfuscation>
<Exclusion />
</Obfuscation>
</Merging>
</Assembly>
<Assembly AssemblyName="SmartAssembly.AssemblyResolver, Culture=neutral, PublicKeyToken=7f465a1c156d4d57">
<Merging>
<Obfuscation>
<Exclusion />
</Obfuscation>
</Merging>
</Assembly>
<Assembly AssemblyName="SmartAssembly.StringsEncoding, Culture=neutral, PublicKeyToken=7f465a1c156d4d57">
<Merging>
<Obfuscation>
<Exclusion />
</Obfuscation>
</Merging>
</Assembly>
<Assembly AssemblyName="SmartAssembly.Zip, Culture=neutral, PublicKeyToken=7f465a1c156d4d57">
<Merging>
<Obfuscation>
<Exclusion />
</Obfuscation>
</Merging>
</Assembly>
</Assemblies>
<Options>
<Obfuscation FieldsNameMangling="2" NameMangling="2" />
<ExceptionReporting ReportExceptions="0" Template="res:{SmartExceptions}.1033.dll" />
<StrongNameSigning KeyFileName="..\..\src\MyKey.snk" Sign="1" />
<OtherProtections SuppressIldasm="1" />
<StringsEncoding Compress="1" Encode="1" />
<OtherOptimizations SealClasses="0" />
<Debugging />
</Options>
</Configuration>
</SmartAssemblyProject>
|
Thanks,
Sergey |
|
| Back to top |
|
 |
CodeGuru
Joined: 22 Nov 2010 Posts: 7
|
Posted: Thu Dec 02, 2010 8:10 pm Post subject: |
|
|
If you .ToString() an enum, the enum and its class won't get obfuscated.
I've made a post about it here, and also submitted the working example to SA. |
|
| Back to top |
|
 |
nick.maidment
Joined: 29 Jan 2010 Posts: 74
|
Posted: Fri Dec 03, 2010 10:56 am Post subject: |
|
|
Yes, it would seem that if at any point you have a call to Format, GetName, GetNames, Parse, or ToString on an Enum, SA decides to not obfuscate it  |
|
| Back to top |
|
 |
|
|
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