ObfuscateAssemblyAttribute Classe
Definição
Instrui as ferramentas de ofuscação para usarem regras de ofuscação padrão do tipo de assembly apropriado.Instructs obfuscation tools to use their standard obfuscation rules for the appropriate assembly type.
public ref class ObfuscateAssemblyAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed class ObfuscateAssemblyAttribute : Attribute
public sealed class ObfuscateAssemblyAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class ObfuscateAssemblyAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)>]
type ObfuscateAssemblyAttribute = class
inherit Attribute
type ObfuscateAssemblyAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type ObfuscateAssemblyAttribute = class
inherit Attribute
Public NotInheritable Class ObfuscateAssemblyAttribute
Inherits Attribute
- Herança
- Atributos
Exemplos
O exemplo de código a seguir mostra um assembly particular que foi marcado com o ObfuscateAssemblyAttribute .The following code example shows a private assembly that has been marked with the ObfuscateAssemblyAttribute. A StripAfterObfuscation propriedade é false , para impedir que a ferramenta de ofuscação removida o atributo após o processamento.The StripAfterObfuscation property is false, to prevent the obfuscation tool from stripping the attribute after processing.
Para obter um exemplo de código que mostra o uso de ObfuscateAssemblyAttribute com ObfuscationAttribute , consulte a ObfuscationAttribute classe.For a code example that shows the use of ObfuscateAssemblyAttribute with ObfuscationAttribute, see the ObfuscationAttribute class.
using System;
using System.Reflection;
[assembly: ObfuscateAssemblyAttribute(true,
StripAfterObfuscation=false)]
Imports System.Reflection
<Assembly: ObfuscateAssemblyAttribute(False, _
StripAfterObfuscation:=False)>
Comentários
Os ObfuscationAttribute ObfuscateAssemblyAttribute atributos e fornecem uma maneira de os autores de assembly anotarem seus binários para que as ferramentas de ofuscação possam processá-los corretamente com a configuração externa mínima.The ObfuscationAttribute and ObfuscateAssemblyAttribute attributes provide a way for assembly authors to annotate their binaries so that obfuscation tools can process them correctly with minimal external configuration.
Aplicar esse atributo a um assembly instrui a ferramenta de ofuscação a usar suas regras padrão para o tipo de assembly.Applying this attribute to an assembly tells the obfuscation tool to use its default rules for the assembly type.
Importante
A aplicação desse atributo não ofusca automaticamente o assembly.Applying this attribute does not automatically obfuscate the assembly. A aplicação do atributo é uma alternativa à criação de um arquivo de configuração para a ferramenta de ofuscação.Applying the attribute is an alternative to creating a configuration file for the obfuscation tool. Ou seja, ele simplesmente fornece instruções para uma ferramenta de ofuscação.That is, it merely provides instructions for an obfuscation tool. A Microsoft recomenda que os fornecedores de ferramentas de ofuscação sigam a semântica descrita aqui.Microsoft recommends that vendors of obfuscation tools follow the semantics described here. No entanto, não há nenhuma garantia de que uma ferramenta específica segue as recomendações da Microsoft.However, there is no guarantee that a particular tool follows Microsoft recommendations.
Você pode aplicar ObfuscationAttribute a tipos em um assembly e a membros desses tipos.You can apply ObfuscationAttribute to types within an assembly, and to members on those types. O atributo mais interno controla a maneira como uma ferramenta de ofuscação trata qualquer entidade de código específica.The innermost attribute controls the way an obfuscation tool treats any particular code entity.
Construtores
| ObfuscateAssemblyAttribute(Boolean) |
Inicializa uma nova instância da classe ObfuscateAssemblyAttribute, especifica se o assembly a ser ocultado é público ou privado.Initializes a new instance of the ObfuscateAssemblyAttribute class, specifying whether the assembly to be obfuscated is public or private. |
Propriedades
| AssemblyIsPrivate |
Obtém um valor Boolean que indica se o assembly foi marcado como privado.Gets a Boolean value indicating whether the assembly was marked private. |
| StripAfterObfuscation |
Obtém ou define um valor Boolean que indica se a ferramenta de ocultamento deve remover o atributo após o processamento.Gets or sets a Boolean value indicating whether the obfuscation tool should remove the attribute after processing. |
| TypeId |
Quando implementado em uma classe derivada, obtém um identificador exclusivo para este Attribute.When implemented in a derived class, gets a unique identifier for this Attribute. (Herdado de Attribute) |
Métodos
| Equals(Object) |
Retorna um valor que indica se essa instância é igual a um objeto especificado.Returns a value that indicates whether this instance is equal to a specified object. (Herdado de Attribute) |
| GetHashCode() |
Retorna o código hash para a instância.Returns the hash code for this instance. (Herdado de Attribute) |
| GetType() |
Obtém o Type da instância atual.Gets the Type of the current instance. (Herdado de Object) |
| IsDefaultAttribute() |
Quando substituído em uma classe derivada, indica se o valor dessa instância é o valor padrão para a classe derivada.When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Herdado de Attribute) |
| Match(Object) |
Quando substituído em uma classe derivada, retorna um valor que indica se essa instância é igual a um objeto especificado.When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Herdado de Attribute) |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
| ToString() |
Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object. (Herdado de Object) |
Implantações explícitas de interface
| _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Mapeia um conjunto de nomes para um conjunto correspondente de identificadores de expedição.Maps a set of names to a corresponding set of dispatch identifiers. (Herdado de Attribute) |
| _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera as informações de tipo para um objeto, que pode ser usado para obter as informações de tipo para uma interface.Retrieves the type information for an object, which can be used to get the type information for an interface. (Herdado de Attribute) |
| _Attribute.GetTypeInfoCount(UInt32) |
Retorna o número de interfaces de informações do tipo que um objeto fornece (0 ou 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1). (Herdado de Attribute) |
| _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Fornece acesso a propriedades e métodos expostos por um objeto.Provides access to properties and methods exposed by an object. (Herdado de Attribute) |