Read and Write data
You have the possibility to read and write raw data from and to the CodeMeter / WibuKey device. Please note that C# cannot handle WibuKey devices. In the following we describe where this data is stored. For reading the data you can use WupiReadData or WupiReadDataInteger. For writing data you can use WupiWriteData or WupiWriteDataInteger.
CodeMeter
For CodeMeter the raw data is stored as Hidden Data. Starting with index 0 of Hidden Data the data is stored in this and the following Hidden Data entries. Within each Hidden Data entry 242 bytes are stored, which is the optimum value for hardware resources. The Hidden Data Access Code (HDAC) is automatically derived from Firm- and Product Code.
The Hidden Data needs to be prepared in each CmContainer you send to your customer. To be able to write raw data at runtime, it is important not to set the dependency flags for all Hidden Data entries that should be used. This is necessary to be able to generate programming sequences that work on all CmDongles.
If you use High Level Programming API (HIP) (Programming API) for preparing CmContainer, use the option SetHiddenDataRange without parameter ulAccessCode. This will prepare the data correctly.
If you use command line tool CmBoxPgm for preparing CmContainer, you use the option /pwupidata to add or remove a sequence of Hidden Data PIOs that are used as WUPI data storage. The WUPI data storage either can be filled with the contents of a specified file or preset with a user-defined fill byte. In this case, the size of the WUPI data has to be specified.
For using other settings than the default settings, you need to modify the *.wbc file with appropriate settings. Please contact Wibu support, if you want to do this.
WibuKey
For WibuKey the raw data is stored in the Protected Extended Memory which is available in all WibuBoxes with a "+" at the end, e.g. WibuBox/U+ or WibuBox/RU+. Each page of the Extended Memory has 32 bytes. There are 256 pages in the Protected Extended Memory, so you can store up to 8192 bytes.
The derivation of the signature that is needed for reading Protected Extended Memory is calculated under the assumption that the first entry of the WibuBox (where the Protected Extended Memory is bound to) has no added data (Added Data, Limit Counter or Expiration Date) or existing added data has no dependencies (serial, programming counter, data).
The default and recommended settings for reading and/or writing raw data can be activated in AxProtector by checking the appropriate boxes in the License List configuration.
CodeMeter
For CodeMeter the raw data is stored as Hidden Data. Starting with index 0 of Hidden Data the data is stored in this and the following Hidden Data entries. Within each Hidden Data entry 242 bytes are stored, which is the optimum value for hardware resources. The Hidden Data Access Code (HDAC) is automatically derived from Firm- and Product Code.
The Hidden Data needs to be prepared in each CmContainer you send to your customer. To be able to write raw data at runtime, it is important not to set the dependency flags for all Hidden Data entries that should be used. This is necessary to be able to generate programming sequences that work on all CmDongles.
If you use High Level Programming API (HIP) (Programming API) for preparing CmContainer, use the option SetHiddenDataRange without parameter ulAccessCode. This will prepare the data correctly.
If you use command line tool CmBoxPgm for preparing CmContainer, you use the option /pwupidata to add or remove a sequence of Hidden Data PIOs that are used as WUPI data storage. The WUPI data storage either can be filled with the contents of a specified file or preset with a user-defined fill byte. In this case, the size of the WUPI data has to be specified.
For using settings other than the default settings you need to modify the *.wbc file with appropriate settings. Please contact Wibu support if you want to do this.