DeployLX Software Protection System

Veil Task

The VeilProject task performs the actual veiling of a CVP project.

<UsingTask AssemblyFile="$(TasksPath)\DeployLX.CodeVeil.MSBuild.v5.dll" 
           TaskName="Veil" />

<Veil
    Projects="projects"
    Ui="true|false"
    Notifications="None|Error|Warning|Batch|Primary|Secondary|Parsing|Verbose"
    Threads="number"
    StrongName="path"
    Backup="true|false"
    RootPath="path"
    SearchPaths="paths"
    OutputPath="path"
    CollectReferences="None|Private|System|Gac|All"
    Obfuscate="true|false"
    Rules="rules"
    SupportExceptionMapper="true|false"
    AddDiagnosticInfo="true|false"
    EncryptMsil="true|false"
    DisableMsilEncryption="true|false"
    EncryptStrings="true|false"
    EncryptResources="true|false"
    CompressResources="true|false"
    ProcessSatelliteAssemblies="true|false"
    KillReflectors="true|false"
    KillDebuggers="true|false"
    KillProfilers="true|false">
    
    <Output TaskParameter="VeiledAssemblies"
            ItemName="ProjectVeiledAssemblies" />
</Veil> 

Attributes

AddDiagnosticInfo true|false

Indicates if CodeVeil should add attributes to the veiled assembly with the original un-obfuscated name. Used to diagnose naming issues during development.

Assemblies ItemGroup

Collection of assemblies to veil.

Bakcup true|false

Indicates if original assemblies should be backed up before veiling.

CollectReferences None | Private | System | Gac | All

Determine how dependent assemblies should be collected. During the veiling process matching dependent assemblies will be copied to the OutputPath. Multiple values can be separated by commas.

None

Don't collect any dependencies.

Private

References to private assemblies such as 3rd party assemblies and other application assemblies not included in the project.

System

System assemblies included with the .NET framework.

Gac

Indicates the assembly should be copied even if it is located in the GAC.

All

Include all dependent assemblies.

CompressResources true|false

Indicates if managed resources in the assembly should be compressed.

DisableMsilEncryption true|false

Indicates if Code Encryption should be disabled for the assembly.

EncryptMsil true|false

Indicates if all the methods in the assembly should be encrypted. See the Code Encryption topic for details.

EncryptResources true|false

Indicates if all resources in the assembly and its satellite assemblies should be encrypted.

EncryptStrings true|false

Indicates if all the User Strings in the assembly should be encrypted. See the String Encryption topic for details.

KillDebuggers true|false

Indicates if CodeVeil should kill debuggers that attempt to debug the process with the veiled assembly. See the Runtime Protection topic for details.

KillProfilers true|false

Indicates if CodeVeil should close the process when it is being profiled. See the Runtime Protection topic for details.

KillReflectors true|false

Indicates if CodeVeil should add junk meta-data that cannot be processed by offline disassemblers like Reflector and ILDASM.

Notifications None | Error | Warning | Batch | Primary | Secondary | Parsing | Verbose

The level of detail to include in the build log. Default is Secondary.

Obfuscate true|false

Indicates if obfuscation should be enabled for all assemblies in the project.

OutputPath path

Root path to the folder where veiled assemblies should be saved and dependent assemblies collected.

ProcessSatelliteAssemblies true|false

Indicates if CodeVeil should automatically locate and process satellite assemblies and apply resource encryption, compression and resource renaming to satellite assemblies.

Projects items

Project items to veil.

RootPath path

The root path where all relative paths should be relative to. Normally this is the path to the folder where the CVP project is located.

Rules ItemGroup

Collection of obfuscation rules to apply to the veil.

Meta Data Description
Include

The rule search pattern.

%IsRegex

Indicates if the pattern should be treated as a regular expression.

%Obfuscate

Indicates if matching assembly members should be obfuscated or left alone.

%Visibility

The member visibility to match against. Possible values are Public, Protected, ProtectedInternal, Internal, Private, AllPublic, AllPrivate, All. Multiple visibilities can be separated by commas.

%ObjectTypes

The types of assembly members to match. Possible values are Classes, Methods, Events, Fields, Properties, All. Multiple object types can be separated by commas.

SearchPaths ItemGroup

Additional paths to search when resolving dependent assemblies.

StrongName path

Keys used to re-sign the assembly.

path

The path to the .SNK file to use when resigning the assembly.

container

The path to the machine store where the signing keys are stored. Must begin with container://.

SupportExceptionManager true|false

Indicates if CodeVeil should save a map and use special naming conventions to support de-obfuscating exception stack traces.

Threads number

The number of threads to use when processing. The maximum allowed depends on the license. See the license agreement for details. -1 uses the maximum licensed for the current hardware.

Ui true|false

Indicates if the veiling process should display the progress dialog while processing.

VeiledAssemblies ItemGroup

[Output] The physical paths where each assembly were written to.

Example

<ItemGroup>
     <VeilAssemblies Include="\bin\Debug\MsBuildExample.exe" />
</ItemGroup>
...
<Target Name="AfterBuild" >
    <Veil
        Projects="@(VeilAssemblies)"
        Ui="($ShowVeilUi)"
        Notifications="$(VeilNotificationLevel)"
        Threads="$(VeilThreads)"
        StrongName="path"
        Backup="true|false"
        RootPath="$(VeilRootPath)"
        SearchPaths="@(SearchPaths)"
        OutputPath="path"
        CollectReferences="None|Private|System|Gac|All"
        Obfuscate="true|false"
        Rules="(@VeilRules)"
        SupportExceptionMapper="true|false"
        AddDiagnosticInfo="true|false"
        EncryptMsil="true|false"
        DisableMsilEncryption="true|false"
        EncryptStrings="true|false"
        EncryptResources="true|false"
        CompressResources="true|false"
        ProcessSatelliteAssemblies="true|false"
        KillReflectors="true|false"
        KillDebuggers="true|false"
        KillProfilers="true|false">
        
        <Output TaskParameter="VeiledAssemblies"
                ItemName="ProjectVeiledAssemblies" />
	
     </Veil>
</Target >

See Also