Frequently Asked Questions
Поделиться
CmStick/M
- The SecureDisk partition of a CmStick with additional flash memory can only be accessed via the CodeMeter Core API.
It is not displayed in Windows Explorer.
Below you will find code snippets for various programming languages that demonstrate the use of the SecureDisk API.
You can insert this snippet into the "MyCode" function of the CmDemo example and execute it via the "MyCode" button of CmDemo.
CmDemo is installed with CodeMeter SDK for Windows and can be found in the SoftwareProtectionSamples.zip archive (<Programming Language>\Special\CmDemo). This can be found at : C:\Users\Public\Documents\WIBU-SYSTEMS.
.NET is not yet supported.
Please note:
- You must always read and write data to sectors.
- Per sector 512 bytes can be written or read and a maximum of 128 sectors can be written or read with one API call.
- To write or read data in another area, the SectorOffset can be used in the
CM_DISC_SECTOR structure. - To configure a CmStick/M the tool CmConfigDiskGUI is required.
You can download it under the following link: https://wibu.sharefile.com/d-s964196b38e54cf8a
Supported are CmSticks with the following item numbers (can be found on the case):
1011-03-xxx, 1011-02-2xx, 1011-02-4xx, 1040, 1041, 1042, 1043
Important: CmStick/BMI, CMStick/BMC, CmStick/DMI, CmStick/DMC only support HID since flash controller firmware version 13.0/13.1.
Please note:
While CmConfigDiskGUI is used, CodeMeter must not run and only the dongle to be configured must be plugged in.
If the dongle was connected while CodeMeter was still running, re-connect the dongle as soon as CodeMeter was terminated.
When starting & closing several dialogs appear. You can simply confirm these with Yes/Ok.
Then proceed as follows:
1. Start CmConfigDiskGUI as administrator.
2. Click the 'Read data' button to read the dongle.
3. Now you have the following options, among others
- To switch between Removable Disk & Local Disk, you can use the "Switch mode" button.
- To switch between HID only, MSD & HID Composite (CodeMeter Chip HID + Flash memory as MSD),
you can use the "Change interface" button.
- If "Change interface" does not offer an MSD, you can try to update the firmware of the flash controller.
For this you can use the "Update firmware" button. Then select the MSD interface.
If a configuration fails, proceed as follows:
1. Unplug the dongle for 10 seconds.
2. Exit CmConfigDiskGUI.
3. Reconnect the dongle.
4. Restart CmConfigDiskGUI.
Afterwards the connection should be freshly established and you can start another configuration attempt. - This is only useful for CmDongles with flash memory. To assign a permanent drive letter, please proceed as follows:
1. Open CodeMeter Control Center.
2. Click the "Process | Stop CodeMeter Service" menu item to stop the CodeMeter License Server service.
3. Open Windows Explorer and right-click the item "Manage | Storage | Disk Management".
Alternatively, open the Disc Management console via [Windows key] + [R] and type diskmgmt.msc into the field.
4. Find and select the CmDongle as mass storage device.
5. Right click on "Change Drive Letter and Paths…".
6. Assign a drive letter via the assistant.
This might not work for all operating systems and only for specific CodeMeter hardware. In this case, please contact Wibu-Systems support and submit information on your operating system and the hardware version of your CmDongles as displayed in CodeMeter WebAdmin. - Creating a CD-ROM partition and writing a *.iso file for a CmStick with flash memory involves the following 5 steps:
Step 1. configure enabling blocks to control the CD-ROM partition.
Step 2. create the CD-ROM partition.
Step 3. assign the 'Enable' status to the CD-ROM partition to write to it.
Step 4. write to the CD-ROM partition.
Step 5. assign the 'Disable' status to the CD-ROM partition so that it is recognized as a CD-ROM drive.
Note: CmStick/BMI, CMStick/BMC, CmStick/DMI, CmStick/DMC only support CD-ROM partitions since flash controller firmware version 13.0/13.1.
>> Step 1: Configure 'Enabling Blocks' to control the CD-ROM partition.
The CD-ROM partition is controlled by an enabling block.
More about enabling and enabling blocks can be found in the CodeMeter Developer Guide in the chapter 'Advanced CodeMeter Features | Enabling'.
The 'Enabling' state of Firm Code 0 Product Code 5 controls the state of the CD-ROM partition and how it is recognized by the system.
'Enabled' status: the partition is recognized as a normal drive and can be written to (see step 4).
'Disabled' status: the partition is recognized as a CD-ROM drive and can be used but not written to (default state for users)
Creating the Enabling Block
First this 'Enabling Block' must be created. Use the following CmBoxPgm command line:
CmBoxPgm /qs%serial% /f0 /e:tp /eac: "SecureCode" /em:d /edta:none /et:"CmCdRomAccessWritePermission" /ca
Please note:
- You will be asked to enter the password of your CmStick. The default password is "CodeMeter" (without quotation marks).
- "SecureCode" is here a password (Enable Access Code) which is needed to enable or disable the 'Enabling Block' later or to attach it to a product item.
Please adjust the password and remember it. You will need it again later.
Depending on the existing number of 'Enabling Blocks' in Firm Code 0, it will now be decided which 'Index' contains which 'Enabling Block'.
Important: In the following CmBoxPgm programming you have to adjust the index of the entry to that which the 'Enabling Blocks' you created has in your case.
You can determine the index by reading the Firm Code 0 of your CmStick with the following command:
CmBoxPgm /qs%serial% /f0 /l
As a result, the following is displayed, for example:
*** List Firm Item contents, CmContainer 2-3106329
Firm Code 0 at [1], File Based
[...]
- Enable Block Table
0[+ ]: Time PIN
Disable Time = (never)
Text (7 character(s)): "Default"
[...]
4[- ]: Time PIN
Disable Time = (never)
Text (28 character(s)): "CmCdRomAccessWritePermission"
- Enable Lookup Table
In the following 'Enabling Block' index 4 is used for "CmCdRomAccessWritePermission".
The [-] means that this 'Enabling Block' currently has the 'Disable' status.
Appending the 'Enabling Block' to the Associated Product Item
The following command line appends the 'Enabling Block' 4 (must be adapted in concrete cases) with the designation "CmCdRomAccessWritePermission" to Product Code 5:
CmBoxPgm /qs%serial% /f0 /e4:tp /eac: "SecureCode" /eatt0,5:mod,loc:req+ /cu
Please note:
- You may be asked to enter the password of your CmStick again.
The default password is "CodeMeter" (without quotation marks).
- If you have used another 'Enabling' password than "SecureCode" (recommended),
then you have to adjust this here accordingly.
>> Step 2: Creating the CD-ROM partition with Tool CmConfigDiskGUI
To configure a CmStick with memory the tool CmConfigDiskGUI is required.
You can download it under the following link: https://wibu.sharefile.com/d-s95e57807de64d748
Note: CmSticks with the following part numbers are supported (can be found on the case): 1011-03-xxx, 1011-02-2xx, 1011-02-4xx, 1040, 1041, 1042, 1043
While CmConfigDiskGUI is being used, CodeMeter must not be running and only the dongle to be configured must be plugged in.
If the dongle was connected while CodeMeter was still running, re-connect the dongle as soon as CodeMeter was terminated.
Several dialogs appear when starting and closing the dongle. You can simply confirm these with 'Yes' or 'OK'.
a) Click the button "Read data" as soon as CmConfigDiskGUI is started to read the dongle.
b) Change to the second tab "Partitions / LUN configuration".
Here you can set the size of each partition. The sum of all partitions must correspond exactly to "Total size [Mib]".
Public Disk' is the default memory that you can see in Windows Explorer.
c) Click the "Change sizes" button to confirm the partitioning.
Attention: All data stored on the flash memory of the CmStick will be lost.
Licenses are not affected.
If you want to keep other partitions (e.g. Public Disk), you will be prompted by Windows,
to format the partition.
Here you can keep all the default settings of the quick formatting and simply click through the wizard and confirm everything.
If a configuration fails, you can try unplug the dongle for 10 seconds, exit CmConfigDiskGUI, replug the dongle, and restart CmConfigDiskGUI. Afterwards the connection should be freshly established and you can start another configuration attempt.
Now the CD-ROM drive should be displayed in Windows Explorer.
>> Step 3: Assign the 'Enable' status to the CD-ROM partition in order to be able to write to it.
In order to be able to write to the CD-ROM partition, an 'Enable' status must be assigned to the corresponding 'Enabling Block'.
First make sure that you have exit CmConfigDiskGui.
Then start CodeMeter Control Center and if necessary start the CodeMeter service via "Action | Start CodeMeter Service".
Now you can use the following CmBoxPgm command to activate writing:
CmBoxPgm /qs%serial% /f0 /e4:tp /eac: "SecureCode" /em:e /cu
When you open Windows Explorer, you may be prompted to format the CD-ROM partition again because it is now recognized as a normal removable disk.
>> Step 4: Writing the CD-ROM
You can now use any external tool to write to the CD-ROM partition. A simple copy is not enough!
In the appendix you will find a tool that we always use for tests. You can install your *.iso file with this tool as follows:
a) Unpack the archive.
b) Start the "USB Image Tool.exe".
c) Select the CD-ROM partition that is currently recognized as a removable disk (if necessary, recognizable by its size).
d) Click on the "Restore" button.
e) Select your image. You may have to adjust the file type in the lower right corner of the selection dialog so that you can see and select *.iso files.
f) Confirm the query whether you really want to restore the image.
>> Step5: Assign the 'Disable' status to the CD-ROM partition so that it is recognized as a CD-ROM drive.
Finally, you must reassign the 'Enabling Block' of the CD-ROM partition to the 'Disable' state so that Windows recognizes the partition as a CD-ROM drive again.
Use the command line to do this:
CmBoxPgm /qs%serial% /f0 /e4:tp /eac: "SecureCode" /em:d /cu
After the 5 steps the CD-ROM drive with your *.iso image should be recognized and usable. - Preparing the Secure Disk feature for a CmStick with memory involves two steps:
1. configuring the enabling blocks to enable the Secure Disk for this CmStick.
2. create a Secure Disk partition using the CmConfigDiskGUI tool.
1. Configure the 'Enabling Blocks' to enable the Secure Disk for this CmStick.
The SecureDisk feature is controlled by two enabling blocks.
For more information on enabling and enabling blocks, refer to the CodeMeter Developer Guide in the chapter 'Advanced CodeMeter Features | Enabling'.
The 'Enabling Status' of Firm Code 0 Product Code 7 controls the read permissions for the Secure Disk partition.
The Enabling Status of Firm Code 0 Product Code 8 controls the write permissions for the Secure Disk partition.
Creating the two Enabling Blocks
Use the following CmBoxPgm commands to do this:
CmBoxPgm /qs%serial% /f0 /e:tp /eac: "SecureCode" /et: "CmSecureDiscAccess" /em:e /edta:none /ca
CmBoxPgm /qs%serial% /f0 /e:tp /eac: "SecureCode" /et: "CmSecureDiscWritePermission" /em:e /edta:none /ca
Please note:
- You will be asked to enter the password of your CmStick. The default password is
"CodeMeter" (without quotation marks).
- SecureCode" is here a password (Enable Access Code) which is needed to enable or
disable the 'Enabling Block' later or to attach it to a product item.
Please adjust the password and remember it. You will need it again later.
Depending on the existing number of 'Enabling Blocks' in Firm Code 0, it will now be decided which 'Index' contains which 'Enabling Block'.
Important: In the following CmBoxPgm programming you have to adjust the 'Index' to the 'Index' entry that the 'Enabling Blocks' have received from you.
You can determine the 'Index' entry by reading the Firm Code 0 of your CmStick with the following command:
CmBoxPgm /qs%serial% /f0 /l
As a result, the following is displayed, for example:
*** List Firm Item contents, CmContainer 3-4380449
Firm Code 0 at [1], File Based
[...]
- Enable Block Table
0[+ ]: Time PIN
Disable Time = (never)
Text (7 character(s)): "Default"
1[+ ]: Time PIN
Disable Time = (never)
Text (18 character(s)): "Disk Configuration"
2[+ ]: Time PIN
Disable Time = (never)
Text (18 character(s)): "CmSecureDiscAccess"
3[+ ]: Time PIN
Disable Time = (never)
Text (27 character(s)): "CmSecureDiscWritePermission"
- Enable Lookup Table
In the following 'Enabling Block' 'Index' 2 is used for "CmSecureDiscAccess" and 'Index' 3 for "CmSecureDiscWritePermission".
The [+] means that this 'Enabling Block' currently has the 'Enable' status.
Appending the 'Enabling Blocks' to the Associated Product Item
Next, the enabling blocks must be appended to the corresponding product item.
Enabling Block 2 (must be adapted) named "CmSecureDiscAccess" is appended to Product Code 7 (for read access, always the same):
CmBoxPgm /qs%serial% /f0 /e2:tp /eac: "SecureCode" /eatt0,7:mod,loc:req+ /cu
Enabling Block 3 (must be adapted) named "CmSecureDiscWritePermission" is appended to Product Code 8 (for write access, always the same):
CmBoxPgm /qs%serial% /f0 /e3:tp /eac: "SecureCode" /eatt0,8:mod,loc:req+ /cu
Please note:
- You may be asked to enter the password of your CmStick again.
The default password is "CodeMeter" (without quotation marks).
- If you have used an enabling password other than "SecureCode" (recommended),
then you have to adjust this here accordingly.
Now the 'Enabling Blocks' are prepared and it can be read from and written to the secure disk via CodeMeter core API.
If you want to change the permissions, you can use the following commands:
Enable read access:
CmBoxPgm /qs%serial% /f0 /e2:tp /eac:\"SecureCode\" /em:e /cu
Disable read access:
CmBoxPgm /qs%serial% /f0 /e2:tp /eac:\"SecureCode\" /em:d /cu
Activate write access (read access is required):
CmBoxPgm /qs%serial% /f0 /e3:tp /eac:\"SecureCode\" /em:e /cu
Deactivate write access:
CmBoxPgm /qs%serial% /f0 /e3:tp /eac:\"SecureCode\" /em:d /cu
2. Create a Secure Disk partition with tool CmConfigDiskGUI
To configure a CmStick with memory the tool CmConfigDiskGUI is required.
You can download it under the following link: https://wibu.sharefile.com/d-s15d5f39cc064f7cb
Note: CmSticks with the following part numbers are supported (can be found on the case):
1011-03-xxx, 1011-02-2xx, 1011-02-4xx, 1040, 1041, 1042, 1043
While CmConfigDiskGUI is being used, CodeMeter must not be running and only the dongle to be configured must be plugged in.
If the dongle was connected while CodeMeter was still running, re-connect the dongle as soon as CodeMeter was terminated.
Several dialogs appear when starting and closing the dongle. You can confirm these with 'Yes' or 'OK'.
a) Click the button "Read data" as soon as CmConfigDiskGUI is started to read the dongle.
b) Change to the second tab "Partitions / LUN configuration".
Here you can set the size of each partition. The sum of all partitions must correspond
exactly to "Total size [Mib]".
Public Disk' is the default memory that you can see in Windows Explorer.
c) Click the "Change sizes" button to confirm the partitioning.
Attention: All data stored on the flash memory of the CmStick will be lost.
Licenses are not affected.
If you want to keep other partitions, e.g. Public Disk, Windows will prompt you afterwards,
to format the partition.
Here you can keep all the default settings of the quick formatting and simply click
through the wizard and confirm everything.
If a configuration fails, you can try unplug the dongle for 10 seconds, exit CmConfigDiskGUI, replug the dongle, and restart CmConfigDiskGUI. Afterwards the connection should be freshly established and you can start another configuration attempt.