ArmDotConsole

ArmDotConsole is available on any platform, supporting .NET, including Windows, Linux, and macOS.

On Windows, the tool is installed into the ArmDot installation directory, by default ArmDotConsole is available via the path %ProgramFiles(x86)%\ArmDot\ArmDotConsole.exe or %ProgramFiles%\ArmDot\ArmDotConsole.exe.

On Linux and macOS, the tool is installed into /opt/armdot, by default ArmDotConsole is available via the path /opt/armdot/ArmDotConsole.

Also, ArmDotConsole is available as a .NET tool that can be installed globally using the following command:

dotnet tool install --global ArmDotConsole

After installing, you can run ArmDotConsole by using the following command:

ArmDotConsole

To use ArmDotConsole in Azure Pipeline, you can install and use the tool using the following syntax (make sure to change the path to the assembly from bin\$(buildConfiguration)\net7.0\CheckPassword.dll to the correct one):

- task: DotNetCoreCLI@2
  displayName: 'Install ArmDotConsole as a dotnet tool'
  inputs:
    command: custom
    custom: tool
    arguments: 'install --global ArmDotConsole'
 
- task: CmdLine@2
  displayName: 'Obfuscate using ArmDotConsole'
  inputs:
    script: 'ArmDotConsole --input-assembly bin\$(buildConfiguration)\net7.0\CheckPassword.dll'
    workingDirectory: '$(Build.SourcesDirectory)'

To use ArmDotConsole in GitHub Workflow, you can install and use the tool using the following syntax (make sure to change the path to the assembly from bin/Release/net7.0/PasswordValidator.dll to the correct one):

- name: Install ArmDotConsole
  run: dotnet tool install --global ArmDotConsole
- name: Obfuscate
  run: ArmDotConsole --input-assembly bin/Release/net7.0/PasswordValidator.dll

Syntax

ArmDotConsole parameters

Parameters

General

OptionDescription
--helpDisplays usage.
--license-file-path license file pathIf specified, a registered version of ArmDot reads a license key from the file license file path.
--arguments-file pathIf specified, ArmDotConsole reads arguments from the file path. Use this option when it's impossible to pass parameters in the usual way because the command line length reaches its maximum.

Obfuscation

OptionDescription
--input-assembly assembly pathIf specified, ArmDotConsole obfuscates the assembly assembly path.
--output-assembly assembly pathIf specified, ArmDotConsole writes obfuscated assembly to assembly path. If --output-assembly is omitted, ArmDotConsole writes obfuscated assembly to the same file.
--create-map-file map file pathIf specified, ArmDotConsole writes information about original and obfuscated names to map file path. Map files are used to deobfuscate stack traces.
--reference-path directory pathIf specified, ArmDotConsole searches referenced assemblies in the provided directories. Use multiple --reference-path directory path to add several directories.
--key-file key file pathSpecifies the path to the file containing the key pair, which is used to generate a strong name. If specified, ArmDotConsole signs the assembly after obfuscation using key file path. Use this option if an assembly is a strong-named one. Obfuscation modifies an assembly making a strong name signature not valid. That is why signing is required.
--enable-obfuscate-namesIf specified, ArmDotConsole obfuscates names of the assembly specified by --input-assembly.
--enable-control-flow-obfuscationIf specified, ArmDotConsole obfuscates control flow of the assembly specified by --input-assembly.
--protect-embedded-resourcesIf specified, ArmDotConsole protects embedded resources of the assembly specified by --input-assembly.
--enable-virtualize-codeIf specified, ArmDotConsole virtualizes code of the assembly specified by --input-assembly.
--enable-hide-stringsIf specified, ArmDotConsole protects strings used by the assembly specified by --input-assembly.

Notes

It is important to obfuscate several assemblies at once if names obfuscation is enabled, because ArmDot should change names in assemblies that reference an obfuscated one.

You can specify several assemblies and obfuscation options for each one, e.g.:

ArmDotConsole --input-assembly assembly1.dll --enable-obfuscate-names --input-assembly assembly2.dll --protect-embedded-resources

This command obfuscates the names of assembly1.dll and protects embedded resources of assembly2.dll. If assembly2.dll references to assembly1.dll, ArmDot also fixes the names.

Project Building

OptionDescription
--buildIf specified, ArmDotConsole builds a project. Use --project-path to specify a project path.
--project-path project pathIf specified, ArmDotConsole uses this project either to build it or to generate a license key.

Example

The following command builds Project.armdotproj:

ArmDotConsole --build --project-path Project.armdotproj

Licensing

OptionDescription
--generate-license-keyIf specified, ArmDotConsole generates a license key and writes it to stdout. Use --license-user-name to specify a user name, and --license-user-email to specify a user e-mail.
--license-user-name user nameIf specified, ArmDotConsole uses this user name to generate a license key.
--license-user-email user emailIf specified, ArmDotConsole uses this user e-mail to generate a license key.
--license-expiration-date expiration dateIf specified, ArmDotConsole generates a license key that expires on expiration date. See date format below.
--license-maximum-build-date maximum build dateIf specified, ArmDotConsole generates a license key that is expired for binaries issued after maximum build date. See date format below.
--license-user-data-base64 user data in base64 formatIf specified, ArmDotConsole generates a license key that includes specified user data. The data is encoded in base64.
--license-user-hardware-id hardware idIf specified, ArmDotConsole generates a license key that includes specified hardware id.
--generate-hardware-idIf specified, ArmDotConsole generates a hardware id and prints it to stdout. Use --hardware to specify hardware that is used to generate a hardware id.
--hardware hardwaresIf specified, ArmDotConsole uses the hardwares of the current machine to generate a hardware id. hardwares is a comma separated list of possible hardware: CPU, HDD, or Motherboard. For example, if a hardware id should include information about the current processor and motherboard, use --hardware CPU,Motherboard

Example

The following command generates a license key for specified user name and an e-mail:

ArmDotConsole --generate-license-key --project-path Project.armdotproj --license-user-name "John Smith" --license-user-email "JohnSmith@some.com"

Date format

The format is MM-dd-yyyy, e.g. 02-03-2019 is for 2nd Match 2019.