Dongle and restrictions

license
dongle
codemeter
#1

The two following questions came up regarding the use of dongles;

  • Can an application be run as a windows service (I see no issues with that, but just to be sure)
  • Does the dongle still work if USB removable storage devices are disabled for security purposes (might pose a problem)
#2

Hi @CvK,

question 1

running an application with :cvb: as a service is generally possible. However, please keep in mind that services do not interact with the user’s desktop. Some of the :cvb: tools however are showing a message box when they detect that they have not been licensed (as a rule of thumb it’s usually those tools that do not generate an output image which they could render partially useless by means of a watermark). Now if your application is using one of those tools and your application is running as a service and you happen to not have a license for the tool, then the service application will open a message box that will not be visible but nevertheless wait for someone to click the “OK” button - which will of course never happen…

There is not really much of a way around that - my recommendation would be to take into account the possibility of a user launching the service without the necessary license(s) and plan for that scenario:

  • During startup, before accessing tool functionality, make a heuristic check for license availability
  • Implement logging that would allow you to identify a “license not available” situation

question 2

By default most CodeMeter dongles that :cvb: is using have been configured to pose as a mass storage device. In principle this is neat because it allows the devices to function without the installation of a system-level driver as the operating system already has the necessary drivers in place. One of the side effects of this is that if the OS is configured to block/ignore all USB-based mass storage devices, the CodeMeter dongle will not be detected.

The only way around that - short of establishing an exception for the CodeMeter key - is to reconfigure the dongle as Human Interface Devices. Note that at least :cvb: 12.01.000 (aka :cvb: 2016) will be required for that. To reconfigure the dongle as a human interface device, the cmu32.exe utility that is installed with :cvb: (or, more precisely, with the CodeMeter runtime that is installed by :cvb:) will be required (usually located in %ProgramFiles%\CodeMeter\Runtime\bin%). To switch a given dongle to human interface device (HID) mode, please to the following:

  1. Plug in the dongle and open a command window (no administrative privileges required…).

  2. Enter the command cmu32 --list
    This should produce a list of the available CodeMeter license containers like this:

    W:\>cmu32 --list
    cmu32 - CodeMeter Universal Support Tool.
    Version 6.70 of 2018-Jul-19 (Build 3152) for Win32
    Copyright (C) 2007-2018 by WIBU-SYSTEMS AG. All rights reserved.
    
    List all locally connected CmContainers:
    - CmContainer with Serial Number 3-4282892 and version 4.03
    - CmContainer with Serial Number 128-2308711 and version 1.19
    Result: 2 CmContainer(s) listed.
    
  3. Determine the serial number of your dongle. Dongle serial numbers usually start with 3- (if yours starts with 2- or 1- the firmware of your dongle is too old to support HID mode), so in the above example the serial number would be 3-4282892.

  4. You can output the current configuration of the dongle via cmu32 -s 3-4282892 --show-config-disk. For a dongle that has been configured as a mass storage device the output looks like this:

    W:\>cmu32 -s 3-4282892 --show-config-disk
    cmu32 - CodeMeter Universal Support Tool.
    Version 6.70 of 2018-Jul-19 (Build 3152) for Win32
    Copyright (C) 2007-2018 by WIBU-SYSTEMS AG. All rights reserved.
    
    - CmStick with Serial Number 3-4282892 and version 4.03
      Version:            4.03
      Flash Size:         no real flash available
      Virtual Drive:      F:
      Configuration:      LocalDisk with ActivePartition
      File System:        FAT32
      Communication:      Mass Storage Device
      Boot-Code:          Int18 Boot Code
      Mdfa:               0x539
    
  5. Switching to this HID mode is done with cmu32 -s 3-4282892 --set-config-disk HidCommunication. Run that command line and re-plug your dongle when prompted to:

    W:\>cmu32 -s 3-4282892 --set-config-disk HidCommunication
    cmu32 - CodeMeter Universal Support Tool.
    Version 6.70 of 2018-Jul-19 (Build 3152) for Win32
    Copyright (C) 2007-2018 by WIBU-SYSTEMS AG. All rights reserved.
    
    
      Communication mode changed successfully.
    
      Please re-plug your CmDongle to apply the changes.
    
  6. After re-plugging the dongle you may want to run cmu32 -s 3-4282892 --show-config-disk again to verify the outcome:

    W:\>cmu32 -s 3-4282892 --show-config-disk
    cmu32 - CodeMeter Universal Support Tool.
    Version 6.70 of 2018-Jul-19 (Build 3152) for Win32
    Copyright (C) 2007-2018 by WIBU-SYSTEMS AG. All rights reserved.
    
    - CmStick with Serial Number 3-4282892 and version 4.03
      Version:            4.03
      Flash Size:         no real flash available
      Virtual Drive:      No drive assigned (HID)
      Communication:      Human Interface Device (HID)
    

:exclamation: Please keep in mind

  • The HID mode won’t work with older versions of :cvb:
  • If a security measure is in place that blocks unknown HID devices like the rubber ducky USB sticks that also pose as HID device, CodeMeter dongles in HID mode will also be blocked.
3 Likes
#3

@illusive: As always, thanks for the extensive and thorough response! Exactly the info I need :slight_smile: