Skip to content

Reference Proxy Protection

Martin Karing edited this page Jan 9, 2021 · 4 revisions

ID: ref proxy
Preset: Normal
Availability: ConfuserEx ConfuserEx 2

This protection encodes and hides references to type/method/fields.

Parameters

  • mode: This parameter define the way ConfuserEx hide the references. Supported values are:

    • mild: ConfuserEx would add an indirection method as proxy. (default)
    • strong: ConfuserEx would add a dynamic method delegate as proxy.
  • encoding: This parameter define the way ConfuserEx encodes the method references. These encoding modes are only used for the strong mode. Supported values are:

    • normal: ConfuserEx would use static algorithms with random parameters to encode the references. (default)
    • expression: ConfuserEx would use dynamically generated expressions to encode the references.
    • x86: ConfuserEx would use dynamically generated native x86 expressions to encode the references. This mode will disable the "AnyCPU" mode of an assembly.
      (Produces unverifiable modules)
  • internal: This parameter is a boolean value, indicates whether ConfuserEx should also hide internal references.

    • true: Protect calls to members inside the same assembly.
    • false: Only protect calls to members in other assemblies. (default)
  • typeErasure: This parameter is a boolean value, indicates whether ConfuserEx should hide the types of method parameters.

    • true: Parameters of the proxy methods are declared as System.Object if possible.
    • false: Parameters of the proxy methods are declared with the real types. (default)
  • depth: This parameter define how deep is the generated expression if encoding is set to expression or x86. Default is 3.

  • initCount: This parameter define how many delegate initializer should be added if mode is set to strong. Default is 16.

Example

<protection id="ref proxy">
  <argument name="mode" value="strong" />
  <argument name="encoding" value="x86" />
  <argument name="internal" value="false" />
  <argument name="typeErasure" value="false" />
  <argument name="depth" value="4" />
  <argument name="initCount" value="32" />
</protection>