• ArmDot Home
  • Documentation
  • Tutorial
  • API
  • Download
Show / Hide Table of Contents
  • Getting Started
  • Tutorial
  • MSBuild Obfuscation Task
  • Embedded Files
    • Embedded Files
    • Predefined Directories
  • Key Generators
    • Key Generator for PHP
    • Key Generator for C/C++
  • Command Line Tools
    • ArmDotConsole.exe
  • API
    • ArmDot.Client
      • Api
      • Api.Hardware
      • Api.LicenseKeyState
      • EmbedFileAttribute
      • HideStringsAttribute
      • ObfuscateControlFlowAttribute
      • ObfuscateNamesAttribute
      • ObfuscateNamespacesAttribute
      • ProtectEmbeddedResourcesAttribute
      • VirtualizeCodeAttribute
    • ArmDot.Engine.MSBuildTasks
      • ObfuscateTask
  • Obfuscation Attributes
  • Stack Trace Deobfuscation
  • ArmDot Warnings
    • How to disable a warning?
    • Warning ARMDOT0001
    • Warning ARMDOT0002
    • Warning ARMDOT0003
    • Warning ARMDOT0004
    • Warning ARMDOT0005
    • Warning ARMDOT0006
    • Warning ARMDOT0007
    • Warning ARMDOT0008
  • Glossary
    • Hardware Id
  • License

Embedded Files

ArmDot can embed files into protected assembly.

⚠ This feature is available on Windows only.

For example, you might need to merge unmanaged DLLs into your application in order to distribute a single executable file. Also, it's possible to hide and protect assets: media files, images, configuration files, databases, etc.

The assembly reads and writes to such a file as if it really existed on a disk. At the same time, embedded files are not saved to a disk, but located in process memory instead.

There are two ways to embed files: using a special attribute, ArmDot.Client.EmbedFileAttribute (called a declarative way), or using the ArmDot UI.

Embedding files by a declarative way

To embed a file this way, use ArmDot.Client.EmbedFileAttribute, instructing ArmDot where to get file content, and what is a file runtime path.

Runtime path can be a full path, but usually it consists of a predefined directory id and a relative path, that allows to place a file to the assembly directory, or to some system directory:

// AssemblyInfo.cs

using ArmDot.Client;

[assembly: EmbedFile(SourcePath: "file_content.txt", RuntimePath: @"$(AssemblyDirectory)\embedded_file.txt")]

You can find a complete ready to use sample on GitHub: https://github.com/Softanics/armdot-sample-embed-file

Embedding files using the ArmDot UI

Switch to Files in the ArmDot UI:

Embedded Files in ArmDot

Here are the predefined folders at the right, like Assembly Directory and System Drive.

To include a file to a protected assembly click to Add Files... and choose the file. Another option is to import the entire directory.

Possible file / directory type is Embedded or External. To change it, select a file and change type via Properties on the right from the file tree.

If a directory is not marked as embedded, the protected assembly will view both real files and embedded files in the directory.

Back to top Armdot Home | Copyright © Softanics | Generated by DocFX