HASP4 Programmer's Guide - Ti-Soft
HASP4 Programmer's Guide - Ti-Soft
HASP4 Programmer's Guide - Ti-Soft
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Securing the<br />
global<br />
village<br />
Programmer’s <strong>Guide</strong>
Programmer’s <strong>Guide</strong><br />
Version 11
COPYRIGHTS AND TRADEMARKS<br />
The HASP ® system and its documentation are copyrighted (C)<br />
1985 to present by Aladdin Knowledge Systems Ltd. All rights<br />
reserved.<br />
HASP ® , MacHASP ® and MemoHASP ® are registered trademarks<br />
of Aladdin Knowledge Systems Ltd.<br />
NetHASP, <strong>Ti</strong>meHASP, HASP36, MemoHASP36,<br />
NetHASP36, USBHasp, and AladdinCARD are trademarks<br />
of Aladdin Knowledge Systems Ltd.<br />
All other trademarks, brands, and product names used in this<br />
guide are trademarks of their respective owners.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> i
LIMITED WARRANTY, LIMITATION OF<br />
REMEDIES AND LIABILITY<br />
Aladdin Knowledge Systems Ltd. (“Aladdin”) warrants for a<br />
period of twelve (12) months after date of purchase its software<br />
and the HASP ® key as set forth in the Developer's License<br />
Agreement.<br />
Aladdin's sole obligation in the event of a breach of this warranty,<br />
and the limitation on its liability for damages to any party, are as<br />
set forth in the Developer's License Agreement.<br />
EXCEPT AS STATED ABOVE, THERE IS NO OTHER WARRANTY,<br />
EXPRESSED OR IMPLIED, REGARDING ALADDIN'S PRODUCTS<br />
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF<br />
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.<br />
All attempts have been made to make the information in this<br />
document complete and accurate. Aladdin is not responsible for<br />
any direct or indirect damages or loss of business resulting from<br />
inaccuracies or omissions. The specifications in this document are<br />
subject to change without notice.<br />
ii © Aladdin Knowledge Systems, 2002
ALADDIN KNOWLEDGE SYSTEMS LTD.<br />
DEVELOPER'S LICENSE AGREEMENT<br />
IMPORTANT INFORMATION - PLEASE READ THIS<br />
AGREEMENT CAREFULLY BEFORE OPENING THE<br />
PACKAGE AND/OR USING THE CONTENTS THEREOF<br />
AND/OR BEFORE DOWNLOADING OR INSTALLING<br />
THE SOFTWARE PROGRAM. ALL ORDERS FOR AND<br />
USE OF THE HASP PRODUCTS (including without limitation,<br />
the Developer's Kit, libraries, utilities, diskettes, CD_ROM,<br />
HASP ® keys, the software component of Aladdin's HASP and the<br />
Developer's <strong>Guide</strong>s) (hereinafter "Product") SUPPLIED BY<br />
ALADDIN KNOWLEDGE SYSTEMS LTD. (or any of its<br />
affiliates - either of them referred to as "ALADDIN") ARE AND<br />
SHALL BE, SUBJECT TO THE TERMS AND CONDITIONS<br />
SET FORTH IN THIS AGREEMENT.<br />
BY OPENING THE PACKAGE CONTAINING THE<br />
PRODUCTS AND/OR BY DOWNLOADING THE<br />
SOFTWARE (as defined hereunder) AND/OR BY<br />
INSTALLING THE SOFTWARE ON YOUR COMPUTER<br />
AND/OR BY USING THE PRODUCT, YOU ARE<br />
ACCEPTING THIS AGREEMENT AND AGREEING TO BE<br />
BOUND BY ITS TERMS AND CONDITIONS.<br />
IF YOU DO NOT AGREE TO THIS AGREEMENT OR ARE<br />
NOT WILLING TO BE BOUND BY IT, DO NOT OPEN<br />
THE PACKAGE AND/OR DOWNLOAD AND/OR<br />
INSTALL THE SOFTWARE AND PROMPTLY (at least within<br />
7 days from the date you received this package) RETURN THE<br />
PRODUCTS TO ALADDIN, ERASE THE SOFTWARE, AND<br />
ANY PART THEREOF, FROM YOUR COMPUTER AND<br />
DO NOT USE IT IN ANY MANNER WHATSOEVER.<br />
UPON RETURNING THE PRODUCT WITH A COPY OF<br />
THE SALES RECIPT TO ALADDIN YOU WILL RECEIVE A<br />
REFUND.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> iii
1. <strong>Ti</strong>tle & Ownership<br />
2. License<br />
THIS IS A LICENSE AGREEMENT AND NOT AN<br />
AGREEMENT FOR SALE. The software component of<br />
Aladdin's HASP Product Development Kit, including any<br />
revisions, corrections, modifications, enhancements, updates and/<br />
or upgrades thereto, (hereinafter in whole or any part thereof<br />
defined as: "<strong>Soft</strong>ware"), and the related documentation, ARE<br />
NOT FOR SALE and are and shall remain in Aladdin's sole<br />
property. All intellectual property rights (including, without<br />
limitation, copyrights, trade secrets, trademarks, etc.) evidenced by<br />
or embodied in and/or attached/connected/related to the<br />
Product, (including, without limitation, the <strong>Soft</strong>ware code and the<br />
work product performed in accordance with Section 2 hereunder)<br />
are and shall be owned solely by Aladdin. This License Agreement<br />
does not convey to you an interest in or to the <strong>Soft</strong>ware but only a<br />
limited right of use revocable in accordance with the terms of this<br />
License Agreement. Nothing in this Agreement constitutes a<br />
waiver of Aladdin's intellectual property rights under any law.<br />
Subject to payment of applicable license fees, Aladdin hereby<br />
grants to you, and you accept, a personal, nonexclusive and fully<br />
revocable limited License to use the <strong>Soft</strong>ware, in executable form<br />
only, as described in the <strong>Soft</strong>ware accompanying user<br />
documentation and only according to the terms of this Agreement:<br />
(i) you may install the <strong>Soft</strong>ware and use it on computers located in<br />
your place of business, as described in Aladdin's related<br />
documentation;<br />
(ii) you may merge and link the <strong>Soft</strong>ware into your computer<br />
programs for the sole purpose described in the Developer's <strong>Guide</strong>;<br />
however, any portion of the <strong>Soft</strong>ware merged into another<br />
computer program shall be deemed as derivative work and will<br />
continue to be subject to the terms of this Agreement; and<br />
iv © Aladdin Knowledge Systems, 2002
3. Sub-Licensing<br />
4. Prohibited Uses<br />
(iii) you are permitted to make a reasonable number of copies - but<br />
not more than three (3) - of the <strong>Soft</strong>ware solely for development<br />
and backup purposes. The <strong>Soft</strong>ware shall not be used for any<br />
other purposes.<br />
After merging the <strong>Soft</strong>ware in your computer program(s)<br />
according to section 2 above, you may sub-license, pursuant to<br />
the terms of this Agreement, the merged <strong>Soft</strong>ware and resell the<br />
hardware components of the HASP ® keys which you purchased<br />
from Aladdin, to distributors and/or users. Preceding such a sale<br />
and sub-licensing, you shall incorporate by reference in your<br />
contracts with such distributors and/or users, and otherwise<br />
provide for all distributors and/or users to be bound by, the<br />
warranties, disclaimers, and license terms specified by Aladdin in<br />
this Agreement.<br />
Except as specifically permitted in Sections 1, 2 and 3 above, you<br />
agree not to<br />
(i) use, modify, merge or sub-license the <strong>Soft</strong>ware or any other of<br />
Aladdin's products except as expressly authorized in this<br />
Agreement and in the Developer's <strong>Guide</strong>; and<br />
(ii) sell, license (or sub-license), lease, assign, transfer, pledge, or<br />
share your rights under this License with/to anyone else; and<br />
(iii) modify, disassemble, decompile, reverse engineer, revise or<br />
enhance the <strong>Soft</strong>ware or attempt to discover the <strong>Soft</strong>ware's source<br />
code; and<br />
(iv) place the <strong>Soft</strong>ware onto a server so that it is accessible via a<br />
public network; and<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> v
5. Limited Warranty<br />
6. Warranty Disclaimer<br />
(v) use any back-up or archival copies of the <strong>Soft</strong>ware (or allow<br />
someone else to use such copies) for any purpose other than to<br />
replace an original copy if it is destroyed or becomes defective. If<br />
you are a member of the European Union, this agreement does<br />
not affect your rights under any legislation implementing the EC<br />
Council Directive on the Legal Protection of Computer Programs.<br />
If you seek any information within the meaning of that Directive<br />
you should initially approach Aladdin.<br />
Aladdin warrants, for your benefit alone, that<br />
(i) the <strong>Soft</strong>ware, when and as delivered to you, and for a period of<br />
three (3) months after the date of delivery to you, will perform in<br />
substantial compliance with the Developer's <strong>Guide</strong>, provided that<br />
it is used on the computer hardware and with the operating system<br />
for which it was designed; and<br />
(ii) that the HASP ® key, for a period of twelve (12) months after<br />
the date of delivery to you, will be substantially free from<br />
significant defects in materials and workmanship.<br />
ALADDIN DOES NOT WARRANT THAT ANY OF ITS<br />
PRODUCT(S) WILL MEET YOUR REQUIRMENTS OR<br />
THAT ITS OPERATION WILL BE UNINTERRUPTED OR<br />
ERROR-FREE. TO THE EXTENT ALLOWED BY LAW,<br />
ALADDIN EXPRESSLY DISCLAIMS ALL EXPRESS<br />
WARRANTIES NOT STATED HERE AND ALL IMPLIED<br />
WARRANTIES, INCLUDING, BUT NOT LIMITED TO,<br />
THE IMPLIED WARRANTIES OF MERCHANTABILITY<br />
AND FITNESS FOR A PARTICULAR PURPOSE. NO<br />
ALADDIN'S DEALER, DISTRIBUTOR, RESELLER, AGENT<br />
OR EMPLOYEE IS AUTHORIZED TO MAKE ANY<br />
MODIFICATIONS, EXTENSIONS, OR ADDITIONS TO<br />
THIS WARRANTY. If any modifications are made to the<br />
<strong>Soft</strong>ware or to any other part of the Product by you during the<br />
warranty period; if the media and the HASP ® key is subjected to<br />
vi © Aladdin Knowledge Systems, 2002
7. Limitation of Remedies<br />
accident, abuse, or improper use; or if you violate any of the terms<br />
of this Agreement, then the warranty in Section 5 above, shall<br />
immediately be terminated. The warranty shall not apply if the<br />
<strong>Soft</strong>ware is used on or in conjunction with hardware or program<br />
other than the unmodified version of hardware and program with<br />
which the <strong>Soft</strong>ware was designed to be used as described in the<br />
Developer's <strong>Guide</strong>.<br />
In the event of a breach of the warranty set forth above, Aladdin's<br />
sole obligation shall be, at Aladdin's sole discretion:<br />
(i) to replace or repair the Product, or component thereof, that<br />
does not meet the foregoing limited warranty, free of charge;<br />
(ii) to refund the price paid by you for the Product, or component<br />
thereof. Any replacement or repaired component will be<br />
warranted for the remainder of the original warranty period or 30<br />
days, whichever is longer. Warranty claims must be made in<br />
writing during the warranty period and within seven (7) days of the<br />
observation of the defect accompanied by evidence satisfactory to<br />
Aladdin. All Products should be returned to the distributor from<br />
which they were purchased (if not purchased directly from<br />
Aladdin) and shall be shipped by the returning party with freight<br />
and insurance paid. The Product or component thereof must be<br />
returned with a copy of your receipt.<br />
8. Exclusion Of Consequential Damages<br />
The parties acknowledge, that the Product is inherently complex<br />
and may not be completely free of errors. ALADDIN SHALL<br />
NOT BE LIABLE (WHETHER UNDER CONTRACT, TORT<br />
(INCLUDING NEGLIGENCE) OR OTHERWISE) TO YOU,<br />
OR ANY THIRD PARTY (INCLUDING, WITHOUT<br />
LIMITATION, YOUR DISTRIBUTORS AND USERS OF<br />
YOUR SOFTWARE PROGRAM) FOR ANY LOSS OR<br />
DAMAGE (INCLUDING INDIRECT, SPECIAL OR<br />
CONSEQUENTIAL DAMAGES), INCLUDING, WITHOUT<br />
LIMITATION, ANY LOSS OR DAMAGE TO BUSINESS<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> vii
9. Limitation Of Liability<br />
10. No Other Warranties<br />
11. Termination<br />
EARNINGS, LOST PROFITS OR GOODWILL AND LOST<br />
OR DAMAGED DATA OR DOCUMENTATION,<br />
SUFFERED BY ANY PERSON, ARISING FROM AND/OR<br />
RELATED WITH AND/OR CONNECTED TO ANY USE<br />
OF THE SOFTWARE AND/OR ANY COMPONENT OF<br />
THE PRODUCT, EVEN IF ALADDIN IS ADVISED OF THE<br />
POSSIBILITY OF SUCH DAMAGES.<br />
IN THE EVENT THAT, NOTWITHSTANDING THE<br />
TERMS OF THIS AGREEMENT, ALADDIN IS FOUND<br />
LIABLE FOR DAMAGES BASED ON ANY DEFECT OR<br />
NONCONFORMITY OF ITS PRODUCT(S), ITS TOTAL<br />
LIABILITY FOR EACH DEFECTIVE PRODUCT SHALL<br />
NOT EXCEED THE PRICE PAID TO ALADDIN FOR<br />
SUCH DEFECTIVE PRODUCT.<br />
Except as specifically provided herein, Aladdin makes no warranty<br />
or representation, either express or implied, with respect to its<br />
products as described in the preamble of this agreement, including<br />
its quality, performance, merchantability or fitness for a particular<br />
purpose.<br />
Your failure to comply with the terms of this Agreement shall<br />
terminate your license and this Agreement. Upon termination of<br />
this License Agreement by Aladdin:<br />
(i) the License granted to you in this Agreement shall expire and<br />
you, upon termination, shall discontinue all further use (including<br />
without limitation sub-licensing) of the <strong>Soft</strong>ware and other<br />
licensed Product(s); and<br />
viii © Aladdin Knowledge Systems, 2002
(ii) you shall promptly return to Aladdin all tangible property<br />
representing Aladdin's intellectual property rights and all copies<br />
thereof and/or shall erase/delete any such information held by it<br />
in electronic form. Sections 1, 4, 6, 7, 8, 9, 10, 11 and 12 shall<br />
survive any termination of this Agreement.<br />
12. Governing Law & Jurisdiction<br />
13. Third Party <strong>Soft</strong>ware<br />
14. Miscellaneous<br />
This Agreement shall be construed and governed in accordance<br />
with the laws of Israel (except for conflict of law provisions) and<br />
only the courts in Israel shall have jurisdiction in any conflict or<br />
dispute arising out of this Agreement. The application of the<br />
United Nations Convention of Contracts for the International Sale<br />
of Goods is expressly excluded. The failure of either party to<br />
enforce any rights granted hereunder or to take action against the<br />
other party in the event of any breach hereunder shall not be<br />
deemed a waiver by that party as to subsequent enforcement of<br />
rights or subsequent actions in the event of future breaches.<br />
If the Product contains any software provided by third parties,<br />
such third party's software is provided "As Is" without any<br />
warranty of any kind and Sections 2, 3, 4, 6, 8, 9-13 of this<br />
Agreement shall apply to all such third party software providers<br />
and third party software as if they were Aladdin and the Product<br />
respectively.<br />
This Agreement represents the complete agreement concerning<br />
this License and may be amended only by a written agreement<br />
executed by both parties. If any provision of this Agreement is<br />
held to be unenforceable, such provision shall be reformed only to<br />
the extent necessary to make it enforceable.<br />
I HAVE READ AND UNDERSTOOD THIS LICENSE<br />
AGREEMENT AND AGREE TO BE BOUND BY ALL OF<br />
THE TERMS.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> ix
CE Compliance<br />
FCC Compliance<br />
Y2K Compliance<br />
UL Certification<br />
The HASP product line complies with the CE EMC Directive and<br />
related standards*. HASP products are marked with the CE logo<br />
and a HASP CE conformity card is included in every shipment or<br />
upon demand.<br />
*EMC directive 89/336/EEC and related standards EN 55022,<br />
EN 50082-1.<br />
FCC authorities have determined that HASP is not a Class B<br />
Computing Device Peripheral and therefore does not require FCC<br />
regulation.<br />
The HASP product line is Year 2000 (Y2K) compliant. Y2K<br />
compliance means that HASP products will record, store, process<br />
and present calendar dates falling on or after January 1, 2000 in<br />
the same manner, and with the same functionality, as it records,<br />
stores, processes, and presents calendar dates falling on or<br />
before December 31, 1999.<br />
We supply a Y2K compliance card with every shipment or upon<br />
demand.<br />
The HASP product line successfully completed UL 94 Tests for<br />
Flammability of Plastic Materials for Parts in Devices and<br />
Appliances. HASP products comply with UL 1950 Safety of<br />
Information Technology Equipment regulations.<br />
x © Aladdin Knowledge Systems, 2002
ISO 9002 Certification<br />
The HASP product line is designed and manufactured by Aladdin<br />
Knowledge Systems, Inc., an ISO 9002-certified company.<br />
Aladdin's quality assurance system is approved by the International<br />
Organization for Standardization (ISO), ensuring that Aladdin<br />
products and customer service standards consistently meet<br />
specifications in order to provide outstanding customer<br />
satisfaction.<br />
Certificate of Compliance<br />
Upon request, Aladdin Knowledge Systems, Inc. will supply a<br />
Certificate of Compliance to any software developer who wishes<br />
to demonstrate that the HASP product line conforms to the<br />
specifications stated. <strong>Soft</strong>ware developers can distribute this<br />
certificate to the end user along with their programs.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> xi
Contents<br />
List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix<br />
About the <strong>HASP4</strong> Programmer’s <strong>Guide</strong> . . . . . . . . . . . . . . . . . . . . xxi<br />
Part 1: Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1<br />
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3<br />
About HASP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3<br />
Advantages of the HASP System . . . . . . . . . . . . . . . . . . . . . . . 4<br />
HASP Protection Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8<br />
HASP Developer Kit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
HASP Starter Kit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
Basic Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . .13<br />
How Does HASP Work?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
Identifying the HASP Key . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
HASP Protection Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . 19<br />
The Full Authorization System (FAS) . . . . . . . . . . . . . . . . . . 20<br />
Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . . . 22<br />
Installing HASP . . . . . . . . . . . . . . . . . . . . . . . . . . .25<br />
HASP <strong>Soft</strong>ware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25<br />
<strong>Soft</strong>ware Protection – Quick Reference . . . . . . . . . . . . . . . . . 28<br />
Installing HASP under Windows . . . . . . . . . . . . . . . . . . . . . . 29<br />
Installing HASP under Mac . . . . . . . . . . . . . . . . . . . . . . . . . . 32<br />
Installing HASP under Linux . . . . . . . . . . . . . . . . . . . . . . . . . 35<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> xiii
Contents<br />
Part 2: Using HASP Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41<br />
Protecting with HASP Envelope . . . . . . . . . . . . . 43<br />
About the HASP Envelope . . . . . . . . . . . . . . . . . . . . . . . . . . .44<br />
Starting HASP Envelope. . . . . . . . . . . . . . . . . . . . . . . . . . . . .45<br />
Protecting an Application . . . . . . . . . . . . . . . . . . . . . . . . . . . .46<br />
Protecting Win32 Data Files . . . . . . . . . . . . . . . . . . . . . . . . . .47<br />
Saving FAS Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51<br />
HASP Envelope Parameters . . . . . . . . . . . . . . . . . . . . . . . . . .53<br />
HASP Envelope Command-Line Switches . . . . . . . . . . . . . .65<br />
Additional <strong>HASP4</strong> Net Information . . . . . . . . . . . . . . . . . . .70<br />
Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . . .71<br />
Accessing Keys with HASP Edit. . . . . . . . . . . . . . 73<br />
HASP Edit for Windows. . . . . . . . . . . . . . . . . . . . . . . . . . . . .74<br />
HASP Edit for Mac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97<br />
Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . .104<br />
Assisting End-Users . . . . . . . . . . . . . . . . . . . . . . 107<br />
Creating Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108<br />
Diagnosing HASP Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . .109<br />
Part 3: Using the HASP API. . . . . . . . . . . . . . . . . . . . . . . . . . .113<br />
Protecting with the HASP API . . . . . . . . . . . . . . 115<br />
Preparing for API Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . .116<br />
Implementing the HASP API . . . . . . . . . . . . . . . . . . . . . . . .117<br />
HASP Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122<br />
Enabling Local and Network Protection . . . . . . . . . . . . . . .127<br />
HASP Test Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128<br />
Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . .129<br />
Protection Strategies. . . . . . . . . . . . . . . . . . . . . 133<br />
<strong>Soft</strong>ware Protection Attacks . . . . . . . . . . . . . . . . . . . . . . . . .134<br />
<strong>Ti</strong>ps and Tricks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135<br />
Basic HASP Services . . . . . . . . . . . . . . . . . . . . . . 143<br />
Service 1: IsHasp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146<br />
Service 5: HaspStatus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .147<br />
xiv © Aladdin Knowledge Systems, 2002
Contents<br />
Service 60: HaspEncodeData . . . . . . . . . . . . . . . . . . . . . . . . 149<br />
Service 61: HaspDecodeData . . . . . . . . . . . . . . . . . . . . . . . . 150<br />
<strong>HASP4</strong> Memory Services. . . . . . . . . . . . . . . . . . .151<br />
Service 3: ReadWord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154<br />
Service 4: WriteWord. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155<br />
Service 6: HaspID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156<br />
Service 50: ReadBlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157<br />
Service 51: WriteBlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158<br />
<strong>HASP4</strong> <strong>Ti</strong>me Services. . . . . . . . . . . . . . . . . . . . . .159<br />
Service 70: Set<strong>Ti</strong>me . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162<br />
Service 71: Get<strong>Ti</strong>me . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163<br />
Service 72: SetDate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164<br />
Service 73: GetDate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165<br />
Service 74: WriteByte. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166<br />
Service 75: ReadByte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167<br />
Service 76: WriteBlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168<br />
Service 77: ReadBlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169<br />
Service 78: HaspID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170<br />
<strong>HASP4</strong> Net Services . . . . . . . . . . . . . . . . . . . . . . .171<br />
Using <strong>HASP4</strong> Net Services. . . . . . . . . . . . . . . . . . . . . . . . . . 172<br />
Service 40: LastStatus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176<br />
Service 42: Login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177<br />
Service 43: Logout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179<br />
Service 44: ReadWord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181<br />
Service 45: WriteWord. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182<br />
Service 46: HaspID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183<br />
Service 48: Idle<strong>Ti</strong>me . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184<br />
Service 52: ReadBlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186<br />
Service 53: WriteBlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188<br />
Service 85: SetConfigFilename . . . . . . . . . . . . . . . . . . . . . . . 190<br />
Service 88: HaspEncodeData . . . . . . . . . . . . . . . . . . . . . . . . 191<br />
Service 89: HaspDecodeData . . . . . . . . . . . . . . . . . . . . . . . . 193<br />
Service 96: SetServerByName. . . . . . . . . . . . . . . . . . . . . . . . 195<br />
Service 104: HaspQueryLicense . . . . . . . . . . . . . . . . . . . . . . 196<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> xv
Contents<br />
HASP API Status Codes . . . . . . . . . . . . . . . . . . . 197<br />
Status Codes for All HASP Keys . . . . . . . . . . . . . . . . . . . . .197<br />
Status Codes for <strong>HASP4</strong> <strong>Ti</strong>me Keys . . . . . . . . . . . . . . . . . .199<br />
Status Codes for <strong>HASP4</strong> Net . . . . . . . . . . . . . . . . . . . . . . . .200<br />
Part 4: Using HASP in a Network . . . . . . . . . . . . . . . . . . . . . .207<br />
<strong>HASP4</strong> Net Basic Concept . . . . . . . . . . . . . . . . . 209<br />
What is <strong>HASP4</strong> Net? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .209<br />
How Does <strong>HASP4</strong> Net Work? . . . . . . . . . . . . . . . . . . . . . . .210<br />
Preparing Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .212<br />
Using <strong>HASP4</strong> Net . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .213<br />
Distributing <strong>HASP4</strong> Net . . . . . . . . . . . . . . . . . . . . . . . . . . . .215<br />
Supported Protocols, Platforms and Operating Systems. . .217<br />
Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . .218<br />
Protecting Applications with <strong>HASP4</strong> Net . . . . . 221<br />
HASP Envelope Options for <strong>HASP4</strong> Net . . . . . . . . . . . . . .222<br />
<strong>HASP4</strong> Net API Services . . . . . . . . . . . . . . . . . . . . . . . . . . .223<br />
Managing <strong>HASP4</strong> Net Licenses. . . . . . . . . . . . . 227<br />
How does the HASP License Manager Work?. . . . . . . . . . .228<br />
HASP License Manager for Windows . . . . . . . . . . . . . . . . .229<br />
HASP License Manager for Mac. . . . . . . . . . . . . . . . . . . . . .232<br />
HASP License Manager on Novell File Server . . . . . . . . . .235<br />
Customizing the HASP License Manager . . . . . . . . . . . . . .236<br />
Configuring <strong>HASP4</strong> Net Clients. . . . . . . . . . . . 247<br />
Search Sequence for Configuration File . . . . . . . . . . . . . . . .247<br />
Sections in the Configuration File. . . . . . . . . . . . . . . . . . . . .248<br />
Specifying Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .249<br />
Monitoring <strong>HASP4</strong> Net Licenses. . . . . . . . . . . . 257<br />
Distributing Aladdin Monitor . . . . . . . . . . . . . . . . . . . . . . . .257<br />
Installing Aladdin Monitor . . . . . . . . . . . . . . . . . . . . . . . . . .258<br />
Settings for Aladdin Monitor . . . . . . . . . . . . . . . . . . . . . . . .258<br />
Checking the Properties of HASP License Manager . . . . . .259<br />
Checking HASP Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .260<br />
Starting and Stopping HASP License Manager as a Service262<br />
xvi © Aladdin Knowledge Systems, 2002
Contents<br />
Adapting <strong>HASP4</strong> Net to the Network . . . . . . . .263<br />
Defining the Range of Stations under IPX . . . . . . . . . . . . . 263<br />
Defining the Range of Stations under TCP/IP . . . . . . . . . . 264<br />
Defining the Range of Stations under NetBIOS . . . . . . . . . 266<br />
Adapting the <strong>Ti</strong>meout Length . . . . . . . . . . . . . . . . . . . . . . . 267<br />
Defining the Number of Protected Applications Served . . 267<br />
Part 5: Using the Remote Update System. . . . . . . . . . . . . . . 269<br />
Remote Update System . . . . . . . . . . . . . . . . . . .271<br />
Implementing RUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272<br />
Creating the RUS Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . 275<br />
The Vendor Utility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277<br />
The Customer Utility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286<br />
Remote Update System Win32 API . . . . . . . . . .291<br />
Implementing RUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292<br />
Functions Provided in Vendor DLL. . . . . . . . . . . . . . . . . . . 293<br />
Functions Provided in Client DLL. . . . . . . . . . . . . . . . . . . . 297<br />
Return Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299<br />
Customization Utility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301<br />
Troubleshooting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303<br />
Check List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304<br />
Problems and Solutions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305<br />
HASP Demo Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313<br />
Technical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315<br />
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319<br />
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> xvii
List of Tables<br />
HASP Models.................................................................................................................................. 8<br />
Device Driver Installation Tools (Windows) .......................................................................... 29<br />
Command Line Switches for aksusbd (Mac) ............................................................................ 33<br />
Command Line Switches for aksparlnx.o (Linux) ................................................................... 37<br />
Command Line Switches for aksusbd (Linux).......................................................................... 39<br />
HASP Envelope Main Tab Options......................................................................................... 54<br />
HASP Envelope Option Tab Options..................................................................................... 57<br />
HASP Envelope DataHASP Tab Options.............................................................................. 62<br />
HASP Envelope Engines ........................................................................................................... 65<br />
HASP Envelope Switches .......................................................................................................... 65<br />
Key Access History Panel ........................................................................................................ 111<br />
Parameters for HASP Stand-Alone Keys .............................................................................. 118<br />
Parameters for <strong>HASP4</strong> Net Keys............................................................................................ 118<br />
PortNum Values and Ports Searched..................................................................................... 119<br />
HASP Models and Relevant Services ..................................................................................... 122<br />
Basic HASP Services................................................................................................................. 123<br />
<strong>HASP4</strong> Memory Services ......................................................................................................... 124<br />
<strong>HASP4</strong> <strong>Ti</strong>me Services............................................................................................................... 125<br />
<strong>HASP4</strong> Net Services ................................................................................................................. 126<br />
Basic HASP Services and Parameters..................................................................................... 144<br />
<strong>HASP4</strong> Memory Services and Parameter .............................................................................. 152<br />
<strong>HASP4</strong> <strong>Ti</strong>me Services and Parameters .................................................................................. 160<br />
<strong>HASP4</strong> Net Services and Parameters..................................................................................... 173<br />
Status Codes for All HASP Keys............................................................................................ 197<br />
Status Codes for <strong>HASP4</strong> <strong>Ti</strong>me Keys...................................................................................... 199<br />
<strong>HASP4</strong> Net Status Codes......................................................................................................... 200<br />
<strong>HASP4</strong> Net Warning Codes .................................................................................................... 204<br />
<strong>HASP4</strong> Net Supported Platforms........................................................................................... 217<br />
<strong>HASP4</strong> Net Protocols............................................................................................................... 217<br />
HASP Envelope Switches for <strong>HASP4</strong> Net ........................................................................... 223<br />
<strong>HASP4</strong> Net API Services......................................................................................................... 224<br />
HASP License Manager Switches ........................................................................................... 236<br />
Search Order for nhsrv.ini.......................................................................................................... 239<br />
HASP LM Installation API Error Codes............................................................................... 244<br />
Search Order for Configuration File ...................................................................................... 248<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> xix
HASP License Manager Information ..................................................................................... 259<br />
HASP Key Information............................................................................................................ 260<br />
HASP Information .................................................................................................................... 261<br />
Program Table............................................................................................................................ 261<br />
Login Table................................................................................................................................. 261<br />
Vendor Utility Command Line Switches ............................................................................... 282<br />
Vendor Utility Error Codes...................................................................................................... 284<br />
Customer Utility Command Line Switches............................................................................ 289<br />
Customer Utility Error Codes.................................................................................................. 290<br />
Passwords of HASP Demo Memory Keys............................................................................ 313<br />
Passwords of <strong>HASP4</strong> Std Demo Keys................................................................................... 313<br />
General Specifications for All HASP keys............................................................................. 315<br />
Specifications for <strong>HASP4</strong> Std, <strong>HASP4</strong> M1, <strong>HASP4</strong> M4, <strong>HASP4</strong> Net ............................. 316<br />
Specifications for <strong>HASP4</strong> <strong>Ti</strong>me............................................................................................... 316<br />
Specification for USB models.................................................................................................. 317<br />
HASP PC-Card........................................................................................................................... 317<br />
AladdinCARD ISA .................................................................................................................... 318<br />
AladdinCARD PCI.................................................................................................................... 318<br />
xx © Aladdin Knowledge Systems, 2002
About the <strong>HASP4</strong><br />
Programmer’s <strong>Guide</strong><br />
The HASP Programmer’s <strong>Guide</strong> is designed to help you, the software<br />
developer, protect your application in the way that most suits your<br />
needs.<br />
The first part, "Getting Started" (page 1), introduces the HASP<br />
protection system. It gives an overview of HASP hardware and<br />
software and leads you through the installation of the HASP<br />
software. This part is relevant regardless of which key and which<br />
protection method you are using.<br />
The second part, "Using HASP Tools" (page 41), helps you to use<br />
HASP utilities for Windows and Mac which enable you to protect<br />
your software easily, to program your HASP keys for distribution<br />
and to assist your customers. This part is relevant regardless of<br />
which key and which protection method you are using.<br />
The third part, "Using the HASP API" (page 113), introduces the<br />
HASP API protection methods and strategies. It provides detailed<br />
descriptions of all HASP API services. This part is only relevant, if<br />
you want to protect you software by adding HASP API calls to<br />
your source code.<br />
The fourth part, "Using HASP in a Network" (page 207),<br />
introduces the <strong>HASP4</strong> Net system and tools. This part is relevant<br />
if you protect your software for networks using <strong>HASP4</strong> Net keys.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> xxi
About the <strong>HASP4</strong> Programmer’s <strong>Guide</strong><br />
The fifth part, "Using the Remote Update System" (page 269),<br />
provides you with information on tools and the API which enable<br />
you to update your customers’ HASP keys remotely.<br />
To help you understand the HASP system in greater depth,<br />
frequently asked questions are included at the end of most<br />
chapters. For your convenience, a comprehensive glossary<br />
provides concise explanations of HASP terms.<br />
Information on technical specifications, passwords for HASP<br />
Demo keys and troubleshooting can be found in the appendices.<br />
xxii © Aladdin Knowledge Systems, 2002
Part 1<br />
Getting Started<br />
This part introduces the HASP protection system. It gives an<br />
overview of HASP hardware and software and leads you through<br />
the installation of the HASP software.<br />
The chapter "Introduction" (page 3) introduces the advantages<br />
and security features of the HASP system and gives an overview of<br />
HASP hardware keys and supported platforms and operating<br />
systems.<br />
The chapter "Basic Concept" (page 13) explains the basic concept<br />
of the HASP system and describes the contents of the HASP Kits.<br />
The chapter "Installing HASP" (page 25) gives an overview of the<br />
HASP software, the main stages of software protection and the<br />
basic installation procedures for the various operating systems.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 1
About HASP<br />
Part 1 - Chapter 1<br />
Introduction<br />
Welcome to Aladdin’s HASP – the professional software<br />
protection system. This chapter describes the HASP protection<br />
system, its security features and its advantages. It introduces the<br />
family of HASP protection keys and describes the contents of the<br />
HASP Developer’s and Starter’s Kits.<br />
HASP is a state-of-the-art hardware-based system that protects<br />
software from illegal use by preventing unauthorized access to and<br />
execution of protected applications.<br />
At runtime, the protected application queries the HASP connected<br />
to the computer. If the response returned by the HASP is as it<br />
should be and if the correct HASP algorithm is identified, the<br />
application executes. If the response is incorrect, the application<br />
may not load, may switch to a demo version, or limit certain<br />
features.<br />
Implementing HASP security is easy, yet the level of security it<br />
provides is extremely high. Once your application is protected, it<br />
can be activated only when the HASP key originally supplied with<br />
your software is attached to the computer.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 3
Introduction Part 1 - Chapter 1<br />
Advantages of the HASP System<br />
Substantial Developer Flexibility<br />
The HASP system provides the widest range of products,<br />
solutions, and features in the software protection industry –<br />
including memory, network and time-based solutions for multiple<br />
hardware platforms.<br />
Maximum ease-of-use<br />
A short learning curve and a standard application programming<br />
interface (API) for all products ensures easy and rapid<br />
incorporation of the HASP software into the application.<br />
Support for a wide range of programming<br />
environments<br />
The HASP system has interfaces for numerous compilers and<br />
programming languages enabling you to deliver your HASPprotected<br />
application on all major operating systems.<br />
Support for a wide range of operating systems<br />
Supported operating systems are: Windows 3.x, Windows 95, 98,<br />
ME, 2000, NT, Linux, Mac OS 8.6, Mac OS 9.x, Mac OS X.<br />
Cross-platform solution<br />
HASP (USB version) provides a platform-independent solution.<br />
One HASP key can be used to protect Windows, Mac and Linux<br />
applications, thus saving you development time in integrating<br />
protection, and on shipping logistics and costs.<br />
4 © Aladdin Knowledge Systems, 2002
Getting Started Introduction<br />
State-of-the-art security<br />
Full-custom ASIC Chip or Advanced Micro-<br />
Controller<br />
All HASP keys (except USB models) are based on a proprietary,<br />
full-custom ASIC (Application Specific Integrated Circuit) chip.<br />
The 2800-gate, 1.2-micron HASP ASIC, designed in-house by<br />
Aladdin engineers, prevents reverse engineering and makes HASP<br />
hardware virtually impossible to crack.<br />
USB models are unique in that they contain an advanced micro<br />
controller that provides an inherently high level of security.<br />
Advanced Encoding Capabilities in the Hardware<br />
The advanced data encoding and decoding facilities incorporated<br />
in the HASP hardware allow a far closer integration of the<br />
hardware into the software being protected. Intelligent functions<br />
within the key itself allow critical functions of the software to be<br />
dependent on the presence of the correct key, otherwise they will<br />
not operate correctly.<br />
Any data used by the software can be encoded at any point in the<br />
software. The encoded data is a function of the data sent to the<br />
HASP and a unique, customer-specific “developer code”. This<br />
means that this facility provides far more comprehensive<br />
protection than simple periodical checks for the presence of a key.<br />
Advanced Protection Algorithms and Anti-<br />
Debugging Technology<br />
HASP software uses state-of-the-art proprietary code protection<br />
algorithms, plus the most advanced anti-debugging technology in<br />
the industry. Special anti-hacking features implemented in the<br />
HASP software create practically impenetrable obstacles for<br />
would-be hackers.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 5
Introduction Part 1 - Chapter 1<br />
Scrambled Communication<br />
Benefits to Your Customer<br />
All communication between the application and the HASP is<br />
randomly scrambled to protect the vital link between them. This<br />
feature prevents emulation of the hardware key.<br />
HASP protection benefits both you and your customers. The<br />
following are a few reasons why software protection is good for<br />
your customers.<br />
Cost-Effective <strong>Soft</strong>ware<br />
As HASP protection increases your sales and revenues, you can<br />
budget more money to the ongoing development and support of<br />
your product. In turn, your paying customers can enjoy more<br />
advanced products, faster development times and higher-quality<br />
technical support.<br />
Protecting the License Agreement<br />
<strong>Soft</strong>ware protection helps maintain the integrity of your software<br />
license agreement. HASP is the least painful, least intrusive means<br />
of assuring compliance with the agreement. It ensures that<br />
customers do not have to police their own employees or risk<br />
breaking the license agreement.<br />
Protecting Investments of Legitimate Users<br />
HASP protects legitimate end users from the unfair practices of<br />
dishonest end users who use unpaid-for software and waste your<br />
valuable technical support resources.<br />
Worldwide Service and Support<br />
Multiple Production Facilities<br />
Production facilities on three continents ensure rapid and punctual<br />
supply, with back-up capabilities if necessary.<br />
6 © Aladdin Knowledge Systems, 2002
Getting Started Introduction<br />
Local Service and Support in Over 40 Countries<br />
With 8 international offices and over 40 local distributors, support<br />
for HASP is available virtually whenever and wherever required.<br />
Aladdin Consulting<br />
For more detailed advice and training on HASP implementation<br />
issues, contact our team of international consultants. They can<br />
provide you with tailored training sessions on the following:<br />
Integration of HASP production and distribution in your<br />
company<br />
Analysis of the best protection strategy for your applications<br />
Help with algorithm design and even implementation of HASP<br />
protection in your software<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 7
Introduction Part 1 - Chapter 1<br />
HASP Protection Keys<br />
Table 1.1 HASP Models<br />
HASP keys are available for different ports and as various models.<br />
HASP Model Memory Size Full Authorization<br />
System<br />
Options<br />
Features Key Types<br />
<strong>HASP4</strong> Std. no memory no FAS encoding/decoding parallel, USB<br />
<strong>HASP4</strong> M1 112 bytes 16 applications encoding/decoding<br />
HASP ID<br />
<strong>HASP4</strong> M4 496 bytes 112 applications encoding/decoding<br />
HASP ID<br />
<strong>HASP4</strong> <strong>Ti</strong>me 496 + 16 bytes 8 applications<br />
expiration date<br />
<strong>HASP4</strong> Net 5 496 bytes 112 applications<br />
on 5 stations<br />
<strong>HASP4</strong> Net 10 496 bytes 112 applications<br />
on 10 stations<br />
<strong>HASP4</strong> Net 20 496 bytes 112 applications<br />
on 20 stations<br />
encoding/decoding<br />
HASP ID<br />
real-time clock<br />
encoding/decoding<br />
HASP ID<br />
network access<br />
encoding/decoding<br />
HASP ID<br />
network access<br />
encoding/decoding<br />
HASP ID<br />
network access<br />
parallel, USB<br />
parallel, USB,<br />
PC-Card<br />
parallel, USB<br />
parallel, USB<br />
parallel, USB<br />
parallel, USB<br />
8 © Aladdin Knowledge Systems, 2002
Getting Started Introduction<br />
HASP Model Memory Size Full Authorization<br />
System<br />
Options<br />
<strong>HASP4</strong> Net 50 496 bytes 112 applications<br />
on 50 stations<br />
<strong>HASP4</strong> Net 100 496 bytes 112 applications<br />
on 100 stations<br />
<strong>HASP4</strong> Net U 496 bytes 112 applications<br />
on an unlimited<br />
number of<br />
stations<br />
<strong>HASP4</strong> Key Types for Different Ports<br />
<strong>HASP4</strong> Key Models<br />
Features Key Types<br />
encoding/decoding<br />
HASP ID<br />
network access<br />
encoding/decoding<br />
HASP ID<br />
network access<br />
encoding/decoding<br />
HASP ID<br />
network access<br />
parallel, USB<br />
parallel, USB<br />
parallel, USB<br />
<strong>HASP4</strong> keys are available in parallel port, USB and PC-Card<br />
versions which are identical in functionality.<br />
<strong>HASP4</strong> parallel keys connect to parallel ports and can only be<br />
used to protect applications running on PCs.<br />
<strong>HASP4</strong> USB keys are cross-platform keys that connect to<br />
USB ports and can be used to protect applications running on<br />
PCs and Mac platforms.<br />
<strong>HASP4</strong> PC-Cards are advanced software protection cards that<br />
are inserted in PC-Card (PCMCIA) slots found on most<br />
notebook PCs.<br />
<strong>HASP4</strong> Standard – Low cost, high security<br />
<strong>HASP4</strong> Standard is the most cost-effective software protection<br />
solution we offer. Using all the state-of-the-art techniques included<br />
in the HASP system, <strong>HASP4</strong> Std. offers an extremely secure, yet<br />
surprisingly low-cost solution for your protection needs.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 9
Introduction Part 1 - Chapter 1<br />
<strong>HASP4</strong> Std. is available for the parallel port and for the USB port.<br />
<strong>HASP4</strong> M1 and <strong>HASP4</strong> M4 – The most versatile<br />
and secure software protection keys available<br />
<strong>HASP4</strong> M1 and M4 combine the inherently high level of<br />
encryption-based security with the flexibility of up to 496 bytes of<br />
secured read/write memory and a unique ID number for each key.<br />
The <strong>HASP4</strong> memory and its in-the-field upgrading capabilities let<br />
you implement your marketing strategy by enforcing sales models<br />
such as subscription, demo, try-before-you-buy and rental for up<br />
to 112 applications – all in a single key.<br />
<strong>HASP4</strong> M1 is available for the parallel port and for the USB port.<br />
<strong>HASP4</strong> M4 is available for the parallel port, for the USB port and<br />
as PC-Card.<br />
<strong>HASP4</strong> <strong>Ti</strong>me – <strong>Soft</strong>ware Protection with a Real-<br />
<strong>Ti</strong>me Clock<br />
<strong>HASP4</strong> <strong>Ti</strong>me contains an internal real-time clock, indicating the<br />
exact time (hours, minutes and seconds) and date (day, month,<br />
year. Specifically designed to enable software renting or leasing,<br />
<strong>HASP4</strong> <strong>Ti</strong>me also lets you charge clients periodically for software<br />
use and maintenance. Based on <strong>HASP4</strong> M4, <strong>HASP4</strong> <strong>Ti</strong>me<br />
contains 512 bytes of secured read/write memory and a unique ID<br />
number for each key. Using the <strong>HASP4</strong> <strong>Ti</strong>me memory you can<br />
control the distribution and access of up to 8 different software<br />
modules and different software packages, rent or lease software<br />
and distribute demos which expire after a specific date.<br />
<strong>HASP4</strong> Std. is available for the parallel port and for the USB port.<br />
<strong>HASP4</strong> Net - Providing Licenses in a Network<br />
The ultimate software protection solution for various network<br />
environments. Connect a single <strong>HASP4</strong> Net to any network<br />
station to protect your application and to limit the number of<br />
stations using it simultaneously. <strong>HASP4</strong> Net provides all the<br />
protection features of <strong>HASP4</strong> M4.<br />
10 © Aladdin Knowledge Systems, 2002
Getting Started Introduction<br />
HASP Developer Kit<br />
HASP Starter Kit<br />
The HASP Developer Kit contains everything you need to<br />
evaluate the HASP protection system, and includes the following:<br />
<strong>Soft</strong>ware<br />
The HASP software is contained on a single CD-ROM.<br />
Hardware<br />
Your HASP Developer Kit comes with a demo HASP key. The<br />
demo HASP key is either a <strong>HASP4</strong> M1, <strong>HASP4</strong> <strong>Ti</strong>me, or<br />
<strong>HASP4</strong> Net depending on the type of HASP key you requested<br />
when ordering the HASP Developer Kit.<br />
The demo HASP key you receive should be used for<br />
evaluation purposes only. When you order HASP keys,<br />
Aladdin assigns you a unique developer’s code that<br />
differentiates your keys from others.<br />
Documentation<br />
Your HASP Developer Kit includes one copy of the <strong>HASP4</strong><br />
Programmer’s <strong>Guide</strong>.<br />
The HASP Starter Kit is similar to the HASP Developer Kit,<br />
except that it contains 5 HASP keys that are unique to your<br />
company (2 keys in the case of <strong>HASP4</strong> Net). Your HASP key<br />
includes HASP passwords that only you know, thus ensuring that<br />
your keys are differentiated from other HASP keys.<br />
Whereas the demo HASP key you receive in a HASP Developer<br />
Kit should be used for evaluation purposes only, the HASP keys<br />
you receive in the HASP Starter Kit can be used to protect the<br />
application in preparation for distribution to your end users.<br />
With the HASP Starter Kit, you are ready to go. Simply protect<br />
your application and order the number of keys you need.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 11
Part 1 - Chapter 2<br />
Basic Concept<br />
To implement HASP protection effectively, we recommend that<br />
you familiarize yourself with the concepts and terms described in<br />
this chapter.<br />
If you are protecting with <strong>HASP4</strong> Net, you should also read<br />
"<strong>HASP4</strong> Net Basic Concept" (page 209) to familiarize yourself<br />
with specific terms and concepts for <strong>HASP4</strong> Net.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 13
Basic Concept Part 1 - Chapter 2<br />
How Does HASP Work?<br />
At runtime, the protected application queries the HASP connected<br />
to the computer. If the response returned by the HASP is as it<br />
should be and if the correct HASP algorithm is identified, the<br />
application executes. If the response is incorrect, the application<br />
may not load, may switch to a demo version, or limit certain<br />
features.<br />
Figure 2.1 HASP Protection Mechanism<br />
14 © Aladdin Knowledge Systems, 2002
Getting Started Basic Concept<br />
Identifying the HASP Key<br />
Protection is based on making access to the protected application<br />
dependent on the presence of the correct HASP key.<br />
HASP keys contain information specific for your company, thus<br />
ensuring the uniqueness of the HASP keys distributed by you.<br />
The presence of the appropriate HASP key can be checked by<br />
using the following methods:<br />
Use the hardware-based encryption engine.<br />
Check the key-specific ID<br />
Use the memory functionality<br />
Using the Encryption Engine<br />
When you implement HASP protection, you check for the<br />
presence of the HASP key. The HASP system performs these<br />
checks by encoding and decoding data via the HASP itself.<br />
Verifying the presence of the HASP using the data encoding and<br />
decoding functions requires a certain amount of planning. To start<br />
with, you must have some data that you have previously encoded.<br />
You then send that data to the HASP using the DecodeData<br />
service. There, it is decoded and you can check whether the<br />
decoded data is correct. If it is, then the HASP is present.<br />
The decoded data can be verified by using the data in your<br />
protected application. Refer to "Encode Internal and External<br />
Data" (page 135) for information on using decoded data.<br />
The encoded data is a function of the data sent to the HASP and a<br />
unique, customer-specific “developer code”. Thus, encoding the<br />
same string with two different developer codes will lead to<br />
different results.<br />
You can encode data using HASP Edit or the HASP API. For<br />
more information refer to "Accessing Keys with HASP Edit"<br />
(page 73) or to "Protecting with the HASP API" (page 115).<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 15
Basic Concept Part 1 - Chapter 2<br />
Figure 2.2 Decoding Data to Verify the HASP Key<br />
Developer-Specific Information<br />
When you order keys from Aladdin, you receive keys which<br />
contain information specific to your company. This information is<br />
used to differentiate your keys from other developers’ keys.<br />
16 © Aladdin Knowledge Systems, 2002
Getting Started Basic Concept<br />
Developer Code<br />
The developer code is a unique code Aladdin assigns to each<br />
software developer. The developer code is burnt into the ASIC<br />
component of the HASP to prevent reverse engineering, thus<br />
ensuring total protection.<br />
You use the same developer code when you order additional<br />
HASP keys. The developer code is represented by the set of five to<br />
seven letters printed on the label of each HASP.<br />
HASP Passwords<br />
The HASP passwords are two integers assigned to each software<br />
developer. The passwords are based on your unique developer<br />
code and ensure that only you can access your HASP keys.<br />
Checking the HASP ID Number<br />
Each HASP memory key has a unique ID number. A protected<br />
application can check and verify this ID number.<br />
HASP keys with ID numbers let you distinguish between users of<br />
your application. By checking for the HASP ID number in your<br />
application you can decide how to respond if a specific HASP is or<br />
is not present.<br />
You can retrieve the HASP ID using HASP Edit. For more<br />
information refer to "Accessing Keys with HASP Edit" (page 73).<br />
Using the HASP Memory Options<br />
!<br />
Make sure to keep your passwords in a safe place, as<br />
they are used to access the HASP, protect your<br />
application and use the HASP utilities.<br />
You cannot order HASP keys with specific ID<br />
numbers. They are assigned randomly during<br />
manufacturing and are guaranteed not to be repeated.<br />
All HASP keys except <strong>HASP4</strong> Std. contain internal read/write<br />
memory. You can use the HASP memory do the following:<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 17
Basic Concept Part 1 - Chapter 2<br />
Control access to different software modules or different<br />
software packages<br />
Assign a unique code to each software user<br />
Rent or lease software and distribute demos which can be<br />
activated only a limited number of times<br />
Save passwords, program code, program variables, and any<br />
other data<br />
For information on the read/write memory available with<br />
different HASP keys refer to Table 1.1 (page 8).<br />
You can edit the memory using HASP Edit. For more information<br />
refer to "Accessing Keys with HASP Edit" (page 73).<br />
18 © Aladdin Knowledge Systems, 2002
Getting Started Basic Concept<br />
HASP Protection Methods<br />
HASP Envelope<br />
HASP offers two different yet very powerful protection methods:<br />
HASP Envelope<br />
HASP application programming interface (API)<br />
The basic protection method is HASP Envelope protection. This<br />
method adds a protective shield around executable files. The<br />
HASP Envelope scrambles your file, and incorporates HASP<br />
checks and anti-debugging features. After having protected your<br />
application with HASP Envelope, it cannot run without the<br />
correct HASP.<br />
As using the Envelope does not require access to the application<br />
source code, it is a quick and easy method of protection. At the<br />
same time, it provides a very high level of protection, making it<br />
virtually impossible to debug or disassemble your applications.<br />
For information on using HASP Envelope refer to "Protecting<br />
with HASP Envelope" (page 43).<br />
HASP Application Programming Interface (API)<br />
If you have the source code of the application you want to protect,<br />
you can link the HASP API to your application. As the API is<br />
both protected and encoded, this method also offers a high level<br />
of security.<br />
Use the API to insert calls to the HASP throughout your<br />
application. With the API, you can check for the presence of the<br />
HASP whenever you choose, and decide how to respond if the<br />
correct HASP is not connected. In addition, you can check a<br />
HASP memory key for sensitive data you may have stored in its<br />
memory.<br />
You must have access to the source code to implement the API.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 19
Basic Concept Part 1 - Chapter 2<br />
Which Method to Use<br />
You can use either the Envelope or the API alone, or combine<br />
both methods of protection.<br />
Use the Envelope when you want quick and easy protection, or<br />
when you do not have access to the source code.<br />
Use the API when you have access to the source code and when<br />
you want to customize your protection by implementing additional<br />
calls to the HASP key.<br />
Both the Envelope and the API are very powerful protection<br />
methods. Protecting your application with only one protection<br />
method ensures a high level of security. However, we recommend<br />
you implement both Envelope and API protection if possible.<br />
Each method has its unique features, and complements and<br />
enhances the other.<br />
Incorporate the HASP API into your application source code,<br />
compile, link the HASP object files or DLLs to your application,<br />
and then use the HASP Envelope protection on your executable<br />
file.<br />
The Full Authorization System (FAS)<br />
FAS Options<br />
The Full Authorization System is a powerful feature that allows<br />
you to protect multiple applications with a single HASP memory<br />
key, and to specify the conditions under which each application<br />
can be used.<br />
With FAS, you can limit the use of your application by:<br />
Setting the number of activations (<strong>HASP4</strong> M1, <strong>HASP4</strong> M4 and<br />
<strong>HASP4</strong> Net).<br />
This feature is useful for supplying demo versions of your<br />
application.<br />
Setting an expiration date (<strong>HASP4</strong> <strong>Ti</strong>me).<br />
20 © Aladdin Knowledge Systems, 2002
Getting Started Basic Concept<br />
How Does FAS Work?<br />
This feature is useful for leasing and renting your software.<br />
Setting the number of stations which can run the program<br />
simultaneously (<strong>HASP4</strong> Net).<br />
FAS is an optional feature of the Envelope when you protect with<br />
a HASP stand-alone memory key. With <strong>HASP4</strong> Net, on the other<br />
hand, FAS is not optional. FAS is an integral part of the <strong>HASP4</strong><br />
Net protection system, whether you protect with the Envelope or<br />
the HASP API.<br />
A HASP-protected application which implements FAS performs<br />
several checks.<br />
The protected application first determines whether or not the<br />
correct HASP is connected to the computer.<br />
If the correct HASP is present, the HASP memory is checked<br />
to verify that the application is listed as authorized to run.<br />
If the application is authorized to run then different checks are<br />
performed, depending on the model of HASP you are using:<br />
With <strong>HASP4</strong> M1 and <strong>HASP4</strong> M4, the HASP memory is<br />
checked to see that the number of authorized activations has<br />
not been exceeded. With each activation of the application, the<br />
number of authorized activations is decreased by one. When<br />
that number reaches 0, the application aborts with an error<br />
message.<br />
With <strong>HASP4</strong> <strong>Ti</strong>me, the expiration date listed in the <strong>HASP4</strong><br />
<strong>Ti</strong>me memory is checked and compared to the <strong>HASP4</strong> <strong>Ti</strong>me<br />
real-time clock. If the expiration date has passed, the<br />
application aborts with an error message.<br />
If you are using <strong>HASP4</strong> Net, refer to "How Does <strong>HASP4</strong> Net<br />
Work?" (page 210) to understand how FAS is automatically<br />
integrated into the <strong>HASP4</strong> Net system.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 21
Basic Concept Part 1 - Chapter 2<br />
Frequently Asked Questions<br />
Question Can I change my HASP passwords?<br />
Answer No. In order to ensure the highest protection level and to<br />
prevent reverse engineering of the hardware key, the HASP<br />
passwords are indelibly burnt into the ASIC component of the<br />
HASP during manufacturing. No one can then access the HASP<br />
to read and change these passwords.<br />
Question Can I give every customer a HASP with a unique code or<br />
password?<br />
Answer Yes. For this purpose, we recommend using HASP memory keys<br />
which contain a unique ID number for each key. In addition, you<br />
can program the memory of HASP memory keys individually for<br />
each of your customers.<br />
Question Is it possible that another developer will be given the same<br />
passwords as me?<br />
Answer No. Each developer is given a unique set of passwords.<br />
Question What happens to a <strong>HASP4</strong> <strong>Ti</strong>me when its battery dies?<br />
Answer The <strong>HASP4</strong> <strong>Ti</strong>me battery has a lifetime of 3-5 years, which by all<br />
measures is a long time in terms of software licensing. When the<br />
battery dies, <strong>HASP4</strong> <strong>Ti</strong>me behaves in the same way as a <strong>HASP4</strong><br />
M4. Also, any Envelope-protected application that implements<br />
FAS stops running. Battery life is increased if the <strong>HASP4</strong> <strong>Ti</strong>me<br />
key remains connected to an operating computer.<br />
22 © Aladdin Knowledge Systems, 2002
Getting Started Basic Concept<br />
Question Can stand-alone HASP keys be used in a network environment?<br />
Answer Yes. There are two options for using HASP in a network. The<br />
first is to connect a HASP to every station on which the<br />
protected application is running. The second – and more efficient<br />
option – is to protect your application with <strong>HASP4</strong> Net, a<br />
sophisticated protection system designed especially for network<br />
environments.<br />
<strong>HASP4</strong> Net allows you to activate a protected application on<br />
several stations using a single key. To learn more about <strong>HASP4</strong><br />
Net, "<strong>HASP4</strong> Net Basic Concept" (page 209).<br />
Question Can various HASP keys be connected to each other?<br />
Answer Yes. Multiple HASP keys can be daisy-chained without any special<br />
connecting equipment.<br />
USB HASPs are end-point devices, and daisy-chaining is<br />
therefore irrelevant for these models.<br />
Question And what about keys made by other companies?<br />
Answer HASP keys are fully transparent. You can chain them before or<br />
behind other keys, provided these keys are also transparent.<br />
Question Can data files or applications written with software tools such as<br />
Lotus and AutoLISP be protected with HASP?<br />
Answer Yes. There is a special system for data file protection called<br />
DataHASP. Easily implemented, DataHASP protects files by<br />
encoding their data and allowing only authorized applications to<br />
access them. DataHASP can be used with DOS and Win32<br />
applications and works with all HASP keys.<br />
For more information, see "Protecting with HASP Envelope"<br />
(page 43).<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 23
Basic Concept Part 1 - Chapter 2<br />
Question Why should I use a HASP memory key?<br />
Answer There are three very good reasons to choose a HASP memory key<br />
to protect your application:<br />
To distribute a demo version of your application, or lease your<br />
software.<br />
To protect multiple applications using a single HASP.<br />
To use the HASP memory to save data and subsequently<br />
enhance the security of your protected application.<br />
Question How can I update the HASP memory after delivering my<br />
protected application to my customer?<br />
Answer The HASP Remote Update System (RUS) enables remote<br />
updating of the HASP memory when the HASP is in the<br />
possession of your customer. You update the HASP memory by<br />
sending passwords through phone, fax, or e-mail. This system<br />
enables additional software activations and execution of additional<br />
software modules.<br />
For more information, contact your local HASP representative.<br />
24 © Aladdin Knowledge Systems, 2002
HASP <strong>Soft</strong>ware<br />
Part 1 - Chapter 3<br />
Installing HASP<br />
This chapter gives an overview of the HASP software, the main<br />
stages of software protection and the basic installation procedures<br />
for the various operating systems.<br />
The HASP software consists of the following parts:<br />
Drivers and daemons to access HASP keys<br />
HASP Edit to prepare HASP keys for distribution<br />
Aladdin Diagnostic to assist the end-user<br />
HASP API and HASP Envelope to integrate application<br />
protection<br />
HASP Demo to demonstrate and test the HASP functionality<br />
HASP License Manager and Aladdin Monitor to provide,<br />
administer and monitor <strong>HASP4</strong> Net licenses<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 25
Installing HASP Part 1 - Chapter 3<br />
Device Drivers and Daemons<br />
The HASP device drivers and daemons serve as the link between<br />
the HASP key and the protected application. Both you and your<br />
customer need to install the appropriate driver in order to run the<br />
protected application.<br />
HASP device drivers and daemons are available for the following<br />
operating systems: Windows 95/98/ME, Windows NT4/2000/<br />
XP, Mac OS 8.6, Mac OS 9.x, Mac OS X, Linux.<br />
You can also integrate driver installation into the installation of<br />
your protected application.<br />
Accessing HASP Keys with HASP Edit<br />
HASP Edit is a utility for accessing the HASP and editing the<br />
memory of HASP memory keys.<br />
Assisting End-Users with Aladdin Diagnostic<br />
Protecting Applications<br />
The Aladdin Diagnostic utility lets your customers collect<br />
information on their system and on their HASP key.<br />
HASP Envelope<br />
HASP Envelope is a tool which enables you to protect your<br />
application by wrapping it in a protective shield.<br />
You can use HASP Envelope as a command-line tool or with a<br />
graphical user interface. For more information refer to "Protecting<br />
with HASP Envelope" (page 43).<br />
HASP API<br />
The HASP application programming interface (API) enables you<br />
to protect your application by inserting calls to the HASP key<br />
throughout your source code.<br />
26 © Aladdin Knowledge Systems, 2002
Getting Started Installing HASP<br />
The root directory on the HASP CD is subdivided according to<br />
operating systems, development environment and compiler. The<br />
directory for each compiler includes the following:<br />
Libraries that must be linked to your application<br />
A sample application that demonstrates the use of the API with<br />
all HASP keys<br />
For more information refer to "Protecting with the HASP API"<br />
(page 115).<br />
HASP Demo<br />
Utilities which let you test HASP services. For more information<br />
refer to "HASP Test Utility" (page 128).<br />
Providing Licenses in a Network<br />
For information on <strong>HASP4</strong> Net refer to "<strong>HASP4</strong> Net Basic<br />
Concept" (page 209).<br />
HASP License Manager<br />
A utility that communicates between the protected application and<br />
the <strong>HASP4</strong> Net key.<br />
Aladdin Monitor<br />
A tool used to track the use of protected applications and HASP<br />
License Managers in a network.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 27
Installing HASP Part 1 - Chapter 3<br />
<strong>Soft</strong>ware Protection – Quick Reference<br />
The following overview indicates the main stages normally<br />
involved in protecting your application using any HASP.<br />
Stage 1: Install the HASP Device Driver or Daemon<br />
Enables access to HASP key. The newest drivers can be<br />
downloaded at www.ealaddin.com/support/hasp/vendor.asp.<br />
For information on installing the drivers refer to the following<br />
sections.<br />
Stage 2: Use the HASP Edit Utility<br />
Stage 3: Use the HASP API<br />
Allows you to customize your protection.<br />
For information about HASP Edit refer to "Accessing Keys with<br />
HASP Edit" (page 73).<br />
Allows you to incorporate HASP calls throughout the application.<br />
For information on using the HASP API refer to "Protecting with<br />
the HASP API" (page 115).<br />
Stage 4: Use the HASP Envelope Utility<br />
Allows you to scramble the application file to enhance its security.<br />
For information on scrambling applications files refer to<br />
"Protecting with HASP Envelope" (page 43).<br />
Stage 5: Use the HASP Edit Utility<br />
Allows you to customize your keys for distribution with your<br />
protected software.<br />
For information about HASP Edit refer to "Accessing Keys with<br />
HASP Edit" (page 73).<br />
28 © Aladdin Knowledge Systems, 2002
Getting Started Installing HASP<br />
Installing HASP under Windows<br />
Installing the HASP <strong>Soft</strong>ware<br />
Insert the HASP CD into your CD-ROM drive. The Setup wizard<br />
will automatically start. If the installation does not automatically<br />
start, run setup.exe from the Setup directory.<br />
Now follow the instructions in the Setup wizard.<br />
Installing the HASP Device Driver<br />
The HASP device driver is installed automatically when using the<br />
general HASP software setup. We provide also different<br />
applications for installing the HASP device driver:<br />
Table 3.1 Device Driver Installation Tools (Windows)<br />
Application Operating system<br />
Hinstall.exe Win32, command line version<br />
HDD32.EXE Win32, GUI version<br />
HDD16.EXE Win16, GUI version<br />
You can find these applications in the Drivers directory of your<br />
HASP CD. They automatically recognize the operating system in<br />
use and install the correct driver files at the required location.<br />
For information on which files are installed refer to the hdd.hlp<br />
help file.<br />
To install the HASP device driver under Windows NT/<br />
2000/XP, you need administrator privileges.<br />
The HASP device driver loads dynamically under Windows 95/<br />
98/ME if it has not been previously installed on the computer.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 29
Installing HASP Part 1 - Chapter 3<br />
After HASP device driver installation, HASP applications<br />
protected with versions of the HASP API prior to 6.1 require that<br />
you reboot your system (one time only per station). The HASP<br />
device driver loads dynamically as soon as the HASP is accessed<br />
following the system reboot.<br />
If you install an upgraded version of the HASP device driver after<br />
running a HASP-protected application, you must reboot your<br />
system in order for the new driver version to load dynamically.<br />
Customizing HASP Device Driver Installation<br />
You can install the HASP device driver on your customer’s system<br />
in one of two ways:<br />
Run hinstall.exe or HDD16.EXE/HDD32.EXE. You can write<br />
a command (batch) file to perform the installation and then<br />
distribute this file with your application.<br />
Install the HASP device driver from within your application by<br />
creating your own installation application.<br />
You implement custom installation through a DLL or library.<br />
In the Drivers\drvapi directory you can find interfaces for several<br />
compilers, including an interface for Install Shield. Each compiler<br />
interface directory contains a sample custom installation program.<br />
For more information on the hinstall utility and the HASP Device<br />
Driver Installation API, see the hdd.hlp help file.<br />
The Hinstall Utility<br />
hinstall.exe is a Win32 application that installs the HASP device<br />
driver under Windows 95/98/ME and Windows NT/2000/XP<br />
systems.<br />
To install the HASP Device Driver:<br />
Type hinstall -i from the command line.<br />
A window appears informing you that the HASP device driver was<br />
successfully installed.<br />
30 © Aladdin Knowledge Systems, 2002
Getting Started Installing HASP<br />
To remove the HASP Device Driver:<br />
Type hinstall -r from the command line.<br />
A window appears informing you that the HASP device driver<br />
was successfully removed.<br />
To upgrade a HASP Device Driver:<br />
Install the new HASP device driver following the steps for<br />
installation detailed above.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 31
Installing HASP Part 1 - Chapter 3<br />
Installing HASP under Mac<br />
The HASP software for Mac includes the daemon and driver, the<br />
HASP API, the HASP Edit utility and the HASP License<br />
Manager. The software is contained in the sit archive in the Mac<br />
directory on the HASP CD.<br />
Installing the HASP Daemon for Mac OS X<br />
The HASP daemon aksusbd enables the Mac OS X system and the<br />
protected application to access the HASP key.<br />
Both you and your customer need to install and load the daemon<br />
aksusbd in order to work with the HASP key under Mac OS X. The<br />
script dinst enables you to do this.<br />
To install the daemon proceed as follows:<br />
1. Log in as root or as a user with administrator-level access.<br />
2. Open a terminal session under OS X. To do this choose<br />
Applications from the Go menu, open the Utilities folder and<br />
choose Terminal.<br />
3. Change to the daemon directory.<br />
4. Start the script by typing ./dinst. If you are not logged in as root,<br />
start the script by typing sudo ./dinst.<br />
The daemon will be started automatically on every system boot.<br />
After the HASP daemon has been successfully installed and<br />
loaded, your system will recognize HASP keys connected to the<br />
USB port.<br />
You can configure the daemon with the following command line<br />
switches:<br />
32 © Aladdin Knowledge Systems, 2002
Getting Started Installing HASP<br />
Table 3.2 Command Line Switches for aksusbd (Mac)<br />
Switch Meaning<br />
-v Print version number as decimal, format xx.xx.<br />
-u Specifies the permission bits for the socket special<br />
file. Default is 666 (access for everyone).<br />
-l Select type of diagnostic messages. Possible values<br />
are:<br />
0 - only errors<br />
1- normal (default)<br />
2 - verbose<br />
3 - ultra verbose<br />
-h Print command line help.<br />
To configure the daemon proceed as follows:<br />
1. Edit the startup file Aladdin which is referenced by the script<br />
dinst.<br />
2. Add the desired switches to the line aksusbd which starts the<br />
daemon.<br />
Installing the HASP Driver for Mac OS 8.6 and 9.x<br />
The HASP driver enables the Mac OS 8.6 and Mac OS 9.x system<br />
and the protected application to access the HASP key.<br />
Both you and your customer need to install the driver in order to<br />
work with the HASP key under Mac OS 8.6 and 9.x.<br />
To install the driver proceed as follows:<br />
1. Copy the files MacHasp4Shim and MacHaspUsbDD to the<br />
Extensions folder in the System Folder.<br />
2. Reboot the system.<br />
If the files already exist you need to move them out of<br />
the folder first, because they cannot be overwritten.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 33
Installing HASP Part 1 - Chapter 3<br />
Installing HASP Edit for Mac<br />
Your system will now recognize HASPs connected to the USB<br />
port.<br />
To install HASP Edit for Mac:<br />
1. Open the sit archive on the HASP CD.<br />
2. Copy the HASP Edit application file to your computer.<br />
For more information refer to "Accessing Keys with HASP Edit"<br />
(page 73).<br />
Installing <strong>HASP4</strong> Net Support and Utilities<br />
For information on <strong>HASP4</strong> Net refer to "<strong>HASP4</strong> Net Basic<br />
Concept" (page 209) and subsequent chapters.<br />
34 © Aladdin Knowledge Systems, 2002
Getting Started Installing HASP<br />
Installing HASP under Linux<br />
The HASP software for Linux includes the following:<br />
Kernel mode drivers for various kernel versions and a daemon<br />
Utilities to query the driver version and to display parallel ports<br />
HASP Demo application and the source code.<br />
HASP library<br />
Opening the Archive<br />
It is contained in the hasplinux101.tgz archive in the Linux directory<br />
on the HASP CD.<br />
For detailed information on the components refer to the readme<br />
files in the archive.<br />
To open the archive proceed as follows:<br />
1. Create a new sub folder.<br />
2. Unpack the archive using the following command:<br />
Tar -xzf [path/]hasplinux101.tgz<br />
Installing Daemon and Kernel Mode Driver<br />
To access the HASP key, the kernel mode driver aksparlnx.o and<br />
the daemon aksusbd have to be loaded.<br />
All described actions should be executed as root.<br />
Kernel Mode Driver Installation (aksparlnx.o)<br />
Driver installation includes the following steps:<br />
Generate the device node<br />
Initialize the parport system<br />
Loading the driver<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 35
Installing HASP Part 1 - Chapter 3<br />
Generating the Device Node<br />
To enable access to the driver, generate a /dev/Hardlock device<br />
node. It should use the same major number as is used when<br />
loading the driver (major=xxx command line to insmod, or 42<br />
default).<br />
1. Generate the device node with the following command:<br />
mknod /dev/Hardlock c 42 0<br />
2. Allow everyone to access the node:<br />
chmod 666 /dev/Hardlock<br />
Alternatively, if the access to Aladdin keys should be restricted<br />
to a special group of users (e.g. group aladdin):<br />
chgrp aladdin /dev/Hardlock<br />
chmod 660 /dev/Hardlock<br />
Initializing the Parport System<br />
The aksparlnx driver uses the Linux parport driver in to access to<br />
the parallel port without disrupting other users of the parallel port<br />
(e.g. printer, zip drive).<br />
Initialize the parport system before loading the aksparlnx driver:<br />
modprobe parport_pc<br />
The parport driver will report in the system log the parallel ports it<br />
has found in the system. aksparlnx will be able to access keys on<br />
any of these ports by default.<br />
Loading the Driver<br />
Load the aksparlnx driver with the following command:<br />
insmod /aksparlnx.o<br />
The status message is generated in the system log informing you if<br />
the installation has been successful or not.<br />
36 © Aladdin Knowledge Systems, 2002
Getting Started Installing HASP<br />
Options for aksparlnx.o<br />
The loading of the driver (modprobe and insmod) should be<br />
incorporated into a startup script, so that it will be available on<br />
subsequent system boots.<br />
Table 3.3 Command Line Switches for aksparlnx.o<br />
(Linux)<br />
Switch Meaning<br />
-major=<br />
<br />
-loglevel=<br />
<br />
The driver uses device major number 42 by default.<br />
You can change this by giving an argument to the<br />
insmod command.<br />
Also change the driver special file using the<br />
command mknod /dev/Hardlock c<br />
0<br />
Select type of diagnostic messages. Possible values<br />
are:<br />
0 - only errors<br />
1- normal (default)<br />
2 - verbose<br />
3 - ultra verbose<br />
The messages are logged in syslog with priority<br />
kern.info (and kern.debug). Refer to /etc/<br />
syslog.conf to see where the messages will be put,<br />
usually it is the file /var/log/messages.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 37
Installing HASP Part 1 - Chapter 3<br />
Switch Meaning<br />
-timeout=<br />
<br />
-hlportadress=<br />
<br />
Aladdin Daemon Installation (aksusbd)<br />
Enabling Access to USB Keys<br />
To enable access to USB keys, usbdevfs must be mounted on /proc/<br />
bus/usb. On newer distributions it is mounted automatically (e.g<br />
SuSe 7.0).<br />
To mount usbdevfs manually use the following command:<br />
mount -t usbdevfs none /proc/bus/usb<br />
Enabling Access to Parallel Keys<br />
To enable access to parallel port keys, the kernel driver aksparlnx<br />
must be installed before starting aksusbd.<br />
Loading the Daemon<br />
Load the daemon by starting it:<br />
/aksusbd<br />
Specifies the maximum amount of time the driver<br />
waits when requesting exclusive port access from<br />
the parport driver. The value used is 1/100 of a<br />
second. The default value is 100 (= 1 second).<br />
After this time the request will be aborted with a<br />
PORT_BUSY error.<br />
If you have a parallel port in the system which by<br />
chance is not detected by the Linux parport driver<br />
(and therefore not seen by aksparlnx.o), you can<br />
make this port known to aksparlnx.o.<br />
Use this switch only if you are an<br />
!<br />
experienced user. Giving an illegal port<br />
address will cause the system to crash!<br />
The daemon will fork and put itself into the background.<br />
The status message is generated in the system log informing you if<br />
the installation has been successful or not.<br />
38 © Aladdin Knowledge Systems, 2002
Getting Started Installing HASP<br />
Options for aksusbd<br />
It reports its version, the version of the API used for USB and the<br />
version of the API inside the kernel driver (for parallel port keys).<br />
If the kernel driver happens to be unavailable when aksusbd is<br />
launched, parallel port keys cannot be accessed, but USB keys are<br />
still accessible. The system log reflects this status.<br />
If /proc/bus/usb is not mounted when launching aksusbd, USB keys<br />
cannot be accessed.<br />
Preferably the daemon should be started at system boot up time<br />
with some script located in /etc/rc.d/init.d or /etc/init.d (depending<br />
on Linux distribution).<br />
Table 3.4 Command Line Switches for aksusbd (Linux)<br />
Switch Meaning<br />
-v Print version number as decimal, format xx.xx.<br />
-l Select type of diagnostic messages. Possible values<br />
are:<br />
0 - only errors<br />
1- normal (default)<br />
2 - verbose<br />
3 - ultra verbose<br />
The messages are logged in syslog with priority<br />
kern.info (and kern.debug). Refer to /etc/syslog.conf to<br />
see where the messages will be put, usually it is the<br />
file /var/log/messages.<br />
-u Specifies the permission bits for the socket special<br />
file. Default is 666 (access for everyone).<br />
-h Print command line help.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 39
Part 2<br />
Using HASP Tools<br />
This part describes the HASP utilities HASP Envelope, HASP<br />
Edit and Aladdin Diagnostic.<br />
The chapter "Protecting with HASP Envelope" (page 43) explains<br />
the use of HASP Envelope which provides a convenient way to<br />
protect your application and encode data files.<br />
The chapter "Accessing Keys with HASP Edit" (page 73) explains<br />
the use of HASP Edit for Win32 and for Mac which let you access<br />
your HASP keys.<br />
The chapter "Assisting End-Users" (page 107) describes how you<br />
can assist your customer with Aladdin Diagnostic which lets your<br />
customers collect information on their system and on their HASP<br />
key.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 41
Part 2 - Chapter 5<br />
Protecting with<br />
HASP Envelope<br />
Using HASP Envelope is the fastest way to protect your software<br />
from unauthorized use. Implementing HASP Envelope protection<br />
is easy, as you do not need to alter the application’s source code.<br />
HASP Envelope is available as command-line tool (DOS, Win16,<br />
Win32) and as graphical user interface (Win32).<br />
The HASP Envelope interface provides a convenient way to<br />
perform any of the following operations:<br />
Protect applications<br />
Protect Win32 data files<br />
Save FAS protection parameters to the HASP memory<br />
!<br />
If you plan to use both HASP Envelope and API<br />
protection, first implement the HASP API and then the<br />
HASP Envelope.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 43
Protecting with HASP Envelope Part 2 - Chapter 5<br />
About the HASP Envelope<br />
The HASP Envelope utility adds a protective shield around DOS,<br />
Windows and Win32 executable files and DLLs.<br />
Envelope protection offers file encoding and advanced antidebugging<br />
features which enhance the overall level of security.<br />
Figure 5.1 HASP Envelope Protection<br />
Before you implement HASP Envelope protection do the<br />
following:<br />
Backup your unprotected file.<br />
By default, during protection, the original file is destroyed and a<br />
new one is created.<br />
Make sure there is enough space on your disk.<br />
After protecting with the HASP Envelope, your application will<br />
require additional disk space. The amount of space depends<br />
upon the type of application you are protecting.<br />
The DOS and Win32 Envelopes remain in memory for as long<br />
as your protected application is running. The DOS Envelope<br />
uses 28KB of memory.<br />
44 © Aladdin Knowledge Systems, 2002
Using HASP Tools Protecting with HASP Envelope<br />
Starting HASP Envelope<br />
You can protect a DOS, Win16 or Win32 application using a<br />
graphical user interface (GUI) as described here, or from the<br />
command line as described on page 65.<br />
1. Install the HASP device driver. See "Installing HASP under<br />
Windows" on page 29.<br />
2. Connect the HASP key(s) with which you want to protect your<br />
application to the computer.<br />
3. Activate the Envelope utility by either choosing HASP<br />
Envelope from the HASP CD folder, or by running<br />
haspenv.exe.<br />
The HASP Envelope window is displayed.<br />
There are three available options:<br />
Click Start HASP Wizard to access the Wizard, which guides<br />
you through the protection process step by step.<br />
Click New Envelope Configuration to begin a protection<br />
session using new protection parameters.<br />
Click Open Envelope Configuration to begin a protection<br />
session using saved protection parameters.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 45
Protecting with HASP Envelope Part 2 - Chapter 5<br />
Protecting an Application<br />
This chapter describes the protection process using the New or<br />
Open Envelope configuration options.<br />
1. In the Envelope’s Main tab, enter the path and name of the<br />
application to protect in the Unprotected File box.<br />
2. Type the HASP passwords into the correct boxes.<br />
3. If you are implementing FAS, fill in the FAS parameters<br />
according to the model of HASP you are using:<br />
For <strong>HASP4</strong> M1 and <strong>HASP4</strong> M4, enter the program number<br />
and the number of activations on the Options tab.<br />
For <strong>HASP4</strong> <strong>Ti</strong>me, enter the program number and the<br />
expiration date on the Options tab.<br />
For <strong>HASP4</strong> Net, enter the program number on the Main tab.<br />
You can enter either the number of activations, the number of<br />
licenses, or both.<br />
4. Fill in the remaining boxes in the Main, Options, and Error<br />
Messages tabs according to your specific protection needs. See<br />
the following sections for detailed descriptions of the tabs and<br />
their boxes.<br />
5. Click the Protect icon or choose Protect Application from<br />
the Envelope Tools menu.<br />
A window appears, informing you that the application was<br />
successfully protected.<br />
6. Click OK.<br />
If you assigned FAS protection parameters, you are now asked<br />
if you want to save them. See "The Full Authorization System<br />
(FAS)" on page 20 for more details.<br />
The protected application now cannot work without the<br />
correct HASP.<br />
Repeat steps 5 to 9 as many times as necessary - for different<br />
applications or the same one.<br />
46 © Aladdin Knowledge Systems, 2002
Using HASP Tools Protecting with HASP Envelope<br />
Protecting Win32 Data Files<br />
Preparing Protection<br />
With DataHASP, you can protect data files, such as applications<br />
written under application-generators. DataHASP encodes their<br />
data and enables only authorized applications to decode it.<br />
!<br />
You can protect Win32 data files using a graphical user interface<br />
(GUI) as described here, or from the command line as described<br />
on page 65.<br />
When you protect Win32 data files, you also need to protect the<br />
application that loads these files and decodes them. This section<br />
provides instructions on how to protect both the data files and the<br />
application that accesses them.<br />
!<br />
Never encode the same file twice. If you do, the<br />
software will not be able to restore it.<br />
Alternatively you can build your own application and<br />
call API services 60, 61, 88 or 89 to encode and decode<br />
any data file opened by your program in whatever way<br />
you choose.<br />
The application you authorize to decode data files<br />
should not support the copying or exporting of files. If<br />
it does, the end user will be able to copy or export an<br />
encoded data file to a non-encoded file.<br />
1. Place a copy of the application which accesses the data file (for<br />
example Notepad.exe) in a temporary directory.<br />
2. Create a data file and save it in the same directory (for example<br />
text.txt).<br />
3. Connect the HASP key(s) with which you want to protect your<br />
data files to the computer and make sure that the HASP device<br />
driver is properly installed.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 47
Protecting with HASP Envelope Part 2 - Chapter 5<br />
4. Activate the Envelope utility by choosing HASP Envelope<br />
from the HASP CD folder. The HASP Envelope window<br />
appears.<br />
5. Choose New Envelope Configuration.<br />
Setting Protection Parameters<br />
1. In the Envelope's Main tab, enter the path and name of the<br />
application to protect (in this example C:\Notepad.exe) in the<br />
Unprotected File box.<br />
2. Enter the HASP passwords in the appropriate boxes.<br />
3. Fill in the remaining boxes in the Main, Options, and Error<br />
Messages tabs according to your specific protection needs. See<br />
the following sections for detailed descriptions of the tabs and<br />
their boxes.<br />
4. In the DataHASP tab, enter the name of the data file you want<br />
to encode and then decode at run time (in this example,<br />
test.txt).<br />
48 © Aladdin Knowledge Systems, 2002
Using HASP Tools Protecting with HASP Envelope<br />
Figure 5.2 DataHASP Tab<br />
T<br />
5. In the Encryption Key box, enter any eight characters as an<br />
encoding key.<br />
6. In the Data Files to Encrypt box, choose Add, and select<br />
C:\test.txt.<br />
7. Under Data Files to Decrypt at Run <strong>Ti</strong>me, type test.txt in<br />
the Decrypt box. Alternatively, you can use wildcards, i.e. *.*,<br />
or *.txt.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 49
Protecting with HASP Envelope Part 2 - Chapter 5<br />
Performing Protection<br />
1. Click the Protect icon or choose Protect Application from<br />
the Envelope Tools menu.<br />
A window appears, informing you that the application was<br />
successfully protected and that you can encrypt the data files<br />
now.<br />
2. Click OK and then click on the Encrypt Selected Files button<br />
at the bottom of the window.<br />
A message appears, informing you that all selected files were<br />
encrypted successfully. Successful protection allows you to<br />
ensure that the document can only be opened with the<br />
protected application and not with any other copy of the<br />
executable.<br />
If you assigned FAS protection parameters, you are now asked<br />
if you want to save them. See "Saving FAS Parameters"<br />
(page 51) for more details.<br />
The protected application now cannot work without the correct<br />
HASP and only this application can access the protected data files.<br />
50 © Aladdin Knowledge Systems, 2002
Using HASP Tools Protecting with HASP Envelope<br />
Saving FAS Parameters<br />
After implementing HASP Envelope protection of executables or<br />
data files, you can also use HASP Envelope to save FAS protection<br />
parameters to the memory of your HASP key immediately after<br />
the protection process.<br />
Alternatively, you can use HASP Edit to save FAS<br />
parameters to your HASP keys.<br />
The FAS protection parameters which you can save to the HASP<br />
memory are:<br />
For <strong>HASP4</strong> M1 and M4 the application program number and<br />
number of application activations.<br />
For <strong>HASP4</strong> <strong>Ti</strong>me the application program number and<br />
application expiration date.<br />
For <strong>HASP4</strong> Net the program number, number of licenses and<br />
number of activations.<br />
While FAS is optional for HASP stand-alone memory<br />
keys, it is an integral part of the <strong>HASP4</strong> Net system.<br />
Therefore, remember that saving protection parameters<br />
to the <strong>HASP4</strong> Net memory is mandatory.<br />
You have the choice of using HASP Edit or the Envelope to set<br />
FAS protection parameters and save them to the HASP memory.<br />
However, you must use the Envelope to set the program number.<br />
By assigning the program number using HASP Envelope, you<br />
establish the link between the HASP key and your program’s<br />
protection parameters, which are saved to the HASP memory. It is<br />
this link that enables the protected application, when loaded, to<br />
retrieve the correct protection parameters from the HASP<br />
memory.<br />
You can save FAS parameters to the HASP key immediately after<br />
implementing HASP Envelope protection, or independent of the<br />
Envelope protection process.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 51
Protecting with HASP Envelope Part 2 - Chapter 5<br />
Saving FAS Parameters After Implementing Protection<br />
Directly after implementing protection, a dialog box appears<br />
giving you the option to write to the memory of the connected<br />
HASP key.<br />
1. Select if you want to write to a local HASP key or a <strong>HASP4</strong> Net<br />
key.<br />
2. Click Save Parameters.<br />
3. To write the same protection parameters to additional HASP<br />
keys, remove the currently attached HASP key, connect another<br />
one and click Save Parameters.<br />
4. To stop writing to HASP keys, click Close.<br />
Saving FAS Parameters Independent of the Protection Process<br />
1. Set the FAS parameters you want to write to your HASP key.<br />
2. From Envelope Tools select Program HASP.<br />
The Save FAS Parameters dialog box appears.<br />
3. Select if you want to write to a local HASP key or a <strong>HASP4</strong> Net<br />
key.<br />
4. Click Save Parameters.<br />
5. To write the same protection parameters to additional HASP<br />
keys, remove the currently attached HASP key, connect another<br />
one and click Save Parameters.<br />
6. To stop writing to HASP keys, click Close.<br />
52 © Aladdin Knowledge Systems, 2002
Using HASP Tools Protecting with HASP Envelope<br />
HASP Envelope Parameters<br />
Main Tab<br />
#<br />
This section describes the HASP Envelope utility tabs, boxes,<br />
menus and icons.<br />
You must specify parameters in the Main tab in order to protect<br />
your application. If you are using a stand-alone HASP key only, fill<br />
in all the boxes except for those in the <strong>HASP4</strong> Net Parameters<br />
frame. If you are using a <strong>HASP4</strong> Net key only, fill in all the boxes<br />
except for those in the HASP Passwords frame. If you are using<br />
both a stand-alone HASP key and a <strong>HASP4</strong> Net key, fill in all the<br />
relevant boxes.<br />
Figure 5.3 HASP Envelope Main Tab<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 53
Protecting with HASP Envelope Part 2 - Chapter 5<br />
Table 5.1 HASP Envelope Main Tab Options<br />
Option Description<br />
Unprotected File<br />
(source)<br />
Protected File<br />
(destination)<br />
HASP Password<br />
HASP Demo Key<br />
Use <strong>HASP4</strong><br />
Security Features<br />
Executable Type<br />
Overlay File<br />
Target Computer<br />
NetHASP<br />
Passwords<br />
NetHASP Demo<br />
Key<br />
Enter the path and name of the application file to protect. Each file must<br />
have the extension .exe or .dll. Click Browse to search your disks for a<br />
specific file.<br />
Default: The filename entered in the Unprotected File box.<br />
By default, the HASP Envelope utility overwrites the original unprotected<br />
file when saving the protected version of your application. To avoid<br />
overwriting your original file, give the protected application a different<br />
filename. Type this filename in the Protected File box.<br />
Enter the HASP passwords of all HASP stand-alone keys with which you<br />
want to protect your application. You can enter up to 3 sets of HASP<br />
passwords to protect a single application with up to 3 HASP keys.<br />
Check this box to enter the passwords of a HASP demo key<br />
automatically.<br />
Check this box to use the enhanced security features of <strong>HASP4</strong><br />
If you need to maintain compatibility with the HASP-3 generation of<br />
keys, you should not use this feature.<br />
The HASP Envelope tries to detect the executable type automatically. If it<br />
cannot detect the type of executable, this box will have the value<br />
Unknown Type.<br />
Check this box if the file to be protected contains overlays or extra data<br />
appended to the executable<br />
Default: IBM PC and compatibles<br />
Specify the type of computer on which the application will run. If your<br />
target computer is an NEC, change the value accordingly to NEC.<br />
When protecting with <strong>HASP4</strong> Net, enter the passwords you received<br />
with your <strong>HASP4</strong> Net key.<br />
Check this box to enter the passwords of a <strong>HASP4</strong> Net demo key<br />
automatically.<br />
54 © Aladdin Knowledge Systems, 2002
Using HASP Tools Protecting with HASP Envelope<br />
Option Description<br />
Program Number<br />
Number of<br />
Licenses<br />
Number of<br />
Activations<br />
NetHASP<br />
Configuration File<br />
Default: 1<br />
With just a single <strong>HASP4</strong> Net, you can protect multiple applications.<br />
Assign a unique program number from 1 to 112 for each application you<br />
protect with <strong>HASP4</strong> Net. Make a note of this number. You will need it<br />
later to save program protection parameters when programming <strong>HASP4</strong><br />
Net keys for your clients<br />
When protecting with <strong>HASP4</strong> Net, assign the number of application<br />
licenses in this box. This number is saved to the <strong>HASP4</strong> Net memory.<br />
Type a number in this box or use the arrow keys to set it. Check the<br />
Unlimited option to assign an unlimited number of activations.<br />
Possible values are dependent on the <strong>HASP4</strong> Net model. You can assign<br />
every value from 0 up to the number of the model, for example 0 to 5 for<br />
a <strong>HASP4</strong> Net 5 key.<br />
To save the number of licenses in the <strong>HASP4</strong> Net memory, click Save<br />
Parameters when prompted after implementing Envelope protection.<br />
When protecting with <strong>HASP4</strong> Net, assign the number of application<br />
activations in this box. This number is saved to the <strong>HASP4</strong> Net memory.<br />
Type a number in this box or set it with the arrow keys. Check the<br />
Unlimited option to assign an unlimited number of activations.<br />
To save the number of activations in the <strong>HASP4</strong> Net memory, click Save<br />
Parameters when prompted after implementing Envelope protection.<br />
Default: nethasp.ini<br />
You can specify the name of a configuration file for the <strong>HASP4</strong> Net<br />
system. To look for a file, click Browse. For more information about the<br />
<strong>HASP4</strong> Net configuration file, refer to "Customizing the HASP License<br />
Manager" (page 236).<br />
If the application finds a configuration file, it reads the file and uses the<br />
information contained in it. If not, the application uses default values.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 55
Protecting with HASP Envelope Part 2 - Chapter 5<br />
Options Tab<br />
The Options tab contains additional protection settings.<br />
Figure 5.4 HASP Envelope Options Tab<br />
56 © Aladdin Knowledge Systems, 2002
Using HASP Tools Protecting with HASP Envelope<br />
Table 5.2 HASP Envelope Option Tab Options<br />
Option Description<br />
Use Full<br />
Authorization<br />
System (FAS)<br />
Application<br />
Program Number<br />
Number of<br />
Application<br />
Activations<br />
Application<br />
Expiration Date<br />
Default: Disabled<br />
You can use the Full Authorization System (FAS) with a <strong>HASP4</strong> M1,<br />
<strong>HASP4</strong> M4, or <strong>HASP4</strong> <strong>Ti</strong>me. For more information about FAS refer to<br />
"Saving FAS Parameters" (page 51).<br />
To use FAS, check the Use Full Authorization System box.<br />
As FAS is an integral part of the <strong>HASP4</strong> Net protection system, <strong>HASP4</strong><br />
Net FAS parameters are entered in the <strong>HASP4</strong> Net Parameters frame<br />
on the Main tab.<br />
Default: 1<br />
If you are using a HASP stand-alone memory key to protect multiple<br />
applications with FAS, assign a unique number to the application. Make<br />
a note of this number. You will need it later to save program protection<br />
parameters when programming HASP keys for your client.<br />
Possible values are 1 to 16 for <strong>HASP4</strong> M1, 1 to 112 for <strong>HASP4</strong> M4 and 1<br />
to 8 for <strong>HASP4</strong> <strong>Ti</strong>me.<br />
If you are using a HASP M1 or <strong>HASP4</strong> M4 in conjunction with FAS,<br />
enter the number of application activations in this box. This number is<br />
saved to the memory.<br />
Type the number of activations in the box or use the arrow keys to set it.<br />
Check the Unlimited box to permit an unlimited number of activations<br />
of the application.<br />
To save the number of activations in the HASP memory, click Save<br />
Parameters when prompted after implementing Envelope protection.<br />
If you are using a <strong>HASP4</strong> <strong>Ti</strong>me in conjunction with FAS, enter the date<br />
after which the application will stop running. The date is saved to the<br />
<strong>HASP4</strong> <strong>Ti</strong>me memory.<br />
Click Date and select the month, day and year.<br />
To save the expiration date in the <strong>HASP4</strong> <strong>Ti</strong>me memory, click Save<br />
Parameters when prompted after implementing Envelope protection.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 57
Protecting with HASP Envelope Part 2 - Chapter 5<br />
Option Description<br />
Perform<br />
Background HASP<br />
Checks<br />
Default: Disabled<br />
By default, the HASP system checks for the presence of a key once<br />
when the application is loaded. If you want to repeat the check during<br />
run time, add background HASP checks.<br />
To enable this feature, mark with a check the Perform Background<br />
HASP Checks box.<br />
Interval in Seconds When you use the Background HASP Checks option, you must<br />
specify at what interval the system checks for the key. Type a value<br />
representing the interval in seconds.<br />
Anti Debug and<br />
Reverse<br />
Engineering<br />
Use HASP ID<br />
Number<br />
Default: Enabled<br />
With this feature you can increase the protection level by keeping users<br />
from running your program with a debugger and by adding additional<br />
anti-debugger modules to your program file.<br />
To add a debugger detection, mark with a check the User Mode<br />
Debugger Protection box.<br />
To add additional anti debug modules, move the slider marked Anti<br />
Debug Modules to the right.<br />
Default: Disabled<br />
Use this box to ensure that the protected application runs only if the<br />
HASP with the specified ID number is connected to the computer. To<br />
incorporate this option, mark with a check the Use HASP ID Number<br />
box. This option is available exclusively for HASP stand-alone memory<br />
keys.<br />
You can enter the appropriate ID number of a key in one of two ways:<br />
Click Let Envelope Detect HASP ID to read the ID number of<br />
the HASP key currently attached to the port.<br />
Click Enter HASP ID Manually to open a box in which you can<br />
manually enter the HASP ID number you previously determined<br />
using the HASP Edit utility. The ID number is a 32-bit unsigned<br />
integer which must be entered in hexadecimal form. With this<br />
method, you do not need to connect the HASP containing the<br />
specific ID while protecting. When protecting with more than one<br />
HASP key, use the ID number of the key for which the HASP<br />
passwords were entered in the first password box. The ID<br />
numbers of the other keys will not be checked.<br />
58 © Aladdin Knowledge Systems, 2002
Using HASP Tools Protecting with HASP Envelope<br />
Option Description<br />
Encrypt Program<br />
File<br />
Encryption Key<br />
(decimal)<br />
Encryption Level<br />
Protection<br />
Methods<br />
Install HASP<br />
Envelope<br />
Install Pattern<br />
Code Security<br />
(PCS)<br />
Default: Enabled<br />
This feature allows you to add additional protection by scrambling the<br />
program file. Applications which write to their application file during<br />
run time should not be scrambled.<br />
The scrambling process requires several encoding keys chosen at<br />
random by the HASP Envelope utility. To ensure maximum security, you<br />
can set one of these scrambling keys to a number of your choice<br />
between 0 and 65535<br />
You can specify the frequency of HASP key access for scrambling. Move<br />
the Encryption Level slider to the right to increase the frequency.<br />
In the Protection Methods frame, you indicate which method of<br />
protection you would like to use. You can use the Envelope method,<br />
incorporate Pattern Code Security, or both.<br />
When you click the Protect icon or choose Protect Application from<br />
the Envelope Tools menu, you implement the protection methods you<br />
indicated in this box.<br />
Default: Enabled<br />
Check the Install HASP Envelope box to implement the Envelope<br />
protection method. Envelope protection will take effect when clicking<br />
the Protect icon or selecting Protect Application from the Envelope<br />
Tools menu.<br />
Default: Disabled<br />
Check the Install Pattern Code Security (PCS) box to install PCS and<br />
enhance security. PCS will take effect when clicking the Protect icon or<br />
selecting Protect Application from the Envelope Tools menu.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 59
Protecting with HASP Envelope Part 2 - Chapter 5<br />
DataHASP Tab<br />
Use the DataHASP tab to protect data files. On the DataHASP<br />
tab, you can do the following:<br />
Specify the data files you want to encode<br />
Specify which encoded data files should be decoded during run<br />
time by your protected application<br />
Encode the data files<br />
In addition to encoding the data files, you need to specify which<br />
application is authorized to decode them and protect that<br />
application. Do this by entering values in the appropriate boxes on<br />
the Main tab and other relevant tabs and protecting the<br />
application.<br />
!<br />
Alternatively you can build your own application and<br />
call API services 60, 61, 88 or 89 to encode and decode<br />
any data file opened by your program in whatever way<br />
you choose.<br />
Never encode the same file twice. If you do, the<br />
software will not be able to restore it.<br />
60 © Aladdin Knowledge Systems, 2002
Using HASP Tools Protecting with HASP Envelope<br />
Figure 5.5 HASP Envelope DataHASP Tab<br />
:<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 61
Protecting with HASP Envelope Part 2 - Chapter 5<br />
Table 5.3 HASP Envelope DataHASP Tab Options<br />
Option Description<br />
Data Files to<br />
Decrypt at Run<br />
<strong>Ti</strong>me<br />
Decrypt<br />
Do not decrypt<br />
Protection<br />
Parameters<br />
Encryption Key<br />
HASP Passwords<br />
for Encryption<br />
Enter the filename or file patterns of data files that your application<br />
should decode at run time. Also enter exceptional data files (from<br />
among those files specified for decoding) which your application<br />
should not decode.<br />
For example, consider an application that accesses all your encoded<br />
data files having an *.adb format. Suppose that the same application<br />
needs to access the file xyz.adb, which is not one of your encoded data<br />
files, but rather a file supplied by your application’s environment. In<br />
this case, in the Decrypt box enter *.adb. In the Do Not Decrypt box,<br />
enter xyz.adb. This instructs your protected application to decode all<br />
data files with an adb extension, except for the file xyz.adb.<br />
Type the files to decode at run time (represent them in the standard<br />
way, or using wildcards, i.e. *.*, or aa??.txt)<br />
Type the files (from among those files specified for decoding) not to<br />
decode at run time (represent them in the standard way, or using<br />
wildcards, i.e. *.*, or aa??.txt)<br />
By entering protection parameters, you set the encoding key used to<br />
encode data files<br />
Enter up to 8 characters in the Encryption Key box. These will<br />
become part of the encoding algorithm.<br />
The passwords of your HASP key, which you enter in the Main tab,<br />
automatically appear in the HASP Passwords for Encryption box.<br />
Only the HASP key to which these passwords belong will open the<br />
protected data files.<br />
62 © Aladdin Knowledge Systems, 2002
Using HASP Tools Protecting with HASP Envelope<br />
Option Description<br />
Data Files to<br />
Encrypt<br />
Input Data Files to<br />
Encrypt<br />
Output Encrypted<br />
Data Files<br />
Before encoding data files, make sure you have set the Protection<br />
Parameters in the DataHASP tab.<br />
Never encode the same file twice. I you do so, the software<br />
will not be able to restore it.<br />
!<br />
Type the files (with their paths) to encode or click Add to choose files<br />
from directories.<br />
DataHASP copies the filenames listed in the Input Data Files to<br />
Encrypt box and places them in a new directory. The new default file<br />
path automatically appears here.<br />
After supplying the encoded data files along with the<br />
protected application to the end user, you can send new<br />
encoded data files. Simply encode the data files, making<br />
sure that they are named so that they fit the patterns of<br />
the Data Files to Decrypt at Run <strong>Ti</strong>me boxes. If they<br />
fall outside these patterns, you must fill in all the boxes<br />
of the DataHASP tab and re-protect your application,<br />
remembering to include all the data files (the old and<br />
the new) in the Data Files to Decrypt at Run <strong>Ti</strong>me<br />
boxes.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 63
Protecting with HASP Envelope Part 2 - Chapter 5<br />
Error Messages Tab<br />
This tab lists the error messages which appear when a problem<br />
occurs during run time. You can edit these messages. For example,<br />
you can write the messages in another language in the boxes<br />
provided, if you want.<br />
Figure 5.6 HASP Envelope Error Messages Tab<br />
64 © Aladdin Knowledge Systems, 2002
Using HASP Tools Protecting with HASP Envelope<br />
HASP Envelope Command-Line Switches<br />
Protecting with the Envelope using command-line switches can<br />
save you time and keystrokes. Switches also enable you to execute<br />
HASP Envelope protection from batch files without going<br />
through the HASP Envelope utility screens. You can run the DOS,<br />
Win16 and Win32 Envelopes from the command-line using<br />
switches.<br />
Table 5.4 HASP Envelope Engines<br />
HASP Envelope Engine Executable Name<br />
DOS Envelope Instdos.exe<br />
Win16 Envelope Instw16.exe<br />
Win32 Envelope Instw32.exe<br />
The following table lists the various HASP Envelope commandline<br />
switches. You can use these switches with any Envelope,<br />
unless otherwise specified.<br />
Table 5.5 HASP Envelope Switches<br />
Switch Operation<br />
-c Specify number of anti debug modules (1-50).<br />
For the Win 16 and the Win 32 Envelope only.<br />
-cfgfile Load a configuration file and use the<br />
parameters which were saved in it.<br />
-createcfg<br />
<br />
-dhfilter<br />
<br />
Create a configuration file. For the Windows<br />
and Win32 Envelopes.<br />
Files or file patterns to decrypt at run time<br />
(standard representation, i.e, *.* or aa??.txt). A<br />
maximum of 8 files or file patterns can be<br />
specified. For the Win32 Envelope only.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 65
Protecting with HASP Envelope Part 2 - Chapter 5<br />
Switch Operation<br />
-dhfilterx<br />
<br />
Files or file patterns not to decrypt from<br />
among the file patterns chosen for decryption<br />
at run time (standard representation, i.e, *.* or<br />
aa??.txt). A maximum of 8 files or file patterns<br />
can be specified. For the Win32 Envelope only.<br />
-dhkey Specify an encryption key for data files (up to 8<br />
characters in length). For the Win32 Envelope<br />
only.<br />
-drvwait<br />
<br />
Increase the time interval for searching for a<br />
driver. Possible values 0 to 255. For the Win32<br />
Envelope only.<br />
-enc Default. Encrypt the file during protection.<br />
-enclevel Encryption level for data encryption (1-5). For<br />
the Win 16 and the Win 32 Envelope only.<br />
-exsecnum Do not encrypt section number. For the Win32<br />
Envelope only.<br />
-fas Use the Full Authorization System.<br />
-fasprgnum<br />
<br />
Specify the Full Authorization System program<br />
number.<br />
-h3easy Run the program if any HASP key is present.<br />
-h3hard Default. Run the program if the specified<br />
HASP is present.<br />
-h3pass <br />
<br />
Specify the HASP passwords.<br />
-hasp4 Use the <strong>HASP4</strong> security features for the Win16<br />
and Win32 envelopes.<br />
-help or -? Display a list of all switches, with brief<br />
explanations of each one and then exit.<br />
66 © Aladdin Knowledge Systems, 2002
Using HASP Tools Protecting with HASP Envelope<br />
Switch Operation<br />
-highsecoff Disable high security level. Default for<br />
protection with a <strong>HASP4</strong> Net key and<br />
necessary for 286 processors and lower. For the<br />
DOS Envelope only.<br />
-highsecon Enable high security level. Default for<br />
protection with a HASP stand-alone key. For<br />
the DOS Envelop only<br />
-ibm Default. The target computer is an IBM PC or<br />
compatible.<br />
-interval Specify an interval for background checks in<br />
seconds.<br />
-loader Specify a loader filename when protecting an<br />
application with overlays For the DOS<br />
Envelope only.<br />
-loginx Use with applications that do not perform<br />
automatic <strong>HASP4</strong> Net Logout (e.g., Visual<br />
Basic). For the Win32 Envelope only.<br />
-mhid<br />
<br />
-mhpass <br />
<br />
Specify the HASP ID number of the <strong>HASP4</strong><br />
M1, <strong>HASP4</strong> M4 or <strong>HASP4</strong> <strong>Ti</strong>me.<br />
Specify the <strong>HASP4</strong> M1, <strong>HASP4</strong> M4 or <strong>HASP4</strong><br />
<strong>Ti</strong>me passwords.<br />
-nec Set the target computer as an NEC.<br />
-netcfg Specify a <strong>HASP4</strong> Net configuration filename.<br />
-nhpass<br />
<br />
Specify the <strong>HASP4</strong> Net passwords.<br />
-nodbgcheck Disables debugger detection. For the Win32<br />
Envelope only.<br />
-noenc Do not encrypt the file during protection.<br />
-nofas Default. Do not use the Full Authorization<br />
System.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 67
Protecting with HASP Envelope Part 2 - Chapter 5<br />
Switch Operation<br />
-nohasp4 Disable the <strong>HASP4</strong> security features.<br />
-norandomsize Disables the Random File Size option. For the<br />
DOS Envelope only.<br />
-nores Increase compatibility for resident DOS<br />
programs. This switch disables background<br />
HASP checks. For the DOS Envelope only.<br />
-nospecial Default. Use the applications that do not<br />
contain overlays. Identical to: Special Overlays<br />
Mode = NO. For the DOS Envelope only.<br />
-novir Disable automatic virus protection. For the<br />
DOS Envelope only.<br />
-out Rename the protected application file.<br />
-ovl Handle overlays. For the Win32 Envelope only.<br />
-pcs Install PCS in batch mode.<br />
-prg Specify the application file to protect.<br />
-prgnum <br />
Specify the program number. (With the<br />
Windows and DOS Envelopes, for FAS or<br />
<strong>HASP4</strong> Net; with the Win32 Envelope, for<br />
<strong>HASP4</strong> Net only).<br />
-quiz Specifies how often random data are encrypted<br />
and decrypted using the HASP key. Possible<br />
values 0 to 50. For the Win32 Envelope only.<br />
-randomsize Default. Enables the Random File Size option.<br />
For the DOS Envelope only.<br />
68 © Aladdin Knowledge Systems, 2002
Using HASP Tools Protecting with HASP Envelope<br />
Switch Operation<br />
-special Handle overlays and DOS extenders. Identical<br />
to: Special Overlays Mode = NO. For the DOS<br />
Envelope only.<br />
-special1 Alternative overlay handling. Identical to:<br />
Special Overlays Mode = YES - Method 1.For<br />
the DOS Envelope only.<br />
-vir Default. Automatic virus protection. For the<br />
DOS Envelope only.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 69
Protecting with HASP Envelope Part 2 - Chapter 5<br />
Additional <strong>HASP4</strong> Net Information<br />
Protection for Networks and Stand-Alone Machines<br />
<strong>HASP4</strong> Net Idle <strong>Ti</strong>me<br />
HASP Envelope allows you to protect your application for both<br />
network environments and stand-alone machines.<br />
When you activate an application protected for both networks and<br />
stand-alone machines, your application performs the following<br />
checks:<br />
First, the application checks that a HASP stand-alone key is<br />
connected to the computer that activated the application.<br />
If the application does not find a HASP connected to the<br />
computer, it searches the network for a <strong>HASP4</strong> Net key.<br />
To enable HASP Envelope protection for both networks and<br />
stand-alone machines, enter the passwords of both a <strong>HASP4</strong> Net<br />
and a HASP stand-alone key in the correct password boxes.<br />
For an Envelope-protected application, the default time span after<br />
which a station is considered idle is the default idle time of the<br />
HASP License Manager.<br />
<strong>HASP4</strong> Net Logout for Win 16 Applications<br />
The envelope automatically adds a <strong>HASP4</strong> Net Login at the start<br />
of the program, and a <strong>HASP4</strong> Net Logout when the application<br />
ends. However, if the application is Win16 and the protocol is<br />
TCP/IP only, the logout is not automatically performed. To<br />
ensure that the automatic logout is added in these cases, make sure<br />
one of the other supported protocols is installed.<br />
70 © Aladdin Knowledge Systems, 2002
Using HASP Tools Protecting with HASP Envelope<br />
Frequently Asked Questions<br />
Question How long does it take to load an Envelope-protected application<br />
into memory?<br />
Answer Depending on the size of the application and computer<br />
performance, loading time increases by several seconds only.<br />
Question Does HASP anti-debugging interfere with normal PC operation?<br />
Answer No. The HASP anti-debugging mechanism is completely<br />
transparent and has no affect on application execution.<br />
Question Does the HASP Envelope check for the key during the<br />
application’s run time?<br />
Answer Yes. HASP Envelope can implement a series of background<br />
HASP checks while the application runs. For additional<br />
information, see Perform Background HASP Checks in the<br />
"Options Tab" (page 56).<br />
Question Can I use a HASP Envelope to protect with a <strong>HASP4</strong> M1 or a<br />
<strong>HASP4</strong> M4 and a <strong>HASP4</strong> Net?<br />
Answer Yes. Enter the passwords of your <strong>HASP4</strong> M1 and <strong>HASP4</strong> M4<br />
keys and <strong>HASP4</strong> Net keys and the values of the additional boxes<br />
relevant to both types of keys. After protecting, the protected<br />
application will first search for the <strong>HASP4</strong> M1 or <strong>HASP4</strong> M4 on<br />
the computer at which the application is activated. If a <strong>HASP4</strong><br />
M1 or <strong>HASP4</strong> M4 is not connected, the protected application<br />
will search the network for the <strong>HASP4</strong> Net key.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 71
Protecting with HASP Envelope Part 2 - Chapter 5<br />
Question When do I need to specify a program number when using HASP<br />
Envelope?<br />
Answer With <strong>HASP4</strong> Net, always! With <strong>HASP4</strong> M1 or <strong>HASP4</strong> M4, only<br />
when you implement the Full Authorization System.<br />
72 © Aladdin Knowledge Systems, 2002
Part 2 - Chapter 6<br />
Accessing Keys with<br />
HASP Edit<br />
HASP Edit is an application which lets you access your HASP<br />
keys.<br />
HASP Edit is available for Mac OS 9.x and Mac OS 10.1 and for<br />
Windows 95/98/ME/NT/2000.<br />
The keys programmed with one of the HASP Edit applications<br />
can be used on all supported platforms. Alternatively, you can use<br />
the HASP API to program your HASP keys.<br />
Use HASP Edit to perform two main types of operation:<br />
Prepare for application protection by encoding data and<br />
retrieving the HASP ID number.<br />
Program your HASP keys and prepare them for distribution to<br />
clients by editing the HASP memory, setting protection<br />
parameters and the <strong>HASP4</strong> <strong>Ti</strong>me real-time clock.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 73
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
HASP Edit for Windows<br />
Activating HaspEdit<br />
This chapter explains the use of HASP Edit for Windows in<br />
performing the main operations. For detailed information refer to<br />
the online help.<br />
To load HaspEdit:<br />
1. Connect the HASP key to your computer.<br />
!<br />
Do not connect more than one key, because you can<br />
only write to one key at a time.<br />
HASP Edit does not distinguish between different<br />
connected keys with the same developer code and could<br />
as a consequence mistakenly destroy data stored in one<br />
or more of them.<br />
2. Choose HaspEdit from the HASP CD menu in the Windows<br />
Programs directory. The HaspEdit window appears:<br />
3. Start a new HaspEdit session or open a HaspEdit configuration<br />
file (to work with an existing file).<br />
74 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
HaspEdit Configuration File<br />
A HaspEdit configuration file stores HASP parameters set using<br />
HaspEdit. In the configuration file, you save details of the HASP<br />
model you are using, the key’s passwords, its ID, its memory image<br />
and FAS protection parameters. Saving the details of your<br />
HaspEdit session is useful if you want to program multiple keys<br />
with the same information.<br />
When you choose Save from the File menu, you save the HASP<br />
parameters to a file and not to the HASP key. The name of the<br />
configuration file then appears in the HaspEdit utility’s title bar.<br />
Before closing, HaspEdit asks you whether or not to save the<br />
current HaspEdit parameters to the configuration file<br />
When you activate HaspEdit, you can either start a new HaspEdit<br />
session, or load a previous session by opening a configuration file.<br />
Starting a New HaspEdit Session<br />
!<br />
To start a new HaspEdit session:<br />
1. Choose New HaspEdit Session and click OK.<br />
The HASP Password dialog box appears<br />
2. Enter the HASP passwords. If you are evaluating a HASP<br />
demo key, check the A Hasp demo key box in order to enter<br />
the HASP demo passwords automatically.<br />
3. Click OK.<br />
The HaspEdit configuration file contains your secret<br />
passwords. Regard this file as if it were your source code<br />
and keep it in a safe place.<br />
If the passwords entered match those of the key connected, the<br />
Configuration window is displayed. You can now use HaspEdit.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 75
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
Opening an Existing HaspEdit Configuration File<br />
To open an existing HaspEdit configuration file:<br />
1. Choose Open HaspEdit Configuration and click OK.<br />
The Open dialog box appears.<br />
2. Select or enter the name of the configuration file to open.<br />
3. Click Open.<br />
If the passwords and model of the key saved in the<br />
configuration file match those of the key connected, the<br />
Configuration window is displayed. You can now use HaspEdit.<br />
HaspEdit Configuration Window<br />
The Configuration window appears when you start a new<br />
HaspEdit session or open an existing HaspEdit configuration file.<br />
When you close this window, you are prompted to end the current<br />
HaspEdit session<br />
Figure 6.1 HaspEdit Configuration Window.<br />
The HaspEdit configuration Window appears the following<br />
information:<br />
The HASP model.<br />
The passwords of the HASP key. The passwords can be viewed<br />
or hidden by checking Passwords in the View menu.<br />
The unique ID number of the HASP key.<br />
76 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
Preparing for Application Protection<br />
Encoding Data<br />
Use HaspEdit to prepare for application protection by encoding<br />
data for use in your application and by retrieving the unique<br />
HASP ID number.<br />
This function allows you to encode data using a <strong>HASP4</strong> key. After<br />
encoding, you can use the encoded data in your application and<br />
decode it during runtime using the appropriate HASP API<br />
function.<br />
To encode data:<br />
1. Choose Encoding from the HASP Tools menu or click the<br />
Encode icon. The Encode window appears:<br />
2. Enter or select the source of the data you would like to encode.<br />
You can encode data from the windows clipboard or a file, or<br />
you can type a string directly at the keyboard.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 77
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
3. Enter or select the name of a binary destination file for the<br />
encoded data (optional).<br />
Binary output data cannot be pasted into a text editor,<br />
since the characters are non-printable.<br />
4. Enter the name of an ASCII destination file or choose<br />
Clipboard for the encoded data (optional).<br />
ASCII-encoded data has the following appearance:<br />
5. Select your programming language.<br />
This option will produce an include file for your programming<br />
language, so you can use the encoded data easily within your<br />
application.<br />
6. Click Encode to start the process.<br />
Theoretically, you can encode or decode up to 4GB of<br />
data in a single call. Please note that HaspEdit needs to<br />
allocate buffers to encode and decode the data. This<br />
means that the restrictions on the HaspEdit encoding/<br />
decoding feature are related to the amount of RAM and<br />
hard disk space on your computer.<br />
78 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
To decode data:<br />
1. Choose Decoding from the HASP Tools menu or click the<br />
Decode icon. The HASP Decode window appears:<br />
2. Enter or select the name of a binary source file containing the<br />
encoded data you would like to decode.<br />
3. Enter or select the name of a binary destination file for the<br />
decoded data.<br />
4. Press Decode to start the process<br />
Theoretically, you can encode or decode up to 4GB of<br />
data in a single call. Please note that HaspEdit needs to<br />
allocate buffers to encode and decode the data. This<br />
means that the restrictions on the HaspEdit encoding/<br />
decoding feature are related to the amount of RAM and<br />
hard disk space on your computer.<br />
Retrieving the HASP ID Number<br />
Each HASP memory key has a unique ID number. You can<br />
incorporate a check for this number into your application using<br />
HASP Envelope or API. To do so, first use HaspEdit to determine<br />
the ID number of the attached key.<br />
With HASP Edit, you can retrieve the HASP ID of <strong>HASP4</strong> keys<br />
with memory. The HASP ID is unique to every key. You can check<br />
for a specific HASP ID in your protected application using service<br />
6 (HaspID).<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 79
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
To check the ID number of a HASP memory key:<br />
1. Connect the HASP key to your computer.<br />
2. Choose HASP ID from the HASP Tools menu or click the<br />
ID icon. The HASP ID window appears:<br />
The window displays the ID number (an unsigned, 32-bit<br />
integer) in hexadecimal and decimal format and as two short,<br />
16-bit words.<br />
3. If you choose to protect with the HASP Envelope, note the ID<br />
number displayed in hexadecimal format. You can later enter it<br />
into the HASP Envelope.<br />
4. If you choose to protect with the HASP API, note the ID low<br />
word and the ID high word and compare them with the values<br />
the hasp( ) routine returns in Par1 and Par2 of Service 6: HASP<br />
ID. Alternatively, note the ID number and compare it to the<br />
value you calculate using the formula found in Service 6.<br />
To copy contents of the HASP ID window, select Copy<br />
from the Edit menu.<br />
80 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
Setting Protection Parameters with FAS<br />
The Full Authorization System (FAS) enables you to lease your<br />
software, distribute demo versions of your application and protect<br />
multiple applications with a single HASP memory key.<br />
Implementing FAS is optional when protecting with <strong>HASP4</strong> M1 or<br />
<strong>HASP4</strong> M4, and is implemented with the Envelope. However, FAS<br />
is required with <strong>HASP4</strong> Net and is implemented via the HASP<br />
Envelope and/or the HASP API.<br />
You can implement FAS only with <strong>HASP4</strong> keys with memory.<br />
This section describes how to program HASP keys if you are using<br />
FAS.<br />
FAS Program List<br />
With FAS, you create a list of applications to protect and set the<br />
protection parameters for each.<br />
Use FAS to authorize the following up to:<br />
16 applications using a single <strong>HASP4</strong> M1<br />
112 applications using a single <strong>HASP4</strong> M4<br />
8 applications using a single <strong>HASP4</strong> <strong>Ti</strong>me<br />
112 applications using a single <strong>HASP4</strong> Net<br />
Use HaspEdit to assign each application on the FAS program list<br />
a unique program number which identifies it and and to set<br />
protection parameters.<br />
FAS Protection Parameters<br />
With HaspEdit, you specify protection parameters for each<br />
program on the FAS program list. The parameters you specify<br />
depend on the HASP model you are using.<br />
Use FAS to do the following:<br />
Limit the number of activations for each application protected<br />
with a <strong>HASP4</strong> M1 or <strong>HASP4</strong> M4.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 81
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
Set expiration dates after which applications protected with a<br />
<strong>HASP4</strong> <strong>Ti</strong>me cannot run.<br />
Limit both the number of stations which can run a <strong>HASP4</strong> Net<br />
protected program simultaneously and the number of<br />
activations for each application.<br />
Use HaspEdit to set and/or edit the protection parameters for<br />
each program. Once you set protection parameters for each<br />
program, write the program list and protection parameters to the<br />
HASP memory.<br />
The next sections describe how to edit the FAS program list for<br />
each of the different HASP memory keys.<br />
Setting the FAS Program List for <strong>HASP4</strong> M1 and <strong>HASP4</strong> M4<br />
Use FAS to limit the number of allowed activations for each<br />
application protected with <strong>HASP4</strong> M1 and <strong>HASP4</strong> M4.<br />
To set the FAS program list for <strong>HASP4</strong> M1 or<br />
<strong>HASP4</strong> M4:<br />
1. Choose Full Authorization System (FAS) from the HASP<br />
Tools menu and click MemoHASP, or click the FAS icon. The<br />
MemoHASP FAS Editor window appears:<br />
82 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
2. Click Add to add the program(s) you want to protect. The Add<br />
Program window appears.<br />
3. In the Program box, enter a program number unique to the<br />
program you are protecting. The number can be from 1 to 16<br />
for <strong>HASP4</strong> M1, or from 1 to 112 for <strong>HASP4</strong> M4. The program<br />
number should be identical to the number you assign your<br />
program when you protect it with HASP Envelope.<br />
Make a note of the number assigned to each program.<br />
In HASP Envelope utility, you use this number to<br />
specify the program you are protecting.<br />
4. In the Activations box, enter the maximum number of allowed<br />
activations for the application. Check Unlimited to allow an<br />
unlimited number of activations.<br />
5. In the Comments box, add information identifying the<br />
program, such as its filename and any further relevant<br />
comments.<br />
Comments written in MemoHASP FAS Editor are<br />
saved in the HaspEdit configuration file and not in the<br />
key’s memory.<br />
6. Click OK. The program is added to the MemoHASP FAS<br />
Editor list.<br />
7. Click Write. The Write HASP Memory window appears.<br />
8. Save changes to the HASP key. You can either:<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 83
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
Click Write to save all the changes to the memory.<br />
Check Write Selected Programs Only to save only the<br />
selected programs to the memory, click Write.<br />
All changes to the memory are initially shown on screen in red.<br />
Clicking Write saves the changes to the HASP key. All data written<br />
to the key appear in blue.<br />
Setting the FAS Program List for <strong>HASP4</strong> <strong>Ti</strong>me<br />
Use FAS to set an expiration date after which the <strong>HASP4</strong> <strong>Ti</strong>me<br />
protected application(s) will stop running.<br />
To set the FAS program list for <strong>HASP4</strong> <strong>Ti</strong>me:<br />
1. Choose Full Authorization System (FAS) from the HASP<br />
Tools menu and click <strong>Ti</strong>meHASP or click the FAS icon. The<br />
<strong>Ti</strong>meHASP FAS Editor window appears:<br />
84 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
2. Click Add to add the program(s) to protect. The Add Program<br />
dialog box appears:<br />
3. In the Program box, enter a program number unique to the<br />
program you are protecting. The number can be from 1 to 8.<br />
The program number should be identical to the number you<br />
assign your program when you protect it with the Envelope<br />
Make a note of the number assigned to each program.<br />
In the Envelope utility, you use this number to specify<br />
the program you are protecting.<br />
4. In the boxes provided in the Program Expiration Date frame,<br />
enter the day, month and year of the application’s expiration<br />
date. Click the Unlimited Date box if you do not want to set<br />
an expiration date.<br />
5. In the Comments box, add information identifying the<br />
program, such as its filename and any further relevant<br />
comments..<br />
Comments written in <strong>Ti</strong>meHASP FAS Editor are saved<br />
in the HaspEdit configuration file and not in the key’s<br />
memory.<br />
6. Click OK. The program is added to the <strong>Ti</strong>meHASP FAS Editor<br />
list.<br />
7. Click Write. The Write HASP Memory window appears.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 85
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
8. Save changes to the <strong>HASP4</strong> <strong>Ti</strong>me key. You can either:<br />
Click Write to save all the changes to the memory.<br />
Check Write Selected Programs Only to save only the<br />
selected programs to the memory, click Write.<br />
All changes to the memory are initially shown on screen in red.<br />
Clicking Write saves the changes to the <strong>HASP4</strong> <strong>Ti</strong>me key. All data<br />
written to the key appear in blue.<br />
Setting the FAS Program List for <strong>HASP4</strong> Net<br />
Use FAS to set the number of stations that can run the program<br />
simultaneously and to set the allowed number of activations for<br />
each of the applications protected with <strong>HASP4</strong> Net..<br />
FAS must be used whenever you use a <strong>HASP4</strong> Net key,<br />
even when protecting a single program.<br />
To set the FAS program list for <strong>HASP4</strong> Net:<br />
1. Choose Full Authorization System (FAS) from the HASP<br />
Tools menu and click NetHASP or click the FAS icon. The<br />
NetHASP Program Editor appears:<br />
86 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
2. Click Add to add the program(s) to protect. The Add Program<br />
dialog box appears.<br />
3. In the Program box, enter a program number unique to the<br />
program you are protecting. The number can be from 1 to 112.<br />
The program number should be identical to the number you<br />
assign your program when you protect it with the HASP<br />
Envelope or the HASP API<br />
Make a note of the number assigned to each program.<br />
In HASP Envelope utility, you use this number to<br />
specify the program you are protecting.<br />
4. In the Stations box, enter the maximum number of stations<br />
allowed to use the program simultaneously.<br />
5. The maximum number possible depends on the <strong>HASP4</strong> Net<br />
model number. <strong>HASP4</strong> Net5 allows up to 5 stations; <strong>HASP4</strong><br />
Net10 allows up to 10 stations, and so on. If using <strong>HASP4</strong><br />
NetU, check the Unlimited box to allow an unlimited number<br />
of stations.<br />
6. In the Activations box, enter the allowed number of<br />
activations for the application or check the Unlimited box to<br />
allow an unlimited number of activations.<br />
7. In the Comments box, add information identifying the<br />
program, such as its filename and any further relevant<br />
comments.<br />
Comments written in NetHASP FAS Editor are saved<br />
in the HaspEdit configuration file and not in the key’s<br />
memory.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 87
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
8. Click OK.<br />
Editing the HASP Memory<br />
9. The program is added to the NetHASP Program Editor list.<br />
10. Click Write. The Write HASP Memory window appears.<br />
11. Save changes to the <strong>HASP4</strong> Net key. You can either:<br />
Click Write to save all the changes to the memory.<br />
Check Write Selected Programs Only to save only the<br />
selected programs to the memory, click Write.<br />
All changes to the memory are initially shown on screen in red.<br />
Clicking Write saves the changes to the <strong>HASP4</strong> Net key. All data<br />
written to the key appear in blue.<br />
With HaspEdit you read and write to the HASP memory and save<br />
passwords, a customer’s name, parts of your program code or any<br />
other data.<br />
Navigating in the HASP Memory Editor Windows<br />
All HASP Memory Editor Windows are navigated similarly. Use<br />
the mouse to move from field to field in the window and the<br />
buttons to perform different operations.<br />
You can view in the Offset box the position number of the<br />
selected word in memory. Enter the position number of a word in<br />
this box to select it for editing.<br />
Click Hex (hexadecimal) or Decimal to choose the format in<br />
which to enter data in the left pane. Enter data in ASCII format in<br />
the right pane. Use the mouse to toggle between the two panes.<br />
Press PageUp and PageDown to move between pages of <strong>HASP4</strong><br />
M4, <strong>HASP4</strong> <strong>Ti</strong>me and <strong>HASP4</strong> Net memory.<br />
All changes to the memory are initially shown on screen in red.<br />
Clicking Write saves the changes to the key. All data written to the<br />
key appear in blue.<br />
88 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
The box Location Description indicates the location of words in<br />
HASP memory. First, it specifies if a word of memory is located in<br />
the User area or FAS area. If the word is in the FAS area, it shows<br />
the program number (i.e., (P1) for program 1 or (P2) for program<br />
2, etc.) associated with the selected word. Also, it notes if the word<br />
is unregistered (meaning that it is not on the FAS program list) or,<br />
if it is registered, it places in quotation marks comments you<br />
assigned.<br />
!<br />
If the cursor is located in the FAS area on a word of<br />
memory associated with a program whose protection<br />
parameters are saved in the FAS program list, make sure<br />
not to overwrite the word with your own data.<br />
Editing <strong>HASP4</strong> M1 and <strong>HASP4</strong> M4 Memory<br />
Use HaspEdit to edit <strong>HASP4</strong> M1 (56 words of memory) and<br />
<strong>HASP4</strong> M4 (248 words of memory). The first 24 words of<br />
memory comprise the User area and can be used to store any data.<br />
The remaining words of memory comprise the FAS area.<br />
Memory not used for FAS can be used to save any<br />
additional data of you choice.<br />
To edit <strong>HASP4</strong> M1 and <strong>HASP4</strong> M4 memory:<br />
1. Choose HASP Memory from the HASP Tools menu and<br />
click MemoHASP, or click the Memory icon.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 89
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
The MemoHASP Memory Editor opens and displays the<br />
contents of the key’s memory.<br />
2. Edit the memory.<br />
3. Click Write to save changes to the memory.<br />
Editing <strong>HASP4</strong> <strong>Ti</strong>me Memory<br />
<strong>HASP4</strong> <strong>Ti</strong>me incorporates two areas of memory: the 16-byte FAS<br />
<strong>HASP4</strong> <strong>Ti</strong>me area and a user area of 248 words.<br />
Follow the instructions under "To edit the <strong>HASP4</strong> <strong>Ti</strong>me FAS<br />
memory" below to edit the 16 bytes section. Follow the<br />
instructions in "To edit the <strong>HASP4</strong> <strong>Ti</strong>me user memory" to edit the<br />
248-word section.<br />
All 248 words make up the user area and can be used to store any<br />
data..<br />
Memory not used for FAS can be used to save any<br />
additional data of you choice.<br />
To edit the <strong>HASP4</strong> <strong>Ti</strong>me FAS memory<br />
1. Choose HASP Memory from the HASP Tools menu and<br />
click <strong>Ti</strong>meHASP, or click the Memory icon.<br />
90 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
The <strong>Ti</strong>meHASP Memory Editor opens and displays the<br />
contents of the HASP memory:<br />
2. Edit the memory.<br />
3. Click Write to save changes to the <strong>HASP4</strong> <strong>Ti</strong>me memory.<br />
To edit the <strong>HASP4</strong> <strong>Ti</strong>me user memory<br />
1. Choose HASP Memory from the HASP Tools menu and<br />
click MemoHASP.<br />
The <strong>HASP4</strong> <strong>Ti</strong>me Memory Editor opens and displays the<br />
contents of the HASP memory.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 91
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
2. Edit the memory.<br />
3. Click Write to save changes to the memory.<br />
Editing <strong>HASP4</strong> Net Memory<br />
Use HaspEdit to edit <strong>HASP4</strong> Net (248 word of memory). The<br />
first 24 words of <strong>HASP4</strong> Net memory comprise the User area and<br />
can be used store any of your data. The remaining memory<br />
comprises the FAS area<br />
To edit <strong>HASP4</strong> Net memory:<br />
1. Choose HASP Memory from the HASP Tools menu and<br />
click NetHASP, or click the Memory icon.<br />
The NetHASP Memory Editor opens and displays the<br />
contents of the HASP memory:<br />
2. Edit the memory.<br />
Memory not used for FAS can be used to save any<br />
additional data of you choice.<br />
3. Click Write to save changes to the <strong>HASP4</strong> Net memory.<br />
92 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
Setting the <strong>HASP4</strong> <strong>Ti</strong>me Clock<br />
With HaspEdit you set the <strong>HASP4</strong> <strong>Ti</strong>me real-time clock. With<br />
HaspEdit, you can view and change the time and date of the<br />
<strong>HASP4</strong> <strong>Ti</strong>me clock.<br />
To set the <strong>HASP4</strong> <strong>Ti</strong>me clock:<br />
1. Choose <strong>Ti</strong>meHASP Clock from the HASP Tools menu.<br />
The <strong>Ti</strong>meHASP <strong>Ti</strong>me & Date Properties dialog box<br />
appears:<br />
2. Enter the month, day and year in the <strong>Ti</strong>meHASP Date frame.<br />
3. Click Write Date to save the date.<br />
4. Enter the time in hh (hours), mm (minutes) and ss (seconds) in<br />
the <strong>Ti</strong>meHASP <strong>Ti</strong>mer frame. To set the real-time clock to the<br />
system time, click Load System <strong>Ti</strong>me and then click Write.<br />
The <strong>HASP4</strong> <strong>Ti</strong>me clock uses the 24-hour format (00:00:00 to<br />
23:59:59)<br />
5. Click Write <strong>Ti</strong>me to save the time.<br />
6. Click Close to exit the <strong>Ti</strong>meHASP <strong>Ti</strong>me & Date Properties<br />
dialog box.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 93
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
Programming Multiple HASP Keys<br />
Program Key<br />
After you have protected your application, you can program your<br />
HASP keys in preparation for delivery (together with the<br />
application) to your customers.<br />
When you program multiple keys, do not daisy-chain them.<br />
Instead, save the same memory to the keys one after another using<br />
a simple procedure. HaspEdit lets you program multiple keys with<br />
the same parameters set in the Memory Editor and FAS Editor<br />
using either of the following methods:<br />
Program Key<br />
Create Programming Utility<br />
When you use the Program Key option, you program each HASP<br />
key with the data from the current HaspEdit utility session.<br />
To save HaspEdit memory to multiple keys:<br />
1. Choose Program Key from the HASP Tools menu, or click<br />
the Prog icon on the toolbar.<br />
The Multi-key Programming window appears.<br />
2. Click Yes to write the HaspEdit memory to the connected<br />
HASP key. The number of keys you have programmed so far is<br />
displayed as the Write Count.<br />
3. Remove the currently attached HASP key and connect the next<br />
one you want to program.<br />
4. Repeat steps 2-3 until all the keys have been programmed.<br />
94 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
Create a Programming Utility<br />
When you create a programming utility, you create a stand-alone<br />
executable to program each HASP key with the parameters you set<br />
in the current HaspEdit session. When creating the file, make sure<br />
to leave open the FAS and/or Memory Editor windows (you can<br />
minimize them if you want), because it is with the data in them<br />
that the HASP Programming utility generates the executable.<br />
To create a HASP Programming utility:<br />
1. Choose Create Programming Utility from the HASP Tools<br />
menu. The HASP window opens:<br />
2. Choose the type of executable in the Application Type frame.<br />
3. Enter a name for the executable in the Utility Name box.<br />
The default name is Haspprog.exe. You can change the name/<br />
directory by entering a new one or by clicking Browse.<br />
4. In the Program Caption box (for Win32 GUI applications) or<br />
the Program Banner box (for Win32 console or DOS<br />
applications), enter a title to appear when the executable is<br />
loaded.<br />
5. Click Create.<br />
If an executable of the same name does not already exist, a<br />
message confirming creation of the executable appears. Click<br />
OK to return to the HASP Programming Utility dialog box.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 95
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
If an executable of the name specified already exists, a<br />
confirmation dialog box appears. Click Yes to replace the file<br />
and create a new executable, or click No to return to the HASP<br />
Programming Utility dialog box.<br />
You can now run the executable and edit keys.<br />
96 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
HASP Edit for Mac<br />
Getting Started<br />
Setting Preferences<br />
This chapter explains the use of HASP Edit for Mac in<br />
performing the main operations on Mac OS X. For detailed<br />
information refer to the online help.<br />
To start HASP Edit for Mac:<br />
1. Connect a HASP key to your computer.<br />
Do not connect more than one HASP key to the computer<br />
while using HASP Edit. The HASP Edit utility can only handle<br />
one key at a time.<br />
2. Start HASP Edit. The Password window is displayed.<br />
3. Enter the passwords and confirm with OK.<br />
The passwords for HASP demo keys are inserted automatically by<br />
default. To change this setting, choose Preferences from the<br />
HASP Edit menu and activate/deactivate the option.<br />
You can also start HASP Edit without connecting a<br />
HASP key, e.g. to edit templates.<br />
You have the following options when setting preferences for<br />
HASP Edit for Mac:<br />
Change the value with which the memory will be filled when<br />
clearing the memory<br />
Set a root directory for your template files<br />
Display a warning if the time and date assigned to a <strong>HASP4</strong><br />
<strong>Ti</strong>me key differ significantly from the system time setting<br />
Facilitate the use of HASP demo keys by having their<br />
passwords inserted automatically<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 97
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
Scan for connected keys periodically<br />
To set preferences, choose Preferences from the HASP Edit<br />
menu and activate/deactivate the option.<br />
Preparing for Application Protection<br />
Encoding Data<br />
Use HASP Edit for Mac to prepare for application protection by<br />
encoding data for use in your application and by retrieving the<br />
unique HASP ID number.<br />
This function allows you to encode data using a <strong>HASP4</strong> key. After<br />
encoding, you can use the encoded data in your application and<br />
decode it during runtime using the appropriate HASP API<br />
function.<br />
To encode data:<br />
1. Select Encode/Decode in the navigation tree.<br />
2. Make sure the right HASP key is connected.<br />
3. Enter data or click Load to load a file.<br />
4. Select a format for your output data.<br />
5. Use the mouse or the keyboard to select the section of data you<br />
want to encode (at least 8 bytes). Click Encode to encode the<br />
data and click Save As to save the encoded data to a file.<br />
You have the option to edit the file and select sections<br />
to encode. If the file size exceeds 1024 bytes you can<br />
encode the file but you cannot edit it or select sections.<br />
Retrieving the HASP ID Number<br />
With HASP Edit, you can retrieve the HASP ID of <strong>HASP4</strong> keys<br />
with memory. The HASP ID is unique to every key. You can check<br />
for a specific HASP ID in your protected application using service<br />
6 (HaspID).<br />
98 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
To retrieve the HASP ID, connect the HASP key to your<br />
computer and enter the passwords. The ID number is displayed<br />
automatically in the Current HASP view.<br />
You can choose between three different 32-bit and 16-bit<br />
representations of the number:<br />
Hexadecimal<br />
Decimal unsigned<br />
Decimal signed<br />
Programming HASP Keys<br />
Before distributing HASP keys to your customers together with<br />
the protected application you need to program them. You can fill<br />
the memory of the <strong>HASP4</strong> keys with data of your choice and/or<br />
use the memory for the Full Authorization System (FAS). The<br />
keys programmed with HASP Edit for Mac can be used on all<br />
supported platforms.<br />
The programming process involves the two main steps:<br />
First you create a master key or a template which serves as a basis<br />
for programming a number of keys. You may need to create<br />
several master keys or templates in case you are using more than<br />
one HASP key type.<br />
After creating a master key or a template, you can start to program<br />
your keys for distribution. To program several identical keys<br />
quickly, use the multi key programming tool.<br />
.<br />
!<br />
Do not connect more than one key, because you can<br />
only write to one key at a time.<br />
Programming a Single HASP Key<br />
You program single keys to use them as master keys, or in case you<br />
need to prepare a special key for a single customer.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 99
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
To program a single HASP key:<br />
1. Connect the <strong>HASP4</strong> key you want to use as a master key. In<br />
case the key is not displayed in the Current HASP view,<br />
choose Scan for Connected Key from the Edit menu.<br />
2. Enter the passwords for the key.<br />
3. Click the Memory box and edit the memory according to your<br />
needs.<br />
The data are colored red until being written to the key or saved<br />
to a template file.<br />
4. Click Write to program the key. You can also save the memory<br />
image to a template file (see below).<br />
Working with Templates<br />
The HASP Edit template file stores HASP parameters and<br />
additional information:<br />
The HASP key type<br />
The key's passwords<br />
The memory image and FAS protection parameters<br />
Additional comments about the FAS parameters<br />
<strong>HASP4</strong> <strong>Ti</strong>me parameters<br />
!<br />
The HASP Edit template file contains the HASP<br />
passwords. Regard it as part of your source code and be<br />
sure to keep it safe.<br />
You use template files to program several HASP keys of the same<br />
type with the same memory content.<br />
You have the following options when working with templates:<br />
Create, rename and delete templates<br />
Write to a currently connected key from the template view<br />
100 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
Link comments from a template to a current key view for a<br />
better overview<br />
To create a template:<br />
1. Choose New from the File menu.<br />
2. Choose Save as from the File menu.<br />
3. Enter a name for the template and select a folder.<br />
To create a template from a connected key:<br />
1. Connect the key and choose Scan for Connected Key from<br />
the Edit menu to scan for it.<br />
2. Choose Save as from the File menu.<br />
3. Enter a name for the template and select a folder.<br />
To program a single key from the template view:<br />
Connect the key you want to program.<br />
Select the template.<br />
Click Write Key.<br />
Using the Multi Key Programming Tool<br />
When you program multiple keys, you save the same memory to<br />
the keys one after another using the memory content of a key<br />
which has already been programmed or using a template.<br />
To use the multi key programming tool with the<br />
memory of a programmed key:<br />
1. Connect and program the key you want to use as a basis.<br />
2. Select Current HASP in the navigation tree.<br />
3. Select Multi Key Programming from the Tools menu.<br />
4. Disconnect the key.<br />
5. Connect a new key and confirm.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 101
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
6. Repeat steps 4 to 5 for every new key.<br />
To use the multi key programming tool with a<br />
template:<br />
1. Select the template you want to use.<br />
2. Select Multi Key Programming from the Tools menu.<br />
3. Connect a key and confirm.<br />
4. Disconnect the key.<br />
5. Repeat steps 3 to 4 for every new key.<br />
Using the Full Authorization System<br />
The Full Authorization System (FAS) allows you to protect<br />
multiple applications with a single HASP memory key and to<br />
specify the conditions under which each application can be used.<br />
With HASP Edit, you specify protection parameters for each<br />
program on the FAS program list. The parameters you specify<br />
depend on the HASP model you are using.<br />
You have the following options:<br />
Limit the number of activations for each application protected<br />
with a <strong>HASP4</strong> M1 (up to 16 applications) or <strong>HASP4</strong> M4 (up to<br />
112 applications).<br />
Set expiration dates after which applications protected with a<br />
<strong>HASP4</strong> <strong>Ti</strong>me cannot run.<br />
Limit both the number of stations which can run a <strong>HASP4</strong><br />
Net-protected program simultaneously and the number of<br />
times each application can be activated.<br />
To view the FAS protection parameters:<br />
1. Connect the key or select the template.<br />
2. Choose As FAS List or Split from the View menu.<br />
To set the FAS protection parameters:<br />
1. Connect the key or select the template and click the FAS box.<br />
102 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
2. Enter the number of possible activations (<strong>HASP4</strong> M1, <strong>HASP4</strong><br />
M4, <strong>HASP4</strong> Net), stations (<strong>HASP4</strong> Net) and expiration date<br />
(<strong>HASP4</strong> <strong>Ti</strong>me).<br />
3. To set the number of activations to unlimited, choose<br />
Unlimited from the Edit menu or type U.<br />
Memory usage with FAS<br />
FAS programs are stored in the FAS area of HASP memory. The<br />
FAS area starts at word offset 24.<br />
When you use <strong>HASP4</strong> M1, <strong>HASP4</strong> M4 or <strong>HASP4</strong> Net keys, each<br />
program protected with FAS requires four bytes (two words) of<br />
HASP memory. Each pair of words in the FAS area is reserved for<br />
a specific program number. The first two words are reserved for<br />
program number 1, the second two words for program number 2,<br />
etc.<br />
When you use <strong>HASP4</strong> <strong>Ti</strong>me keys, each program protected with<br />
FAS requires two bytes (one word) of the additional HASP <strong>Ti</strong>me<br />
memory.<br />
The comments entered in the FAS list are only saved in<br />
the template file, not in the key’s memory.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 103
Accessing Keys with HASP Edit Part 2 - Chapter 6<br />
Frequently Asked Questions<br />
Question I’ve used <strong>HASP4</strong> Net to protect a single application. The first 24<br />
words in <strong>HASP4</strong> Net memory are not sufficient. What can I do?<br />
Answer The remaining 224 words of <strong>HASP4</strong> Net memory are reserved<br />
for the protection parameters of the 112 applications you can<br />
protect with a single <strong>HASP4</strong> Net. Since you are protecting only<br />
one application, you can use part of this reserved memory for<br />
other purposes.<br />
Contact your local HASP representative and ask for the <strong>HASP4</strong><br />
Net Memory Layout. Then use the<strong>HASP4</strong> Net API to store data<br />
in unused parts of the memory.<br />
Question Is HASP Edit the only utility with which I can program my<br />
HASP keys?<br />
Answer No. You have several other options for doing so. The first is to<br />
create an automatic programming utility with pre-defined<br />
protection parameters which you set in the HaspEdit utility. For<br />
more information about the programming utility, see page 94.<br />
The second option is to write your own program that implements<br />
the HASP API and writes data to the HASP memory. For more<br />
information about the HASP API, see page 115. Finally, an<br />
option called “Program HASP”, which involves saving FAS<br />
parameters, is found in the Win32 Envelope utility. For more<br />
information about using the HASP Envelope in conjunction with<br />
FAS, see "Saving FAS Parameters" (page 51).<br />
104 © Aladdin Knowledge Systems, 2002
Using HASP Tools Accessing Keys with HASP Edit<br />
Question Can I use HASP keys programmed with HASP Edit for Mac or<br />
HaspEdit for Windows on the other platform?<br />
Answer Yes. The keys programmed with one of the HASP Edit<br />
applications can be used on all supported platforms.<br />
Alternatively, you can use the HASP API to program your HASP<br />
keys.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 105
Part 2 - Chapter 7<br />
Assisting End-Users<br />
The Aladdin Diagnostic utility lets your customers collect<br />
information on their system and on their HASP key. This<br />
information will help you and your customer to solve problems<br />
they may encounter when using the protected application.<br />
Your customers can use the Aladdin Diagnostic utility:<br />
To check for a HASP key.<br />
To create a report file that contains data for Aladdin devices<br />
and other relevant system information.<br />
Aladdin Diagnostic is available for the following environments:<br />
Windows 95/98/ME and Windows NT/2000/XP.<br />
When your customers run the Aladdin Diagnostic utility, instruct<br />
them to activate the Use HASP mode option to check for a<br />
HASP key. In addition, they can create a report from the relevant<br />
data of the system.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 107
Assisting End-Users Part 2 - Chapter 7<br />
Creating Reports<br />
Figure 7.1 The Aladdin Diagnostic Window<br />
Your customers can create a report file that contains data for<br />
Aladdin devices and other relevant system information.<br />
If your customers are experiencing a problem with the HASP<br />
system, they can e-mail the report to you or to the local HASP<br />
technical support staff.<br />
To create a report:<br />
Click Create Report in the Aladdin Diagnostic main<br />
window.<br />
A report file is automatically created and it is saved as a text file in<br />
the AKSDIAG directory. The default name of the file is<br />
NDIAG32.TXT.<br />
The report file opens automatically, allowing you to save it under a<br />
different name or to print it.<br />
108 © Aladdin Knowledge Systems, 2002
Using HASP Tools Assisting End-Users<br />
Diagnosing HASP Keys<br />
To check a HASP key, from the Aladdin Diagnostic window, select<br />
Use HASP mode, and click Check Key; the Check HASP<br />
dialog box appears.<br />
The Check HASP dialog box lets you verify the presence of a<br />
HASP key.<br />
To check for a HASP key:<br />
Under Access Mode in the Check HASP dialog box, select one<br />
of the following options:<br />
Check if any HASP key is connected<br />
Check a HASP demo key<br />
Check a specific HASP key<br />
Checking a remote HASP key<br />
You can access a remote HASP key by selecting Access to HASP<br />
LM in the Check HASP dialog box. Provide the number for the<br />
program you want to log in to and click OK.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 109
Assisting End-Users Part 2 - Chapter 7<br />
To check if any HASP key is connected:<br />
1. Select Check if any HASP key is connected.<br />
2. Click OK.<br />
Information for the result of checking displays.<br />
3. Click OK.<br />
Details for the access display in the Key Access History pane of<br />
the Aladdin Diagnostic window.<br />
To check a HASP Demo key:<br />
1. Select Check a HASP Demo key.<br />
2. Click OK.<br />
Information for the result of checking displays.<br />
3. Click OK.<br />
Details for the access display in the Key Access History panel<br />
of the Aladdin Diagnostic window.<br />
To check a specific HASP key:<br />
1. Select Check a specific HASP key.<br />
2. Enter the passwords for the key.<br />
3. Click OK.<br />
Information for the result of checking displays.<br />
4. Click OK.<br />
Details for the access display in the Key Access History panel<br />
of the Aladdin Diagnostic window.<br />
The HASP passwords are the core of HASP protection<br />
concept, therefore you must never reveal them to<br />
customers. This option of the Aladdin Diagnostic utility<br />
must therefore only be used by those in your company<br />
who know the passwords.<br />
110 © Aladdin Knowledge Systems, 2002
Using HASP Tools Assisting End-Users<br />
Key Access History Panel<br />
The Key Access History panel in the main window shows all<br />
accesses to HASP keys. Key access information is tabulated and<br />
displayed sequentially, showing the recent access first, under the<br />
following:<br />
Table 7.1 Key Access History Panel<br />
Column Value Description<br />
Password any A check for any HASP key connected<br />
locally has been performed.<br />
demo A check has been performed to see if a<br />
Demo key is connected.<br />
custom A check has been performed to see if a<br />
specific HASP key is connected.<br />
Access local The HASP key was found on a local port.<br />
Port/Prog.<br />
p1-p4<br />
remote The HASP key was found on a remote<br />
port.<br />
Displays the number of the port to which the HASP<br />
key is connected.<br />
If HASP was found and logged in on a remote port<br />
with HASP LM, the program number is also<br />
displayed.<br />
If the HASP key cannot be accessed, (n/a) is<br />
displayed.<br />
Displays the API status.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 111
Part 3<br />
Using the HASP API<br />
This part introduces the HASP API protection methods and<br />
strategies. It provides detailed descriptions of all HASP API<br />
services.<br />
The chapter "Protecting with the HASP API" (page 115) explains<br />
how to use the hasp() routine and gives an overview of HASP API<br />
services.<br />
The chapter "Protection Strategies" (page 133) provides you with<br />
information on how to maximize your protection.<br />
The chapter "Basic HASP Services" (page 143) describes services<br />
relevant for all HASP stand-alone keys.<br />
The chapter "<strong>HASP4</strong> Memory Services" (page 151) describes<br />
services relevant for all <strong>HASP4</strong> M1, <strong>HASP4</strong> M4 and <strong>HASP4</strong> <strong>Ti</strong>me<br />
keys.<br />
The chapter "<strong>HASP4</strong> <strong>Ti</strong>me Services" (page 159) describes services<br />
relevant for <strong>HASP4</strong> <strong>Ti</strong>me keys.<br />
The chapter "<strong>HASP4</strong> Net Services" (page 171) describes services<br />
relevant for <strong>HASP4</strong> Net keys.<br />
The chapter "HASP API Status Codes" (page 197) explains all<br />
status codes returned by the HASP system.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 113
Part 3 - Chapter 9<br />
Protecting with the<br />
HASP API<br />
The HASP application programming interface (API) is a powerful<br />
protection method, the strength of which depends on how you<br />
implement it. The more sophisticated and complex your API calls<br />
are, the better your HASP protection will be.<br />
This and the following chapters on the API describe the hasp( )<br />
routine and its services. You will find more information on using<br />
the API in the HASP Programmer’s <strong>Guide</strong>.<br />
You use the API to insert calls to the HASP throughout the<br />
application and thus enhance security. You can check for the<br />
presence of the HASP key at any point in the application and<br />
decide how to respond according to the result of the check. You<br />
can also check a HASP memory key for data you stored in its<br />
memory.<br />
The manner in which you perform these checks is a crucial and<br />
determining factor for security. It is essential, therefore, that you<br />
consult the chapter "Protection Strategies" (page 133) for<br />
guidelines on how best to do so.<br />
Before protecting with the HASP API, we recommend that you<br />
check the API files for your compiler. Each HASP interface<br />
includes a sample application demonstrating API usage.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 115
Protecting with the HASP API Part 3 - Chapter 9<br />
Preparing for API Usage<br />
To use the HASP API, you have to install the HASP device driver<br />
or a daemon. Refer to "Installing HASP" (page 25) for<br />
information on installing the HASP drivers.<br />
Before implementing the API calls in your application, use<br />
HASP Edit and/or the API to perform the following tasks.<br />
Encode data for use within your application<br />
Edit the HASP memory<br />
Use the service HaspEncodeData or the HASP Edit utility to<br />
encode data. You can decode this data with the API when the<br />
correct HASP key is connected.<br />
If you are protecting your application with a HASP memory key,<br />
and are storing sensitive data on it, make a note of the data stored<br />
at each address. The API enables you to access the memory and<br />
read and write data from and to a specified address.<br />
You can use HASP Edit or the services WriteWord, WriteBlock<br />
and WriteByte (only <strong>HASP4</strong> <strong>Ti</strong>me) to write to the memory.<br />
Determine the HASP ID number<br />
HASP memory keys have a HASP ID number. With the API, you<br />
can check the presence of a specific HASP by verifying its ID<br />
number.<br />
You can use HASP Edit to determine the ID number.<br />
116 © Aladdin Knowledge Systems, 2002
Using the HASP API Protecting with the HASP API<br />
Implementing the HASP API<br />
After you have performed the necessary operations using<br />
HASP Edit or the API, you are ready to protect your application<br />
with the API by incorporating calls to the hasp( ) routine<br />
throughout your source code.<br />
Main Stages of Implementation<br />
To implement the API:<br />
Using the hasp( ) Routine<br />
1. Examine the sample code that corresponds to your chosen<br />
development environment.<br />
2. Add the hasp() call to your source code.<br />
3. Use the API to decode and verify important data that your<br />
application uses.<br />
4. On the basis of the output from step 3, carry out any error<br />
checking and issue appropriate notification to the user.<br />
5. Repeat steps 2-4 several times, incorporating these checks in<br />
the various different modules.<br />
6. Compile your source and link it to the HASP object files or to<br />
the supplied library.<br />
7. Use the HASP Envelope utility to add an additional layer of<br />
protection to your application.<br />
Use the hasp( ) routine to incorporate API protection into your<br />
application. The hasp( ) routine checks for the presence of a<br />
HASP key, encodes data at runtime and accesses the memory of a<br />
HASP memory key to perform read and write operations.<br />
The hasp( ) routine is called differently for stand-alone keys and<br />
<strong>HASP4</strong> Net keys.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 117
Protecting with the HASP API Part 3 - Chapter 9<br />
Parameters for HASP Stand-Alone Keys<br />
Parameters for <strong>HASP4</strong> Net Keys<br />
hasp (Service, SeedCode, PortNum,<br />
Password1,Password2,Par1, Par2, Par3,<br />
Par4)<br />
The hasp( ) routine accepts the following nine parameters.<br />
Table 9.1 Parameters for HASP Stand-Alone Keys<br />
Parameter Description<br />
Service Determines the operation performed by the routine.<br />
SeedCode Used for backward compatibility only.<br />
PortNum Specifies which port to search for the HASP key.<br />
Password 1 First password for the HASP key.<br />
Password 2 Second password for the HASP key.<br />
Par1 to Par4 The values of Par1 to Par4 change according to the<br />
service.<br />
hasp (Service, SeedCode, ProgNum,<br />
Password1,Password2,Par1, Par2, Par3,<br />
Par4)<br />
The hasp( ) routine accepts the following nine parameters.<br />
Table 9.2 Parameters for <strong>HASP4</strong> Net Keys<br />
Parameter Description<br />
Service Determines the operation performed by the routine.<br />
SeedCode Used for backward compatibility only.<br />
ProgNum Program number assigned to the protected application<br />
in the <strong>HASP4</strong> Net memory.<br />
118 © Aladdin Knowledge Systems, 2002
Using the HASP API Protecting with the HASP API<br />
Parameter Description<br />
Password 1 First password for the HASP key.<br />
Password 2 Second password for the HASP key.<br />
Par1 to Par4 The values of Par1 to Par4 change according to the<br />
service.<br />
Specifying the Port<br />
You can use the PortNum parameter to specify a parallel port or<br />
the USB port number. Applications protected with <strong>HASP4</strong> Net<br />
search all ports for the <strong>HASP4</strong> Net key, so if you are using <strong>HASP4</strong><br />
Net, skip this section.<br />
Specifying the Parallel Port<br />
Use the PortNum parameter to specify the parallel port to be<br />
searched for HASP stand-alone keys.<br />
If you set PortNum to 0, the protected application automatically<br />
searches all parallel ports in the following order: 378h, 278h,<br />
3BCh. The automatic search stops when the application finds the<br />
HASP.<br />
You may want to search for the HASP at a specific parallel port or<br />
to address a hardware port directly (bypassing the BIOS data area).<br />
The following table lists the various values you can assign to<br />
PortNum in order to search for a specific port.<br />
Table 9.3 PortNum Values and Ports Searched<br />
PortNum Port Searched<br />
0 Automatic search at all ports<br />
1 LPT1 only<br />
2 LPT2 only<br />
3 LPT3 only<br />
101 03BCh only<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 119
Protecting with the HASP API Part 3 - Chapter 9<br />
PortNum Port Searched<br />
102 0378h only<br />
103 0278h only<br />
201 - 255 Specific HASP on USB port<br />
Specifying the USB Port<br />
Use the PortNum parameter to specify the USB port number. For<br />
the purpose of HASP USB enumeration, integers from 201<br />
through 255 are reserved for the USB port. Each port at which a<br />
key is attached is assigned one of these 55 numbers in consecutive<br />
sequence.<br />
The following example shows how to use HASP USB<br />
enumeration:<br />
1. Call the hasp() routine with the IsHasp() service. The value<br />
returned in P2 is the number of ports to check for your specific<br />
key.<br />
2. Treat the number in P2 as the variable n, where n is the number<br />
of USB ports to check.<br />
3. Call the hasp() routine with a HASP API service that reads<br />
memory or retrieves the HASP ID number, transferring the<br />
first USB port number in the PortNum parameter. You should<br />
check for unique data that confirms the identity of a particular<br />
key.<br />
4. If the memory of the key at that first port identifies it as the<br />
specific key you want, store its USB port number. Otherwise,<br />
loop back to step 3 with the next USB port number. In all, loop<br />
up to n times.<br />
Later in your code, you communicate with that particular key using<br />
its specific port number.<br />
120 © Aladdin Knowledge Systems, 2002
Using the HASP API Protecting with the HASP API<br />
Checking for Vital Errors<br />
For HASP stand-alone keys there are two vital error codes to<br />
check after every call to hasp(). The relevant codes are returned in<br />
p3:<br />
"HASP not found": error -3. If this error is encountered,<br />
prompt the user to attach the (correct) HASP key.<br />
"Port Busy": error -6. Call the hasp key again after a short<br />
pause, or ask the user to wait for the printer or other devices to<br />
finish before continuing with the application.<br />
You should also perform one check at the start of your application<br />
to establish whether the HASP device driver is installed. Do this<br />
by checking the first hasp() call for errors -100, -101, -110 and -<br />
111. If either of these are encountered, install the driver and<br />
continue the program.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 121
Protecting with the HASP API Part 3 - Chapter 9<br />
HASP Services<br />
Refer to Table 9.4 for information on which service to use with<br />
the various HASP models.<br />
Table 9.4 HASP Models and Relevant Services<br />
HASP Model Relevant Services<br />
<strong>HASP4</strong> Std. Basic HASP services<br />
<strong>HASP4</strong> M1, M4 Basic HASP services<br />
<strong>HASP4</strong> memory services<br />
<strong>HASP4</strong> <strong>Ti</strong>me Basic HASP services<br />
<strong>HASP4</strong> memory services<br />
<strong>HASP4</strong> <strong>Ti</strong>me services<br />
<strong>HASP4</strong> Net <strong>HASP4</strong> Net services<br />
122 © Aladdin Knowledge Systems, 2002
Using the HASP API Protecting with the HASP API<br />
Basic HASP Services<br />
You can use the basic HASP services with <strong>HASP4</strong> Std.,<br />
<strong>HASP4</strong> M1, <strong>HASP4</strong> M4 and with <strong>HASP4</strong> <strong>Ti</strong>me. The following<br />
services are available.<br />
Table 9.5 Basic HASP Services<br />
Service Name Operation<br />
1 IsHasp Check if any HASP is connected to<br />
the computer.<br />
5 HaspStatus Check the type of HASP connected<br />
to the computer.<br />
Check which parallel port has a key<br />
connected to it.<br />
Check the memory size of a HASP<br />
memory key.<br />
Check the API version.<br />
60 HaspEncodeData Encode data sent to the connected<br />
<strong>HASP4</strong> key. Use in conjunction with<br />
HaspDecodeData to verify that a<br />
specific <strong>HASP4</strong> key is connected.<br />
61 HaspDecodeData Decode data sent to the connected<br />
<strong>HASP4</strong> key. Use in conjunction with<br />
HaspEncodeData to verify that a<br />
specific <strong>HASP4</strong> key is connected.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 123
Protecting with the HASP API Part 3 - Chapter 9<br />
<strong>HASP4</strong> Memory Services<br />
You can use <strong>HASP4</strong> memory services with <strong>HASP4</strong> M1,<br />
<strong>HASP4</strong> M4 and with <strong>HASP4</strong> <strong>Ti</strong>me (496 bytes area). The following<br />
services are available.<br />
Table 9.6 <strong>HASP4</strong> Memory Services<br />
Service Name Operation<br />
3 ReadWord Read one word of data from the<br />
HASP memory.<br />
4 WriteWord Write one word of data to the HASP<br />
memory.<br />
6 HaspID Get the HASP ID number.<br />
50 ReadBlock Read a block of data from the HASP<br />
memory.<br />
51 WriteBlock Write a block of data to the HASP<br />
memory.<br />
124 © Aladdin Knowledge Systems, 2002
Using the HASP API Protecting with the HASP API<br />
<strong>HASP4</strong> <strong>Ti</strong>me Services<br />
You can use <strong>HASP4</strong> <strong>Ti</strong>me services with <strong>HASP4</strong> <strong>Ti</strong>me keys.<br />
Use services 74 to 77 to access the 16-byte <strong>HASP4</strong> <strong>Ti</strong>me memory.<br />
Use the <strong>HASP4</strong> memory services 3, 4, 50, and 51 to access the<br />
496-byte memory of the <strong>HASP4</strong> <strong>Ti</strong>me key.<br />
The following <strong>HASP4</strong> <strong>Ti</strong>me services are available.<br />
Table 9.7 <strong>HASP4</strong> <strong>Ti</strong>me Services<br />
Service Name Operation<br />
70 Set<strong>Ti</strong>me Set the <strong>HASP4</strong> <strong>Ti</strong>me clock to a given<br />
time.<br />
71 Get<strong>Ti</strong>me Get the time from the <strong>HASP4</strong> <strong>Ti</strong>me<br />
clock.<br />
72 SetDate Set the <strong>HASP4</strong> <strong>Ti</strong>me clock to a given<br />
date.<br />
73 GetDate Get the date from the <strong>HASP4</strong> <strong>Ti</strong>me<br />
clock.<br />
74 WriteByte Write one byte of data to the<br />
<strong>HASP4</strong> <strong>Ti</strong>me memory.<br />
75 ReadByte Read one byte of data from the<br />
<strong>HASP4</strong> <strong>Ti</strong>me memory.<br />
76 WriteBlock Write a block of data to the<br />
<strong>HASP4</strong> <strong>Ti</strong>me memory.<br />
77 ReadBlock Read a block of data from the<br />
<strong>HASP4</strong> <strong>Ti</strong>me memory.<br />
78 GetHaspID Get the <strong>HASP4</strong> <strong>Ti</strong>me ID number.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 125
Protecting with the HASP API Part 3 - Chapter 9<br />
<strong>HASP4</strong> Net Services<br />
You can use HASP Net services with <strong>HASP4</strong> Net keys only. The<br />
following services are available.<br />
Table 9.8 <strong>HASP4</strong> Net Services<br />
Service Name Operation<br />
40 LastStatus Check the status of the last call. Use<br />
this service after each call to the<br />
hasp( ) routine.<br />
42 Login Request permission from the HASP<br />
License Manager to activate the<br />
application.<br />
Unless you use services 85 or 96,<br />
login must be your first call to the<br />
hasp( ) routine.<br />
43 Logout Request <strong>HASP4</strong> Net session<br />
termination from the HASP License<br />
Manager.<br />
44 ReadWord Read one word of data from the<br />
<strong>HASP4</strong> Net memory.<br />
45 WriteWord Write one word of data to the<br />
<strong>HASP4</strong> Net memory.<br />
46 HaspID Get the <strong>HASP4</strong> Net ID number.<br />
48 Idle<strong>Ti</strong>me Set a maximum time frame for idle<br />
stations.<br />
52 ReadBlock Read a block of data from the<br />
<strong>HASP4</strong> Net memory.<br />
53 WriteBlock Write a block of data to the <strong>HASP4</strong><br />
Net memory.<br />
85 SetConfigFilename Set name of <strong>HASP4</strong> Net<br />
configuration file.<br />
126 © Aladdin Knowledge Systems, 2002
Using the HASP API Protecting with the HASP API<br />
Service Name Operation<br />
88 HaspEncodeData Encode data sent to the connected<br />
<strong>HASP4</strong> Net key. Use in conjunction<br />
with HaspDecodeData to verify that<br />
a specific <strong>HASP4</strong> Net key is present<br />
on the network.<br />
89 HaspDecodeData Decode data sent to the connected<br />
<strong>HASP4</strong> Net key. Use in conjunction<br />
with HaspEncodeData to verify that<br />
a specific <strong>HASP4</strong> Net key is present<br />
on the network.<br />
96 SetServerByName Set the name of the HASP License<br />
Manager to which the protected<br />
application will perform a <strong>HASP4</strong><br />
Net login.<br />
To access a <strong>HASP4</strong> Net key connected to a local<br />
parallel port, you can use the basic HASP and HASP<br />
memory services.<br />
Enabling Local and Network Protection<br />
The API allows you to protect your application for both network<br />
environments and stand-alone PCs.<br />
To enable API protection for both networks and<br />
stand-alone computers:<br />
1. Use the basic HASP, HASP memory, and <strong>HASP4</strong> <strong>Ti</strong>me<br />
services to check whether or not the correct HASP stand-alone<br />
key is connected to the local port of the computer.<br />
2. If the correct HASP stand-alone key is not found, use the<br />
<strong>HASP4</strong> Net services to search for the <strong>HASP4</strong> Net.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 127
Protecting with the HASP API Part 3 - Chapter 9<br />
HASP Test Utility<br />
With the HASP test utility, you can test the HASP API services<br />
and the operation of <strong>HASP4</strong> Net. You can also use the utility at<br />
your work site to test HASP operations.<br />
The test utility available is haspdemo.exe for Windows and Win32.<br />
With this utility, you can test HASP keys of all models. The<br />
haspdemo.exe is a multi-object sample program that you use to test<br />
keys with different versions of the HASP API. Access it by<br />
clicking HASP Test for Win16 or Win32 on the HASP CD menu.<br />
You can find the executable under<br />
Utility\Haspdemo\Windows\Win16 or Win32<br />
!<br />
You need to provide passwords for most of the<br />
functions in the HASP test utility. The core of HASP<br />
protection concept are the passwords, therefore you<br />
must never reveal them to customers. Haspdemo.exe must<br />
only be used by those in your company who know the<br />
passwords.<br />
128 © Aladdin Knowledge Systems, 2002
Using the HASP API Protecting with the HASP API<br />
Frequently Asked Questions<br />
Question How long is a HASP check?<br />
Answer With HASP stand-alone keys, a call to the hasp( ) routine takes<br />
about 20 milliseconds. A <strong>HASP4</strong> Net login takes<br />
approximately two seconds, depending on network traffic.<br />
Calls to the other <strong>HASP4</strong> Net services require approximately<br />
half a second. As is clear from these figures, you can issue as<br />
many calls to the HASP as you like.<br />
Question How does HASP prevent code tracing?<br />
Answer More than 60% of our routines are designed specifically to<br />
prevent tracing the code of the protected application.<br />
Naturally, we cannot reveal all our “tricks-of-the-trade”, but<br />
below are some samples.<br />
Grabbing debugger interrupts, making it difficult to<br />
activate the debugger itself.<br />
Special traps for hardware debuggers.<br />
Hard-to-trace self-generating code.<br />
<strong>Ti</strong>me traps.<br />
Frequent releases of software upgrades which implement new<br />
features and security enhancements.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 129
Protecting with the HASP API Part 3 - Chapter 9<br />
Question The programming language or compiler I am using is not<br />
compatible with any of the HASP supported languages and<br />
compilers. How can I protect my software?<br />
Answer In this case, we suggest the following:<br />
Try using an available HASP interface which uses the same<br />
type of object files as your compiler.<br />
Try using a DLL (for Windows and Win32 applications).<br />
Consult your local HASP representative. New interfaces<br />
are constantly added to the long list of compilers and<br />
languages supported by HASP.<br />
Use the HASP Envelope utility.<br />
Question How can I protect a DLL with HASP?<br />
Answer You can use the Win32 Envelope utility to protect Win32<br />
DLLs, the Win16 Envelope to protect Win16 DLLs, and the<br />
HASP API to protect Windows and Win32 DLLs.<br />
There are two options when protecting DLLs with the API:<br />
Use the object files supplied with the HASP software and<br />
link them to your DLL. Incorporate calls to the hasp( )<br />
routine into your application.<br />
Call the hasp( ) routine from your DLL. The hasp( ) routine is<br />
defined in the HASP DLL we supply. Include both your DLL<br />
and the HASP DLL when you distribute your application.<br />
130 © Aladdin Knowledge Systems, 2002
Using the HASP API Protecting with the HASP API<br />
Question I’ve used the API to check the HASP ID number. Sometimes,<br />
HaspID returns a negative number in IDLow. When I calculate<br />
the ID number, I get a different one than that which appears in<br />
HASP Edit.<br />
Answer When IDLow is negative, use the following equation to calculate<br />
the ID number:<br />
ID number = 65536 + IDLow + 65536 * IDHigh<br />
Alternatively, you can use HASP Edit to check the short (16-bit)<br />
fractions of the IDLow and IDHigh words. You can then directly<br />
compare them to the IDLow and IDHigh parameters returned by<br />
the hasp( ) routine without calculating the ID number.<br />
Question Where can I find a sample program that demonstrates how to<br />
implement the API?<br />
Answer There is a sample program on our CD for most of the common<br />
compilers. For example, for Visual C++, you can find a sample<br />
under win32api\msc directory.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 131
Part 3 - Chapter 10<br />
Protection<br />
Strategies<br />
The HASP protection system includes the best hardware and<br />
software protection tools available on the market today. However,<br />
a HASP-based software protection system is only as secure as the<br />
way in which you implement it. The calls to the hasp( ) routine that<br />
you insert into your code ultimately control access to your<br />
application. Because the HASP hardware is virtually impossible to<br />
break or duplicate, attacks usually focus on tracing the protection<br />
code and eliminating the protection routines.<br />
To achieve maximum protection with HASP, use both the<br />
Envelope and API protection methods. Each method has its<br />
unique features and complements and enhances the other.<br />
To increase software security when protecting with the API, use<br />
the techniques outlined in this chapter. This chapter describes the<br />
following:<br />
Attacks on software protection schemes that can be avoided by<br />
implementing proper protection techniques.<br />
<strong>Ti</strong>ps for maximizing the security of your protected application.<br />
If you would like assistance in strengthening your application<br />
against possible attacks, we can offer a more personalized support<br />
service from our team of Aladdin Consultants. They will be able to<br />
provide help on a wide range of issues, including protection<br />
strategies and implementation techniques.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 133
Protection Strategies Part 3 - Chapter 10<br />
For more information on Aladdin Consulting, please contact your<br />
local HASP representative.<br />
<strong>Soft</strong>ware Protection Attacks<br />
There are two main methods of attacking a protected application:<br />
Patching calls to the protection routine<br />
Patching the software of the key manufacturer<br />
To patch calls to the protection routine, you need to change the<br />
protected executable so that it does not send requests to the key,<br />
verify the results returned by the key, or act according to the<br />
results specified in the code.<br />
This kind of attack is used when you assume that protection has<br />
been poorly implemented.<br />
To patch the software of the key manufacturer, you need to change<br />
the routines responsible for communication with the hardware key.<br />
When you change these routines, you ensure that they return the<br />
expected results even when the correct key is not connected.<br />
It is important to note that both of these methods are applicationspecific<br />
and cannot be applied as is to other protected applications.<br />
134 © Aladdin Knowledge Systems, 2002
Using the HASP API Protection Strategies<br />
<strong>Ti</strong>ps and Tricks<br />
Use Multiple Calls<br />
This section provides tips and tricks to combat the attacks<br />
described in the previous section. Use as many of the strategies as<br />
possible to maximize the level of your application’s security.<br />
Keep in mind that when you implement protection, you should do<br />
so in a way that considers the implications for legitimate end users<br />
of the application. For example, a legitimate user may forget to<br />
attach the key to the computer; your protection scheme should<br />
take this into consideration. Clever protection strategies combat<br />
attacks on your software, not innocent users.<br />
Insert numerous calls to the hasp( ) routine to exhaust those who<br />
attack your protected software. Complex multiple calls create great<br />
difficulties in following and attacking your protection scheme.<br />
The more calls and return codes checked, the more difficult it is to<br />
trace and remove all of them. The calls should be made from as<br />
many different places in your code as possible.<br />
Encode Internal and External Data<br />
Encode some of the data your application uses and make decoding<br />
dependent on the presence of the HASP key.<br />
Encoding your data greatly enhances your application's security.<br />
Use the <strong>HASP4</strong> ability to encode strings or binary data which will<br />
adversely affect program flow if it is decoded improperly. This<br />
creates an association between your application and the HASP that<br />
cannot easily be removed. Not only will the application have to be<br />
cracked to remove or alter all checks to the HASP but also the data<br />
will have to be decoded. It is not necessary to encode all the data<br />
handled by your application, but certain key data can be encoded.<br />
Good choices are file headers, important constants in calculations,<br />
or some small fields in a database. Anything that will affect the<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 135
Protection Strategies Part 3 - Chapter 10<br />
main functions of the application is a potential candidate for<br />
encoding. Care should be taken to notify the customer that the<br />
HASP key is not present to prevent damage to valuable data.<br />
When a hacker removes these checks and dialog boxes, the subtle<br />
dependency of your application on this data will be revealed.<br />
For simple data sets, the basic process is outlined below. These<br />
basic procedures can be modified to suit your requirements.<br />
1. Connect your <strong>HASP4</strong> key<br />
Make sure that the <strong>HASP4</strong> key that you want to use to protect<br />
your application is attached to the computer.<br />
2. Encode the data<br />
Use the HASP Edit utility to encode your data. The output<br />
from this process will be a binary file. Alternatively you can<br />
choose to create an include file in either VB or C format. This<br />
allows you to access encoded values directly within your<br />
application.<br />
3. Incorporate the encoded data in your application.<br />
Replace the original clear text data in your application with the<br />
include file or the encoded data.<br />
4. Decode the data on demand in your application<br />
Use service 61 - HaspDecodeData to decode the encoded data<br />
via the connected <strong>HASP4</strong> key. Now you are ready to perform<br />
operations on this data. Remember to provide for error<br />
checking to warn users if a <strong>HASP4</strong> is not present.<br />
Note that “HASP not found” and similar strings should not be<br />
encoded using HASP-dependent encoding keys. As these strings<br />
are displayed when the HASP is not connected, their proper<br />
decoding should not be dependent upon a response from the<br />
HASP key. For these types of strings, use an encoding key of your<br />
choice and any available encoding method.<br />
136 © Aladdin Knowledge Systems, 2002
Using the HASP API Protection Strategies<br />
Avoid Repetitive Schemes<br />
Separate the Call Steps<br />
A scheme that repeats itself throughout your code is easy to learn<br />
and track. Once your scheme is understood, it becomes obvious<br />
what to look for, making any attack that much easier.<br />
Furthermore, if your application consists of multiple protected<br />
executables or DLLs, change the protection scheme from one file<br />
to another. Use all the HASP services, calling each of them many<br />
times, and implementing a different protection scheme with each<br />
call. In addition, use the HASP Envelope to protect your<br />
executables. The HASP Envelope uses Multi-Layer Envelope<br />
technology, which implements a different protection scheme for<br />
each executable file.<br />
Avoiding repetitive schemes makes an attack far more timeconsuming.<br />
Searching and hacking a HASP call should be a new<br />
and difficult task each time an attack is planned.<br />
Checking for a HASP involves three main steps:<br />
Calling the hasp() routine.<br />
Evaluating the values returned from the protection routine.<br />
Responding according to the returned values.<br />
To enhance security, code the three steps in different places<br />
throughout your software. Separated steps are much more<br />
difficult to trace than sequential steps. The response to an<br />
unconnected HASP should be delayed and come as a total<br />
surprise, nowhere in the vicinity of the actual HASP check.<br />
For example, you can check for the HASP when the user clicks on<br />
a specific menu item. Allow the user to work even though a key is<br />
not connected. Issue the “HASP not found” message only after an<br />
entirely different operation is executed so that the connection<br />
between the original HASP check and the response is not<br />
apparent.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 137
Protection Strategies Part 3 - Chapter 10<br />
Encode the HASP Memory<br />
Checksum Your Code<br />
In addition to the inherently high level of security provided by the<br />
ASIC chip, you can further secure the HASP memory by encoding<br />
it.<br />
For example, you can use the unique HASP ID number as a key<br />
for encoding the HASP memory. During run time, make sure to<br />
decode the memory using the HASP ID number.<br />
Since the encoding key is different for each HASP, the run time<br />
decoding process is unique for each key. This process provides yet<br />
another obstacle in the copying of the HASP memory contents<br />
from one key to another, as the HASP ID number cannot be<br />
copied. The memory of the “fake” HASP is decoded using an<br />
invalid encoding key, resulting in incorrect memory data.<br />
Perform a checksum to find out if your application has been<br />
tampered with.<br />
To perform a simple checksum:<br />
1. Calculate the checksum.<br />
2. Compare it with the correct value.<br />
3. If the two do not match, issue an error message. Otherwise<br />
continue.<br />
Unfortunately, this technique is vulnerable to several attacks.<br />
The code can be patched and the check bypassed.<br />
One can force the checksum to return the correct value.<br />
To do so, one must identify the checksum algorithm and use codepatch<br />
and breakpoint techniques to compensate for changed bytes.<br />
You can defend against this type of attack by avoiding simple<br />
modulo addition or performing a XOR operation. Use CRC (cyclic<br />
redundancy check) or another algorithm sensitive to byte ordering.<br />
138 © Aladdin Knowledge Systems, 2002
Using the HASP API Protection Strategies<br />
Another defense technique is to avoid comparing the result of the<br />
checksum with a previously calculated value. Instead, use the<br />
checksum result to perform an action that results in an error if the<br />
wrong value was calculated.<br />
For example, store the result in a variable and use that variable<br />
later on as a key to decode a certain code or data. This approach<br />
has the advantage of delayed reaction. In addition, the expected<br />
checksum value is not explicitly stored in the application.<br />
Use Program Functionality as Response to a Missing<br />
HASP Key<br />
Hide Passwords<br />
There are a range of possible responses you can include in your<br />
code when the correct HASP is not connected. The most simple<br />
of responses is to insert a “HASP not found” message. However,<br />
this implies that a HASP check was performed.<br />
Instead of issuing a “HASP not found” message, devise an<br />
interruption to the natural flow of your program if the correct<br />
HASP is not connected. For example, instruct the application to<br />
disable the keyboard if the correct HASP is not attached, and to<br />
resume normal operations if the key is later connected. Illegitimate<br />
users may think that the difficulty is caused by a bug in the<br />
program. They might not realize that a HASP check was<br />
performed and that the problem is due to the lack of a HASP key.<br />
Be sure to use program functionality in this way while taking into<br />
consideration the legitimate users who have mistakenly forgotten<br />
to connect the HASP.<br />
Hide passwords in the protected application by:<br />
Scramble them<br />
Saving them in different parts of the source code<br />
Comparing the different places where they are saved as a check<br />
for tampering<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 139
Protection Strategies Part 3 - Chapter 10<br />
Generate Noise<br />
Use HASP-Dependent Data<br />
Call the hasp( ) routine and pass it parameters that have irrelevant<br />
values. These values can be produced by random number<br />
generators, time values, intermediate results of calculations and<br />
more. Of course, these calls to the hasp( ) routine should not lead<br />
to any meaningful results and actions. Generating noise causes<br />
distractions and poses additional obstacles for anyone who tries to<br />
attack your protected application.<br />
When using data stored in the HASP memory, you typically check<br />
that the value is valid before proceeding. However, the checking<br />
process forces you to include the real value that is checked in your<br />
application. The value is then accessible to attacks.<br />
To prevent accessing this data, read it and use it in your application<br />
without explicitly checking its validity. If the HASP is connected,<br />
the value is valid. Otherwise, the value is invalid and results in an<br />
error.<br />
For example, instead of checking data read from the HASP<br />
memory, you can use it directly to go to a label and perform an<br />
operation as described in the following pseudo-code:<br />
Begin<br />
Global variable FLAG is assigned an initial<br />
value.<br />
Call the hasp( ) routine with the ReadWord<br />
service.<br />
FLAG is assigned the value of the data read<br />
from the HASP memory (100 in this example).<br />
Goto FLAG<br />
...<br />
...<br />
...<br />
Label 100:<br />
Perform an operation that is required for the<br />
correct program flow.<br />
140 © Aladdin Knowledge Systems, 2002
Using the HASP API Protection Strategies<br />
Use HASP Envelope<br />
Change Your Strategy<br />
In the above example, when the HASP is connected and the<br />
correct value of 100 is read from its memory, the program<br />
continues and performs its intended operation by going to label<br />
100. If the HASP is not connected, the program does not reach<br />
the designated label and does not perform the requested<br />
operation.<br />
This strategy prevents using an IF statement which translates to an<br />
Assembly CMP, and is therefore much more difficult to trace.<br />
HASP Envelope adds a protective shield around your application.<br />
Envelope protection offers file encoding and advanced antidebugging<br />
features which make attacks much more difficult.<br />
If you are protecting a series of executables, the HASP Envelope,<br />
with its Multi-Layer Envelope technology, implements a different<br />
protection scheme for every executable file. Varying protection<br />
schemes makes it much more difficult to understand and hack an<br />
application.<br />
To maintain a high level of software security, you should change<br />
your protection scheme often. Vary your methods, implementing<br />
different security measures for each version of your application.<br />
Upgrade your tools of defense regularly.<br />
Aladdin is committed to supplying you with the best protection<br />
technology available on the market, and continually enhances its<br />
product line. Check the Aladdin web site periodically for<br />
information about new features in the HASP protection system<br />
and contact your HASP representative for the latest updates on<br />
the HASP software developments.<br />
Stay in step with Aladdin and always keep one step ahead of<br />
anyone who tries to attack your software.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 141
Part 3 - Chapter 11<br />
Basic HASP Services<br />
This chapter describes the basic HASP API services which are<br />
applicable to <strong>HASP4</strong> Standard, <strong>HASP4</strong> M1 and <strong>HASP4</strong> M4. Each<br />
of the services are described in detail.<br />
Table 11.1 on page 144 lists the hasp( ) routine parameters for<br />
each service. Each service listed in the following table is assigned<br />
two rows:<br />
The call row, C, lists parameters you pass to the hasp( ) routine.<br />
The return row, R, lists parameters that the hasp( ) routine<br />
returns.<br />
The values of Par1, Par2, Par3, and Par4 change according to the<br />
service.<br />
All parameters are 16 bits in16-bit applications and 32 bits in 32bit<br />
applications.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 143
Basic HASP Services Part 3 - Chapter 11<br />
Table 11.1 Basic HASP Services and Parameters<br />
Service (no.)<br />
IsHasp (1) C<br />
R<br />
HaspStatus (5) C<br />
R<br />
HaspEncodeData (60) C<br />
R<br />
HaspDecodeData(61) C<br />
R<br />
Seed Code<br />
PortNum<br />
PortNum<br />
PortNum<br />
PortNum<br />
PortNum<br />
Password1<br />
Password1<br />
Password1<br />
Password1<br />
144 © Aladdin Knowledge Systems, 2002<br />
Password2<br />
Password2<br />
Password2<br />
Password2<br />
Par1<br />
HASP<br />
found<br />
Memory Size<br />
0<br />
0<br />
Par2<br />
Ports to<br />
search<br />
HASP Type<br />
Buffer<br />
Size<br />
Buffer<br />
Size<br />
Par3<br />
Status<br />
Actual<br />
PortNum<br />
Buffer<br />
Segment<br />
Status<br />
Buffer<br />
Segment<br />
Status<br />
Par4<br />
HASP Object<br />
Version<br />
Buffer<br />
Offset<br />
Buffer<br />
Offset
Using the HASP API Basic HASP Services<br />
The Buffer Segment parameter is only relevant for<br />
16-bit applications.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 145
Basic HASP Services Part 3 - Chapter 11<br />
Service 1: IsHasp<br />
Description Check if a HASP is connected to the computer.<br />
Relevant Keys <strong>HASP4</strong> Std., <strong>HASP4</strong> M1, <strong>HASP4</strong> M4, <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum,<br />
Password1,Password2,Par1, Par2, Par3,<br />
Par4)<br />
Service 1<br />
PortNum Value indicating the ports to search, see “Specifying<br />
the Port” on page 119.<br />
Par1<br />
0<br />
1<br />
A value indicating if a HASP key was found<br />
No HASP is connected to the computer.<br />
A HASP is connected to the computer<br />
Par 2 Value indicating the ports to search, see “Specifying<br />
the Port” on page 119.<br />
Par 3 A code indicating the status of the operation. See<br />
"HASP API Status Codes" on page 197.<br />
Comments Service 1, IsHasp, is a service used to check if any HASP is<br />
connected to your computer. Always use IsHasp in conjunction<br />
with other HASP API services. To verify that the correct HASP<br />
(with your developer code) is connected, use Service 61,<br />
HaspDecodeData. For a simple presence check, use Service 5,<br />
HaspStatus.<br />
146 © Aladdin Knowledge Systems, 2002
Using the HASP API Basic HASP Services<br />
Service 5: HaspStatus<br />
Description Check the type of HASP connected to the computer. Also check<br />
to which port the key is connected.<br />
Relevant Keys <strong>HASP4</strong> Std., <strong>HASP4</strong> M1, <strong>HASP4</strong> M4, <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum,<br />
Password1,Password2,Par1, Par2, Par3,<br />
Par4)<br />
Service 5<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 First HASP password.<br />
Password2 Second HASP password.<br />
Par1<br />
Par2<br />
1<br />
4<br />
0<br />
0<br />
1<br />
5<br />
Memory Size<br />
<strong>HASP4</strong> M1<br />
<strong>HASP4</strong> M4<br />
other keys<br />
HASP Type<br />
<strong>HASP4</strong> Std.<br />
<strong>HASP4</strong> M1 or <strong>HASP4</strong> M4<br />
<strong>HASP4</strong> <strong>Ti</strong>me<br />
Par 3 Actual port number, see “Specifying the<br />
Port” on page 119.<br />
Par4 HASP Object Version – The current API<br />
version.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 147
Basic HASP Services Part 3 - Chapter 11<br />
Comments To minimize search time, use the value of the Actual PortNum<br />
received in Par3, and pass it via the PortNum parameter in<br />
subsequent calls to the hasp( ) routine.<br />
If a <strong>HASP4</strong> Net key is connected to a local port, this service<br />
identifies it as <strong>HASP4</strong> M4. The memory size returned in Par1<br />
is 4, the HASP model returned in Par2 is 1.<br />
Older <strong>Ti</strong>meHASP-1 keys used to return 3 in Par2. Applications<br />
which use such keys should be updated to handle a status of 3<br />
or 5.<br />
148 © Aladdin Knowledge Systems, 2002
Using the HASP API Basic HASP Services<br />
Service 60: HaspEncodeData<br />
Description Encodes data via a connected HASP key.<br />
Relevant Keys <strong>HASP4</strong> Std., <strong>HASP4</strong> M1, <strong>HASP4</strong> M4, <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum,<br />
Password1,Password2,Par1, Par2, Par3,<br />
Par4)<br />
Service 60<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 First HASP password.<br />
Password2 Second HASP password.<br />
Par1 0 (reserved).<br />
Par2 Buffer size. The size in bytes of the buffer to be<br />
encoded. The buffer must be at least 8 bytes in size.<br />
Par3 Buffer segment. The segment adress of the buffer.<br />
Only relevant for 16-bit applications.<br />
Par4 Buffer offset. The offset address of the buffer.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Comments The contents of the program buffer are encoded via the connected<br />
HASP and updated in place.<br />
This service can only be used with the <strong>HASP4</strong> generation of<br />
HASP keys. If a key prior to the <strong>HASP4</strong> generation is attached, no<br />
data will be encoded and the service will return an error code.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 149
Basic HASP Services Part 3 - Chapter 11<br />
Service 61: HaspDecodeData<br />
Description Decodes data via a connected HASP key.<br />
Relevant Keys <strong>HASP4</strong> Std., <strong>HASP4</strong> M1, <strong>HASP4</strong> M4, <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum,<br />
Password1,Password2,Par1, Par2, Par3,<br />
Par4)<br />
Service 61<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 First HASP password.<br />
Password2 Second HASP password.<br />
Par1 0 (reserved).<br />
Par2 Buffer size. The size in bytes of the buffer to be<br />
decoded. The buffer must be at least 8 bytes in size.<br />
Par3 Buffer segment. The segment adress of the buffer.<br />
Only relevant for 16-bit applications.<br />
Par4 Buffer offset. The offset address of the buffer.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Comments The contents of the program buffer are decoded via the connected<br />
HASP and updated in place.<br />
This service can only be used with the <strong>HASP4</strong> generation of<br />
HASP keys. If a key prior to the <strong>HASP4</strong> generation is attached, no<br />
data will be decoded and the service will return an error code.<br />
150 © Aladdin Knowledge Systems, 2002
Part 3 - Chapter 12<br />
<strong>HASP4</strong> Memory<br />
Services<br />
This chapter describes the HASP API services for <strong>HASP4</strong> M1,<br />
<strong>HASP4</strong> M4, and <strong>HASP4</strong> <strong>Ti</strong>me. Each of the services are described<br />
in detail.<br />
Table 12.1 on page 152 lists the hasp( ) routine parameters for<br />
each service. Each service listed in the following table is assigned<br />
two rows:<br />
The call row, C, lists parameters you pass to the hasp( ) routine.<br />
The return row, R, lists parameters that the hasp( ) routine<br />
returns.<br />
The values of Par1, Par2, Par3, and Par4 change according to the<br />
service.<br />
All parameters are 16 bits in16-bit applications and 32 bits in 32bit<br />
applications.<br />
!<br />
Due to the fact that Macintosh machines operate in Big<br />
Endian and Intel machines in Little Endian, the values<br />
of ReadWord and WriteWord are byte-swapped on<br />
Macintosh in relation to Intel.<br />
Consider this fact when you read and write to a HASP<br />
key with these services, or use the services ReadBlock<br />
and WriteBlock which operate endian independently.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 151
<strong>HASP4</strong> Memory Services Part 3 - Chapter 12<br />
Table 12.1 <strong>HASP4</strong> Memory Services and Parameter<br />
Service (no.)<br />
ReadWord (3) C<br />
R<br />
WriteWord (4) C<br />
R<br />
HaspID (6) C<br />
R<br />
ReadBlock (50) C<br />
R<br />
Seed Code<br />
PortNum<br />
PortNum<br />
PortNum<br />
PortNum<br />
PortNum<br />
Password1<br />
Password1<br />
Password1<br />
Password1<br />
Password1<br />
152 © Aladdin Knowledge Systems, 2002<br />
Password2<br />
Password2<br />
Password2<br />
Password2<br />
Password2<br />
Par1<br />
Address<br />
Address<br />
IDLow<br />
Start<br />
Address<br />
Par2<br />
Data<br />
Data<br />
IDHigh<br />
Block<br />
Length<br />
Par3<br />
Status<br />
Status<br />
Status<br />
Buffer<br />
Segment<br />
Status<br />
Par4<br />
Buffer<br />
Offset
Using the HASP API <strong>HASP4</strong> Memory Services<br />
Service (no.)<br />
WriteBlock (51) C<br />
Seed Code<br />
PortNum<br />
PortNum<br />
Password1<br />
Password1<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 153<br />
Password2<br />
Password2<br />
Par1<br />
Start<br />
Address<br />
Par2<br />
Block<br />
Length<br />
Par3<br />
Buffer<br />
Segment<br />
Status<br />
The Buffer Segment parameter is only relevant for<br />
16-bit applications.<br />
Par4<br />
Buffer<br />
Offset
<strong>HASP4</strong> Memory Services Part 3 - Chapter 12<br />
Service 3: ReadWord<br />
Description Read one word of data from the HASP memory.<br />
Relevant Keys <strong>HASP4</strong> M1, <strong>HASP4</strong> M4, <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 3<br />
PortNum Value indicating the ports to search, see “Specifying<br />
the Port” on page 119.<br />
Password1 First HASP password.<br />
Password2 Second HASP password.<br />
Par1 Address – The HASP memory address you want to<br />
read from:<br />
0 to 55 – <strong>HASP4</strong> M1<br />
0 to 247 – <strong>HASP4</strong> M4<br />
0 to 247 – <strong>HASP4</strong> <strong>Ti</strong>me<br />
Par2 Data – One word of data read from HASP memory.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
154 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> Memory Services<br />
Service 4: WriteWord<br />
Description Write one word of data to the HASP memory.<br />
Relevant Keys <strong>HASP4</strong> M1, <strong>HASP4</strong> M4, <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 4<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 First HASP password.<br />
Password2 Second HASP password.<br />
Par1 Address – The HASP memory address you want to<br />
write to:<br />
0 to 55 – <strong>HASP4</strong> M1<br />
0 to 247 – <strong>HASP4</strong> M4<br />
0 to 247 – <strong>HASP4</strong> <strong>Ti</strong>me<br />
Par2 Data – One word of data.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 155
<strong>HASP4</strong> Memory Services Part 3 - Chapter 12<br />
Service 6: HaspID<br />
Description Determine the HASP ID number.<br />
Relevant Keys <strong>HASP4</strong> M1, <strong>HASP4</strong> M4, <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 6<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 First HASP password.<br />
Password2 Second HASP password.<br />
Par1 IDLow – Low (least significant) word of the ID<br />
number.<br />
Par2 IDHigh – High (most significant) word of the ID<br />
number.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Comments The ID number is a long integer (32 bits). You calculate it as<br />
follows, if IDLow and IDHigh are unsigned.<br />
ID number = IDLow + 65536 * IDHigh<br />
If IDLow and IDHigh are signed, you need to compensate a<br />
negative value by adding 65535.<br />
156 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> Memory Services<br />
Service 50: ReadBlock<br />
Description Read one block of data from the HASP memory.<br />
Relevant Keys <strong>HASP4</strong> M1, <strong>HASP4</strong> M4, <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 50<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 First HASP password.<br />
Password2 Second HASP password.<br />
Par1 Start Address – Defines the initial HASP memory<br />
address for reading the block:<br />
0 to 55 – <strong>HASP4</strong> M1<br />
0 to 247 – <strong>HASP4</strong> M4<br />
0 to 247 – <strong>HASP4</strong> <strong>Ti</strong>me<br />
Par2 Block Length – The block size, in words.<br />
Par3 Buffer Segment – The segment address of the buffer.<br />
Only relevant for 16-bit applications.<br />
Par4 Buffer Offset – Offset address of a program buffer<br />
(variable). The buffer size must be at least as large as<br />
the block size.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Result The HASP memory content is read into the program buffer.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 157
<strong>HASP4</strong> Memory Services Part 3 - Chapter 12<br />
Service 51: WriteBlock<br />
Description Write one block of data to the HASP memory.<br />
Relevant Keys <strong>HASP4</strong> M1, <strong>HASP4</strong> M4, <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 51<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 The first HASP password.<br />
Password2 The second HASP password.<br />
Par1 Start Address – Defines the initial HASP memory<br />
address for writing the block:<br />
0 to 55 – <strong>HASP4</strong> M1<br />
0 to 247 – <strong>HASP4</strong> M4<br />
0 to 247 – <strong>HASP4</strong> <strong>Ti</strong>me<br />
Par2 Block Length – The block size, in words.<br />
Par3 Buffer Segment – The segment dress of the buffer.<br />
Only relevant for 16-bit applications.<br />
Par4 Buffer Offset – Offset address of a program buffer<br />
(variable). The buffer size must be at least as large as<br />
the block size.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Comments The contents of the program buffer are written to the HASP<br />
memory.<br />
158 © Aladdin Knowledge Systems, 2002
Part 3 - Chapter 13<br />
<strong>HASP4</strong> <strong>Ti</strong>me Services<br />
This chapter describes the HASP API services which are<br />
applicable to <strong>HASP4</strong> <strong>Ti</strong>me. Each of the services are described in<br />
detail.<br />
The <strong>HASP4</strong> <strong>Ti</strong>me battery has a lifetime of 3 – 5 years. When<br />
implementing the API with <strong>HASP4</strong> <strong>Ti</strong>me, it is recommended that<br />
you incorporate calls which check that the clock is advancing and<br />
act accordingly when it stops.<br />
Table 13.1 on page 160 lists the hasp( ) routine parameters for<br />
each service. Each service listed in the following table is assigned<br />
two rows:<br />
The call row, C, lists parameters you pass to the hasp( ) routine.<br />
The return row, R, lists parameters that the hasp( ) routine<br />
returns.<br />
The values of Par1, Par2, Par3, and Par4 change according to the<br />
service.<br />
All parameters are 16 bits in16-bit applications and 32 bits in 32bit<br />
applications.<br />
!<br />
Due to the fact that Macintosh machines operate in Big<br />
Endian and Intel machines in Little Endian, the values<br />
of ReadWord and WriteWord are byte-swapped on<br />
Macintosh in relation to Intel.<br />
Consider this fact when you read and write to a HASP<br />
key with these services, or use the services ReadBlock<br />
and WriteBlock which operate endian independently.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 159
<strong>HASP4</strong> <strong>Ti</strong>me Services Part 3 - Chapter 13<br />
Table 13.1 <strong>HASP4</strong> <strong>Ti</strong>me Services and Parameters<br />
Service (no.)<br />
Set<strong>Ti</strong>me (70) C<br />
R<br />
Get<strong>Ti</strong>me (71) C<br />
R<br />
SetDate (72) C<br />
R<br />
GetDate (73) C<br />
R<br />
WriteByte (74) C<br />
Seed Code<br />
PortNum<br />
PortNum<br />
PortNum<br />
PortNum<br />
PortNum<br />
PortNum<br />
Password1<br />
Password1<br />
Password1<br />
Password1<br />
Password1<br />
Password1<br />
160 © Aladdin Knowledge Systems, 2002<br />
Password2<br />
Password2<br />
Password2<br />
Password2<br />
Password2<br />
Password2<br />
Par1<br />
Second<br />
Second<br />
Day<br />
Day<br />
Address<br />
Par2<br />
Minute<br />
Minute<br />
Month<br />
Month<br />
Data<br />
Par3<br />
Status<br />
Status<br />
Status<br />
Status<br />
Par4<br />
Hour<br />
Hour<br />
Year<br />
Year
Using the HASP API <strong>HASP4</strong> <strong>Ti</strong>me Services<br />
Service (no.)<br />
R<br />
ReadByte (75) C<br />
WriteBlock (76)<br />
R<br />
ReadBlock (77) C<br />
R<br />
HaspID (78) C<br />
R<br />
Seed Code<br />
PortNum<br />
PortNum<br />
PortNum<br />
PortNum<br />
PortNum<br />
Password1<br />
Password1<br />
Password1<br />
Password1<br />
Password1<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 161<br />
Password2<br />
Password2<br />
Password2<br />
Password2<br />
Password2<br />
Par1<br />
Address<br />
Start<br />
Address<br />
Start<br />
Address<br />
IDLow<br />
Par2<br />
Data<br />
Block<br />
Length<br />
Block<br />
Length<br />
IDHigh<br />
Par3<br />
Status<br />
Status<br />
Buffer<br />
Segment<br />
Status<br />
Buffer<br />
Segment<br />
Status<br />
Status<br />
The Buffer Segment parameter is only relevant for<br />
16-bit applications.<br />
Par4<br />
Buffer<br />
Offset<br />
Buffer<br />
Offset
<strong>HASP4</strong> <strong>Ti</strong>me Services Part 3 - Chapter 13<br />
Service 70: Set<strong>Ti</strong>me<br />
Description Set the time on the <strong>HASP4</strong> <strong>Ti</strong>me real-time clock.<br />
Relevant Keys <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum,Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 70<br />
PortNum Value indicating the port to search for the HASP key.<br />
Password1 First <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Password2 Second <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Par1 Second – Seconds portion of the time you want to set<br />
(00 to 59).<br />
Par2 Minute – Minutes portion of the time you want to set<br />
(00 to 59).<br />
Par4 Hour – Hour portion of the time you want to set (00<br />
to 23).<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
162 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> <strong>Ti</strong>me Services<br />
Service 71: Get<strong>Ti</strong>me<br />
Description Get the time from the <strong>HASP4</strong> <strong>Ti</strong>me real-time clock.<br />
Relevant Keys <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum,Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 71<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 First <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Password2 Second <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Par1 Second – Seconds read from the <strong>HASP4</strong> <strong>Ti</strong>me clock.<br />
Par2 Minute – Minutes read from the <strong>HASP4</strong> <strong>Ti</strong>me clock.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 163
<strong>HASP4</strong> <strong>Ti</strong>me Services Part 3 - Chapter 13<br />
Service 72: SetDate<br />
Description Set the date on the <strong>HASP4</strong> <strong>Ti</strong>me real-time clock.<br />
Relevant Keys <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum,Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 72<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 First <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Password2 Second <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Par1 Day – Day to set on the <strong>HASP4</strong> <strong>Ti</strong>me clock (1 to 31).<br />
Par2 Month – Month to set on the <strong>HASP4</strong> <strong>Ti</strong>me clock (1<br />
to 12).<br />
Par4 Year – Year to set on the <strong>HASP4</strong> <strong>Ti</strong>me clock (0 to<br />
99).<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Comments Year ranges from 0 to 99, where 92 to 99 refer to 1992-1999, and<br />
00 to 91 refer to 2000-2091.<br />
164 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> <strong>Ti</strong>me Services<br />
Service 73: GetDate<br />
Description Get the date from the <strong>HASP4</strong> <strong>Ti</strong>me real-time clock.<br />
Relevant Keys <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum,Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 73<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 First <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Password2 Second <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Par1 Day – Day read from the <strong>HASP4</strong> <strong>Ti</strong>me clock (1 to<br />
31).<br />
Par2 Month – Month read from the <strong>HASP4</strong> <strong>Ti</strong>me clock<br />
(1 to 12).<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Par4 Year – Year read from the <strong>HASP4</strong> <strong>Ti</strong>me clock (0 to<br />
99).<br />
Comments Year ranges from 0 to 99, where 92 to 99 refer to 1992-1999, and<br />
00 to 91 refer to 2000-2091.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 165
<strong>HASP4</strong> <strong>Ti</strong>me Services Part 3 - Chapter 13<br />
Service 74: WriteByte<br />
Description Write one byte of data to the <strong>HASP4</strong> <strong>Ti</strong>me memory.<br />
Relevant Keys <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum,Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 74<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 First <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Password2 Second <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Par1 Address – The <strong>HASP4</strong> <strong>Ti</strong>me memory address to<br />
which you want to write (0 to 15).<br />
Par2 Data – One byte of data.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Comments This service writes to the 16-byte memory of a <strong>HASP4</strong> <strong>Ti</strong>me. To<br />
write to the 248-word memory of a <strong>HASP4</strong> <strong>Ti</strong>me, use Service 4<br />
(page 155).<br />
166 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> <strong>Ti</strong>me Services<br />
Service 75: ReadByte<br />
Description Read one byte of data from the <strong>HASP4</strong> <strong>Ti</strong>me memory.<br />
Relevant Keys <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum,Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 75<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 First <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Password2 Second <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Par1 Address – The <strong>HASP4</strong> <strong>Ti</strong>me memory address to<br />
which you want to read (0 to 15).<br />
Par2 Data – One byte of data read from the <strong>HASP4</strong> <strong>Ti</strong>me<br />
memory.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Comments This service reads from the 16-byte memory of a <strong>HASP4</strong> <strong>Ti</strong>me. To<br />
read from the 248-word memory of a <strong>HASP4</strong> <strong>Ti</strong>me, use Service 3<br />
(page 154).<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 167
<strong>HASP4</strong> <strong>Ti</strong>me Services Part 3 - Chapter 13<br />
Service 76: WriteBlock<br />
Description Write one block of data to the <strong>HASP4</strong> <strong>Ti</strong>me memory.<br />
Relevant Keys <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum,Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 76<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 First <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Password2 Second <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Par1 Start Address – Defines the initial <strong>HASP4</strong> <strong>Ti</strong>me<br />
memory address for writing the block (0 to 15).<br />
Par2 Block Length – Size, in bytes, of the data block (the<br />
maximum is 16).<br />
Par3 Buffer Segment – The segment address of the buffer.<br />
Only relevant for 16-bit applications.<br />
Par4 Buffer Offset – Offset address of a program buffer<br />
(variable). The buffer size must be at least as large as<br />
the block size.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Comments This service writes a block to the 16-byte memory of a<br />
<strong>HASP4</strong> <strong>Ti</strong>me. To write a block to the 248-word memory, use<br />
Service 51 (page 158).<br />
168 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> <strong>Ti</strong>me Services<br />
Service 77: ReadBlock<br />
Description Read one block of data from the <strong>HASP4</strong> <strong>Ti</strong>me memory.<br />
Relevant Keys <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum,Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 77<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 First <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Password2 Second <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Par1 Start Address – Defines the initial <strong>HASP4</strong> <strong>Ti</strong>me<br />
memory address for reading the block (0 to 15).<br />
Par2 Block Length – The size, in bytes, of the data block<br />
(maximum 16).<br />
Par3 Buffer Segment – The segment address of the buffer.<br />
Only relevant for 16-bit applications.<br />
Par4 Buffer Offset – Offset address of a program buffer<br />
(variable). The buffer size must be at least as large as<br />
the block size.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Comments This service reads a block from the 16-byte memory of a<br />
<strong>HASP4</strong> <strong>Ti</strong>me. To read a block from the 248-word memory of a<br />
<strong>HASP4</strong> <strong>Ti</strong>me, use Service 50 (page 157).<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 169
<strong>HASP4</strong> <strong>Ti</strong>me Services Part 3 - Chapter 13<br />
Service 78: HaspID<br />
Description Determine the <strong>HASP4</strong> <strong>Ti</strong>me ID number.<br />
Relevant Keys <strong>HASP4</strong> <strong>Ti</strong>me<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, PortNum,<br />
Password1,Password2,Par1, Par2, Par3,<br />
Par4)<br />
Service 78<br />
PortNum Value indicating the port to search for the HASP.<br />
Password1 First <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Password2 Second <strong>HASP4</strong> <strong>Ti</strong>me password.<br />
Par1 IDLow – Low (least significant) word of the ID<br />
number.<br />
Par2 IDHigh – High (most significant) word of the ID<br />
number.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Comments The ID number is a long integer (32 bits). You calculate it as<br />
follows, if IDLow and IDHigh are unsigned.<br />
ID number = IDLow + 65536 * IDHigh<br />
If IDLow and IDHigh are signed, you need to compensate a<br />
negative value by adding 65535.<br />
170 © Aladdin Knowledge Systems, 2002
Part 3 - Chapter 14<br />
<strong>HASP4</strong> Net Services<br />
This chapter describes the HASP API services for <strong>HASP4</strong> Net.<br />
Each of the services are described in detail.<br />
Table 14.1 "<strong>HASP4</strong> Net Services and Parameters" on page 173<br />
lists the hasp( ) routine parameters for each service. Each service<br />
listed in the following table is assigned two rows:<br />
The call row, C, lists parameters you pass to the hasp( ) routine.<br />
The return row, R, lists parameters that the hasp( ) routine<br />
returns.<br />
The values of Par1, Par2, Par3, and Par4 change according to the<br />
service.<br />
All parameters are 16 bits in 16-bit applications and 32 bits in 32bit<br />
applications.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 171
<strong>HASP4</strong> Net Services Part 3 - Chapter 14<br />
Using <strong>HASP4</strong> Net Services<br />
The <strong>HASP4</strong> Net API requires that some services be called in<br />
sequence, as described below:<br />
1. Optionally, call the hasp( ) routine with the SetConfigFilename<br />
and then with the LastStatus service.<br />
2. Optionally, call the hasp( ) routine with the SetServerByName<br />
and then with the LastStatus service.<br />
3. Call the hasp( ) routine with the Login service and then with the<br />
LastStatus service.<br />
4. Once you call the Login service, you are free to call any <strong>HASP4</strong><br />
Net service. After each call to a service, call the hasp( ) routine<br />
with the LastStatus service.<br />
5. Call the hasp( ) routine with the Logout service and then with<br />
the LastStatus service.<br />
!<br />
Under the TCP/IP protocol, a Windows 16-bit<br />
application calling the hasp( ) routine automatically<br />
gains control while the routine is being processed.<br />
Control is gained through the application message loop<br />
rather than through the instruction following the<br />
hasp( ) routine call.<br />
Do not call the hasp( ) routine again until control is<br />
gained through the instruction following the call. If you<br />
do, your application crashes. To avoid this situation, use<br />
flags to prevent new calls to the hasp( ) routine while<br />
the previous call is being processed.<br />
172 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> Net Services<br />
Table 14.1 <strong>HASP4</strong> Net Services and Parameters<br />
Service (No.)<br />
LastStatus (40) C<br />
R<br />
Login (42) C<br />
R<br />
Logout (43) C<br />
R<br />
ReadWord (44) C<br />
R<br />
WriteWord (45) C<br />
R<br />
Seed Code<br />
Seed Code<br />
PortNum<br />
ProgNum<br />
ProgNum<br />
ProgNum<br />
ProgNum<br />
Password1<br />
Password1<br />
Password1<br />
Password1<br />
Password1<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 173<br />
Password2<br />
Password2<br />
Password2<br />
Password2<br />
Password2<br />
Par1<br />
Net<br />
Status<br />
Address<br />
Address<br />
Par2<br />
System<br />
Error<br />
Data<br />
Data<br />
Par3<br />
Warning<br />
Code<br />
Status<br />
Status<br />
Par4
<strong>HASP4</strong> Net Services Part 3 - Chapter 14<br />
Service (No.)<br />
HaspID (46) C<br />
R<br />
Idle<strong>Ti</strong>me (48) C<br />
R<br />
ReadBlock (52) C<br />
R<br />
WriteBlock (53) C<br />
SetConfigFilename<br />
(85)<br />
R<br />
C<br />
R<br />
Seed Code<br />
Idle <strong>Ti</strong>me<br />
PortNum<br />
ProgNum<br />
ProgNum<br />
ProgNum<br />
ProgNum<br />
Password1<br />
Password1<br />
Password1<br />
Password1<br />
Password1<br />
174 © Aladdin Knowledge Systems, 2002<br />
Password2<br />
Password2<br />
Password2<br />
Password2<br />
Password2<br />
Par1<br />
IDLow<br />
Start<br />
Address<br />
Start<br />
Address<br />
Par2<br />
IDHigh<br />
Block<br />
Length<br />
Block Length<br />
Buffer<br />
Size<br />
Par3<br />
Status<br />
(Buffer<br />
Segment)<br />
Status<br />
(Buffer<br />
Segment)<br />
Status<br />
(Buffer<br />
Segment)<br />
Par4<br />
Buffer<br />
Offset<br />
Buffer<br />
Offset<br />
Buffer<br />
Offset
Using the HASP API <strong>HASP4</strong> Net Services<br />
Service (No.)<br />
HaspEncodeData(88) C<br />
R<br />
HaspEncodeData(89) C<br />
R<br />
SetServerByName (96) C<br />
HaspQueryLicense<br />
(104)<br />
R<br />
C<br />
R<br />
Seed Code<br />
PortNum<br />
ProgNum<br />
ProgNum<br />
ProgNum<br />
Password1<br />
Password1<br />
Password1<br />
Password1<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 175<br />
Password2<br />
Password2<br />
Password2<br />
Password2<br />
Par1<br />
Active<br />
Licenses<br />
Par2<br />
Buffer<br />
Size<br />
Buffer<br />
Size<br />
Buffer<br />
Size<br />
Max.<br />
Licenses<br />
Par3<br />
(Buffer<br />
Segment)<br />
Status<br />
(Buffer<br />
Segment)<br />
Status<br />
(Buffer<br />
Segment)<br />
Key Type<br />
The Buffer Segment parameter is only relevant for<br />
16-bit applications.<br />
Par4<br />
Buffer<br />
Offset<br />
Buffer<br />
Offset<br />
Buffer<br />
Offset<br />
Activations<br />
remaining
<strong>HASP4</strong> Net Services Part 3 - Chapter 14<br />
Service 40: LastStatus<br />
Description Check the status of the previous call to the hasp( ) routine. Call<br />
hasp( ) with the LastStatus service after each call with one of the<br />
<strong>HASP4</strong> Net services.<br />
Relevant Keys <strong>HASP4</strong> Net<br />
Syntax<br />
Parameters<br />
Used<br />
Return Values<br />
hasp (Service, SeedCode, ProgNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 40<br />
Par1 Net Status – A code indicating the status of the<br />
previous call to the hasp( ) routine. If the last call was<br />
successful, 0 is returned.<br />
If not an error code is returned. See Table 15.3<br />
"<strong>HASP4</strong> Net Status Codes" on page 200.<br />
Par2 System Error – A context-dependent error code. For<br />
example:<br />
A NetBIOS communication error returns the<br />
specific NetBIOS error code.<br />
A <strong>HASP4</strong> Net configuration file error returns the<br />
configuration file line number where the error<br />
occurred<br />
Par3 Warning – A warning code. See Table 15.4 "<strong>HASP4</strong><br />
Net Warning Codes" on page 204<br />
Comments If an error occurs, your application should display Net Status,<br />
System Error and Warning.<br />
176 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> Net Services<br />
Service 42: Login<br />
Description Perform a <strong>HASP4</strong> Net login. The protected application accesses<br />
the HASP License Manager with a request for a license.<br />
Relevant Keys <strong>HASP4</strong> Net<br />
Syntax<br />
Parameters<br />
Used<br />
hasp (Service, SeedCode, ProgNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 42<br />
ProgNum The number assigned to the application in <strong>HASP4</strong><br />
Net memory, using the HASP Edit utility. See<br />
"Accessing Keys with HASP Edit" on page 73.<br />
Password1 First <strong>HASP4</strong> Net password.<br />
Password2 Second <strong>HASP4</strong> Net password.<br />
Return Values Use Service 40: LastStatus (page 176) to check if the call has been<br />
performed successfully.<br />
Comments For a description of the login process, see "How Does<br />
<strong>HASP4</strong> Net Work?" on page 210.<br />
With the exception of SetConfigFilename, SetServerByName, and<br />
LastStatus, call login before any other service.<br />
If you call the hasp( ) routine with the login service more than<br />
once from the same station, the HASP License Manager does not<br />
add the station and application to the log table a second time. In<br />
other words, the HASP License Manager does not grant an<br />
additional license to the application.<br />
When you re-activate a protected application after a computer<br />
crash, the application is already listed in the log table and the<br />
HASP License Manager does not grant the application an<br />
additional license.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 177
<strong>HASP4</strong> Net Services Part 3 - Chapter 14<br />
Multiple Win32 processes under Windows NT or Windows 95/<br />
98/ME take only one license when a single protocol is used, or<br />
when NetBIOS and IPX are used in combination. However, such<br />
processes under these operating systems take two licenses if TCP/<br />
IP is used together with NetBIOS and/or IPX.<br />
178 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> Net Services<br />
Service 43: Logout<br />
Description Perform a <strong>HASP4</strong> Net logout. When you call hasp( ) with the<br />
logout service, the HASP License Manager deletes the station and<br />
application from the <strong>HASP4</strong> Net log table. As a result, a license is<br />
freed.<br />
Relevant Keys <strong>HASP4</strong> Net<br />
Syntax<br />
Parameters<br />
Used<br />
hasp (Service, SeedCode, ProgNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 43<br />
ProgNum The number assigned to the application in <strong>HASP4</strong><br />
Net memory, using the HASP Edit utility. See<br />
"Accessing Keys with HASP Edit" on page 73.<br />
Password1 First <strong>HASP4</strong> Net password.<br />
Password2 Second <strong>HASP4</strong> Net password.<br />
Return Values Use Service 40: LastStatus (page 176) to check if the call has been<br />
performed successfully.<br />
Comments The logout behavior is as follows:<br />
Win 32 applications require one logout for every login.<br />
Mac applications require only one logout irrespective of the<br />
number of logins.<br />
If you do not perform a <strong>HASP4</strong> Net logout, the station and<br />
application remain listed in the <strong>HASP4</strong> Net log table. In this case<br />
the behavior is as follows:<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 179
<strong>HASP4</strong> Net Services Part 3 - Chapter 14<br />
The number of stations running the application at the same<br />
time remains unchanged and a license is not freed. If you have<br />
licensed a protected application to run on n stations, and n<br />
stations have performed a <strong>HASP4</strong> Net login, no other station<br />
can run the application until one of these n stations performs a<br />
<strong>HASP4</strong> Net logout.<br />
If the same station re-activates the application, the application<br />
runs using the license that is already granted.<br />
When the number of stations running a protected application<br />
has reached its maximum and there is an attempt to activate the<br />
application from another station, the HASP License Manager<br />
searches the log table for an idle station. If it finds one, the<br />
HASP License Manager deletes the idle station from the HASP<br />
log table. As a result, a license is freed and immediately granted<br />
to the application that issued the request. The default idle time<br />
is 36 hours. You can change the idle time using Service 48:<br />
Idle<strong>Ti</strong>me (page 184).<br />
180 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> Net Services<br />
Service 44: ReadWord<br />
Description Read one word of data from the <strong>HASP4</strong> Net memory.<br />
Relevant Keys <strong>HASP4</strong> Net<br />
Syntax<br />
Parameters<br />
Used<br />
hasp (Service, SeedCode, ProgNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 44<br />
ProgNum The number assigned to the application in <strong>HASP4</strong><br />
Net memory, using the HASP Edit utility. See<br />
"Accessing Keys with HASP Edit" on page 73.<br />
Password1 First <strong>HASP4</strong> Net password.<br />
Password2 Second <strong>HASP4</strong> Net password.<br />
Par1 Address – The <strong>HASP4</strong> Net memory address you<br />
want to read from (0 to 247).<br />
Return Values Use Service 40: LastStatus (page 176) to check if the call has been<br />
performed successfully.<br />
Par2 Data – Data read from the <strong>HASP4</strong> Net memory.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 181
<strong>HASP4</strong> Net Services Part 3 - Chapter 14<br />
Service 45: WriteWord<br />
Description Write one word of data to the <strong>HASP4</strong> Net memory.<br />
Relevant Keys <strong>HASP4</strong> Net<br />
Syntax<br />
Parameters<br />
Used<br />
hasp (Service, SeedCode, ProgNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 45<br />
ProgNum The number assigned to the application in <strong>HASP4</strong><br />
Net memory, using the HASP Edit utility. See<br />
"Accessing Keys with HASP Edit" on page 73.<br />
Password1 First <strong>HASP4</strong> Net password.<br />
Password2 Second <strong>HASP4</strong> Net password.<br />
Par1 Address – The <strong>HASP4</strong> Net memory address you<br />
want to write to (0 to 247).<br />
Par2 Data – One word of data.<br />
Return Values Use Service 40: LastStatus (page 176) to check if the call has been<br />
performed successfully.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Comments Word offsets 24 and higher in the <strong>HASP4</strong> Net memory are<br />
reserved for the <strong>HASP4</strong> Net Program List. If you write to any of<br />
these offsets, you may overwrite application protection parameters<br />
that you have previously saved in this memory area.<br />
182 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> Net Services<br />
Service 46: HaspID<br />
Description Determine the <strong>HASP4</strong> Net ID number.<br />
Relevant Keys <strong>HASP4</strong> Net<br />
Syntax<br />
Parameters<br />
Used<br />
hasp (Service, SeedCode, ProgNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 46<br />
ProgNum The number assigned to the application in <strong>HASP4</strong><br />
Net memory, using the HASP Edit utility. See<br />
"Accessing Keys with HASP Edit" on page 73.<br />
Password1 First <strong>HASP4</strong> Net password.<br />
Password2 Second <strong>HASP4</strong> Net password.<br />
Return Values Use Service 40: LastStatus (page 176) to check if the call has been<br />
performed successfully.<br />
Par1 IDLow – Low (least significant) word of the ID<br />
number.<br />
Par2 IDHigh – High (most significant) word of the ID<br />
number.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Comments The ID number is a long integer (32 bits). You calculate it as<br />
follows, if IDLow and IDHigh are unsigned.<br />
ID number = IDLow + 65536 * IDHigh<br />
If IDLow and IDHigh are signed, you need to compensate a<br />
negative value by adding 65535.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 183
<strong>HASP4</strong> Net Services Part 3 - Chapter 14<br />
Service 48: Idle<strong>Ti</strong>me<br />
Description Controls the stations that no longer use a protected application.<br />
With Idle<strong>Ti</strong>me, you specify a time frame. If the station using the<br />
protected application does not access the <strong>HASP4</strong> Net within this<br />
time frame, the HASP License Manager regards the station as idle.<br />
Relevant Keys <strong>HASP4</strong> Net<br />
Syntax<br />
Parameters<br />
Used<br />
hasp (Service, SeedCode, ProgNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 48<br />
Idle<strong>Ti</strong>me The time frame in minutes (0 to 65535).<br />
A station which does not access the key within this<br />
time frame is considered idle.<br />
ProgNum The number assigned to the application in <strong>HASP4</strong><br />
Net memory, using the HASP Edit utility. See<br />
"Accessing Keys with HASP Edit" on page 73.<br />
Password1 First <strong>HASP4</strong> Net password.<br />
Password2 Second <strong>HASP4</strong> Net password.<br />
Return Values Use Service 40: LastStatus (page 176) to check if the call has been<br />
performed successfully.<br />
Comments When the number of stations running a protected application has<br />
reached its maximum and there is an attempt to activate the<br />
application from another station, the HASP License Manager<br />
searches the log table for an idle station. If it finds one, the HASP<br />
License Manager deletes the idle station from the HASP log table.<br />
As a result, a license is freed and immediately granted to the<br />
application that issued the request.<br />
184 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> Net Services<br />
The protected application, running on the station that was deleted<br />
from the log table, returns an error code (error 135 or 139) the<br />
next time it tries to access the <strong>HASP4</strong> Net.<br />
When a station accesses the <strong>HASP4</strong> Net during the idle time<br />
frame, the idle time counter resets to zero.<br />
To implement Idle<strong>Ti</strong>me, call the hasp( ) routine with the Idle<strong>Ti</strong>me<br />
service after the Login service. If you do not set the idle time, the<br />
HASP License Manager uses a default timeframe of 36 hours.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 185
<strong>HASP4</strong> Net Services Part 3 - Chapter 14<br />
Service 52: ReadBlock<br />
Description Read one block of data from the <strong>HASP4</strong> Net memory into the<br />
program buffer.<br />
Relevant Keys <strong>HASP4</strong> Net<br />
Syntax<br />
Parameters<br />
Used<br />
hasp (Service, SeedCode, ProgNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 52<br />
ProgNum The number assigned to the application in <strong>HASP4</strong><br />
Net memory, using the HASP Edit utility. See<br />
"Accessing Keys with HASP Edit" on page 73.<br />
Password1 First <strong>HASP4</strong> Net password.<br />
Password2 Second <strong>HASP4</strong> Net password.<br />
Par1 Start Address – Defines the initial <strong>HASP4</strong> Net<br />
memory address for reading the block (0 to 247).<br />
Par2 Block Size – Data block size in words (maximum 24<br />
words).<br />
Par3 Buffer Segment – Segment address of a program<br />
buffer (variable). Only relevant for 16-bit<br />
applications.<br />
Par4 Buffer Offset – Offset address of a program buffer<br />
(variable). The buffer size must be at least as large as<br />
the block size.<br />
186 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> Net Services<br />
Return Values Use Service 40: LastStatus (page 176) to check if the call has been<br />
performed successfully.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 187
<strong>HASP4</strong> Net Services Part 3 - Chapter 14<br />
Service 53: WriteBlock<br />
Description Write one block of data from the program buffer to the <strong>HASP4</strong><br />
Net memory.<br />
Relevant Keys <strong>HASP4</strong> Net<br />
Syntax<br />
Parameters<br />
Used<br />
hasp (Service, SeedCode, ProgNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 53<br />
ProgNum The number assigned to the application in <strong>HASP4</strong><br />
Net memory, using the HASP Edit utility. See<br />
"Accessing Keys with HASP Edit" on page 73.<br />
Password1 First <strong>HASP4</strong> Net password.<br />
Password2 Second <strong>HASP4</strong> Net password.<br />
Par1 Start Address – Defines the initial <strong>HASP4</strong> Net<br />
memory address for writing the block (0 to 247).<br />
Par2 Block Size – Data block size in words (maximum 24<br />
words).<br />
Par3 Buffer Segment – Segment address of a program<br />
buffer (variable).<br />
Only relevant for 16-bit applications.<br />
Par4 Buffer Offset – Offset address of a program buffer<br />
(variable). The buffer size must be at least as large as<br />
the block size.<br />
Return Values Use Service 40: LastStatus (page 176) to check if the call has been<br />
performed successfully.<br />
188 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> Net Services<br />
Comments Word offsets 24 and higher in the <strong>HASP4</strong> Net memory are<br />
reserved for the <strong>HASP4</strong> Net program list.<br />
If you write to any of these offsets, you may overwrite application<br />
protection parameters that you have previously saved in this<br />
memory area.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 189
<strong>HASP4</strong> Net Services Part 3 - Chapter 14<br />
Service 85: SetConfigFilename<br />
Description Set the name of the <strong>HASP4</strong> Net configuration file. The <strong>HASP4</strong><br />
Net configuration file contains parameters and other fine-tuning<br />
settings for the protected application.<br />
Relevant Keys <strong>HASP4</strong> Net<br />
Syntax<br />
Parameters<br />
Used<br />
hasp (Service, SeedCode, ProgNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 85<br />
Par2 Buffer Size – The byte size of the buffer containing<br />
the name of the <strong>HASP4</strong> Net configuration file.<br />
Par3 Buffer Segment – The segment address of the buffer<br />
containing the name of the <strong>HASP4</strong> Net<br />
configuration file. Only relevant for 16-bit<br />
applications.<br />
Par4 Buffer Offset – The offset address of the buffer<br />
containing the name of the <strong>HASP4</strong> Net<br />
configuration file.<br />
Return Values Use Service 40: LastStatus (page 176) to check if the call has been<br />
performed successfully.<br />
Comments If you use the SetConfigFilename service, call it before performing<br />
a <strong>HASP4</strong> Net login. If you do not use SetConfigFilename, the<br />
protected application either does not use a <strong>HASP4</strong> Net<br />
configuration file, or it uses the default file named nethasp.ini if it<br />
finds it. For more information about the <strong>HASP4</strong> Net<br />
configuration file, see "Configuring <strong>HASP4</strong> Net Clients"<br />
(page 247).<br />
190 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> Net Services<br />
Service 88: HaspEncodeData<br />
Description Encodes data via the <strong>HASP4</strong> Net.<br />
Relevant Keys <strong>HASP4</strong> Net<br />
Syntax<br />
Parameters<br />
Used<br />
hasp (Service, SeedCode, ProgNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 88<br />
ProgNum The number assigned to the application in <strong>HASP4</strong><br />
Net memory, using the HASP Edit utility. See<br />
"Accessing Keys with HASP Edit" on page 73.<br />
Password1 First <strong>HASP4</strong> Net password.<br />
Password2 Second <strong>HASP4</strong> Net password.<br />
Par1 0 (reserved).<br />
Par2 Buffer size. The size in bytes of the buffer to be<br />
encoded. The buffer must be at least 8 bytes in size.<br />
Par3 Buffer segment. The segment address of the buffer.<br />
Only relevant for 16-bit applications.<br />
Par4 Buffer offset. The offset address of the buffer.<br />
Return Values Use Service 40: LastStatus (page 176) to check if the call has been<br />
performed successfully.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Comments The contents of the program buffer are encoded via the connected<br />
HASP and updated in place.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 191
<strong>HASP4</strong> Net Services Part 3 - Chapter 14<br />
This service can only be used with the <strong>HASP4</strong> generation of<br />
HASP keys. If a key prior to the <strong>HASP4</strong> generation is attached, no<br />
data will be encoded and the service will return an error code.<br />
This service is not applicable for DOS applications.<br />
If data is encoded with a Win16 application, the maximum buffer<br />
size is 64K. Data encoded with a Win32 application which exceeds<br />
64K cannot be decoded by a Win16 API.<br />
Encoding at runtime should be kept to a minimum. Instead,<br />
previously encoded files and data which are then decoded at<br />
runtime should be sent to users. See Chapter 13 for more details.<br />
192 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> Net Services<br />
Service 89: HaspDecodeData<br />
Description Decodes data via the <strong>HASP4</strong> Net.<br />
Relevant Keys <strong>HASP4</strong> Net<br />
Syntax<br />
Parameters<br />
Used<br />
hasp (Service, SeedCode, ProgNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 42<br />
ProgNum The number assigned to the application in <strong>HASP4</strong><br />
Net memory, using the HASP Edit utility. See<br />
"Accessing Keys with HASP Edit" on page 73.<br />
Password1 First <strong>HASP4</strong> Net password.<br />
Password2 Second <strong>HASP4</strong> Net password.<br />
Par1 0 (reserved).<br />
Par2 Buffer size. The size in bytes of the buffer to be<br />
decoded. The buffer must be at least 8 bytes in size.<br />
Par3 Buffer segment. The segment address of the buffer.<br />
Only relevant for 16-bit applications.<br />
Par4 Buffer offset. The offset address of the buffer.<br />
Return Values Use Service 40: LastStatus (page 176) to check if the call has been<br />
performed successfully.<br />
Par 3 Status – A code indicating the status of the<br />
operation. See "HASP API Status Codes" on<br />
page 197.<br />
Comments The contents of the program buffer are decoded via the connected<br />
HASP and updated in place.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 193
<strong>HASP4</strong> Net Services Part 3 - Chapter 14<br />
This service can only be used with the <strong>HASP4</strong> generation of<br />
HASP keys. If a key prior to the <strong>HASP4</strong> generation is attached, no<br />
data will be decoded and the service will return an error code.<br />
If data is encoded with a Win16 application, the maximum buffer<br />
size is 64K. Data encoded with a Win32 application which exceeds<br />
64K cannot be decoded by a Win16 API.<br />
194 © Aladdin Knowledge Systems, 2002
Using the HASP API <strong>HASP4</strong> Net Services<br />
Service 96: SetServerByName<br />
Description Specify the name of a HASP License Manager and instruct the<br />
protected application to communicate with the specific HASP<br />
License Manager.<br />
Relevant Keys <strong>HASP4</strong> Net<br />
Syntax<br />
Parameters<br />
Used<br />
hasp (Service, SeedCode, ProgNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 96<br />
Par2 Buffer size. The size in bytes of the buffer to be<br />
decoded. The buffer must be at least 8 bytes in size.<br />
Par3 Buffer segment. The segment address of the buffer.<br />
Only relevant for 16-bit applications.<br />
Par4 Buffer offset. The offset address of the buffer.<br />
Return Values Use Service 40: LastStatus (page 176) to check if the call has been<br />
performed successfully.<br />
Comments If you call the hasp( ) routine with the SetServerByName service,<br />
do so before performing a <strong>HASP4</strong> Net login.<br />
To name a HASP License Manager, load it with the -srvname<br />
switch, see "Switches for the HASP License Manager" (page 236).<br />
When an application calls the hasp( ) routine with<br />
SetServerByName, the routine searches for a HASP License<br />
Manager loaded with the specified name. If it finds one, the hasp( )<br />
routine stores the HASP License Manager location. When the<br />
application performs a <strong>HASP4</strong> Net login, the HASP License<br />
Manager at the stored location is accessed.<br />
The HASP License Manager name can be up to seven characters<br />
and is not case-sensitive.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 195
<strong>HASP4</strong> Net Services Part 3 - Chapter 14<br />
Service 104: HaspQueryLicense<br />
Description Queries the current license attributes from the <strong>HASP4</strong> Net.<br />
Relevant Keys <strong>HASP4</strong> Net<br />
Syntax<br />
Parameters<br />
Used<br />
hasp (Service, SeedCode, ProgNum, Password1,<br />
Password2,Par1, Par2, Par3, Par4)<br />
Service 42<br />
ProgNum The number assigned to the application in <strong>HASP4</strong><br />
Net memory, using the HASP Edit utility. See<br />
"Accessing Keys with HASP Edit" on page 73.<br />
Password1 First <strong>HASP4</strong> Net password.<br />
Password2 Second <strong>HASP4</strong> Net password.<br />
Return Values Use Service 40: LastStatus (page 176) to check if the call has been<br />
performed successfully.<br />
Par1 Number of currently active licenses (concurrent<br />
users) for this ProgNum.<br />
Par2 Maximum number of licenses available for this<br />
ProgNum.<br />
Par3 Type of <strong>HASP4</strong> Net key.<br />
Par4 Number of activations remaining for this ProgNum<br />
(-1 = Unlimited).<br />
196 © Aladdin Knowledge Systems, 2002
Part 3 - Chapter 15<br />
HASP API<br />
Status Codes<br />
Status Codes for All HASP Keys<br />
When you use the API to access HASP, the hasp( ) routine returns<br />
a status code in Par3. The following tables list the status codes<br />
returned according to the type of HASP you use.<br />
Table 15.1 Status Codes for All HASP Keys<br />
Code Description<br />
0 Successful operation.<br />
-1 <strong>Ti</strong>me-out: unsuccessful write operation.<br />
-2 The address is out of range.<br />
-3 A HASP with the specified password was not found.<br />
-4 A HASP was found but it is not a MemoHASP.<br />
-5 Unsuccessful write operation.<br />
-6 The parallel port is currently unavailable. Another device<br />
attached to it, such as a printer, is active. Retry API call<br />
after some seconds.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 197
HASP API Status Codes Part 3 - Chapter 15<br />
Code Description<br />
-7 The size of the buffer is too small. This error only occurs<br />
with services that have a minimum buffer size requirement.<br />
-8 The hardware does not support the requested service. This<br />
service requires a <strong>HASP4</strong> generation key to be connected.<br />
-9 Invalid pointer. The pointer passed to the service is not<br />
valid.<br />
-10 Access to key prohibited because the application is running<br />
through a remote screen on Citrix Winframe or Windows<br />
Terminal Server (the application can only run on the<br />
console screen).<br />
-11 Access to key prohibited because the application is running<br />
on Citrix Winframe or Windows Terminal Server (service<br />
pack 4+ required to detect if this is running on the console<br />
screen).<br />
-12 A parameter passed to the service is not valid or is out of<br />
range.<br />
-100 Cannot open the HASP device driver<br />
Applies to Win32 applications.<br />
Install the HASP device driver.<br />
-101 Cannot read the HASP device driver<br />
Applies to Win32 applications.<br />
-102 Cannot close the HASP device driver<br />
Applies to Win32 applications.<br />
-110 Cannot open the HASP device driver<br />
Applies to DOS, DOS extender, and Windows applications<br />
attempting to access the HASP device driver.<br />
Install the HASP device driver.<br />
-111 Cannot read the HASP device driver<br />
Applies to DOS, DOS extender, and Windows applications<br />
attempting to access the HASP device driver.<br />
198 © Aladdin Knowledge Systems, 2002
Using the HASP API HASP API Status Codes<br />
Code Description<br />
-112 Cannot close the HASP device driver.<br />
Applies to DOS, DOS extender, and Windows applications<br />
attempting to access the HASP device driver.<br />
-120 Cannot allocate DOS memory<br />
Applies to DOS extender and Windows applications<br />
protected with stand-alone keys<br />
Try freeing DOS memory.<br />
-121 Error freeing DOS memory<br />
Applies to DOS extender and Windows applications<br />
protected with stand-alone keys.<br />
-999 Invalid service.<br />
Status Codes for <strong>HASP4</strong> <strong>Ti</strong>me Keys<br />
Table 15.2 Status Codes for <strong>HASP4</strong> <strong>Ti</strong>me Keys<br />
Code Description<br />
0 Successful operation.<br />
-20 Invalid day.<br />
-21 Invalid month.<br />
-22 Invalid year.<br />
-23 Invalid seconds.<br />
-24 Invalid minutes.<br />
-25 Invalid hours.<br />
-26 Invalid address: the address is not in the range 0 to 15.<br />
-27 <strong>Ti</strong>meout: unsuccessful write operation.<br />
-28 A HASP with the specified password was not found.<br />
-29 A HASP was found but it is not a <strong>HASP4</strong> <strong>Ti</strong>me.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 199
HASP API Status Codes Part 3 - Chapter 15<br />
Status Codes for <strong>HASP4</strong> Net<br />
When you call the hasp( ) routine with the <strong>HASP4</strong> Net LastStatus<br />
service, the hasp( ) routine returns a status code in Par1<br />
(NetStatus), specifying the status of the previous call. If a contextdependent<br />
error occurs, you receive it in Par2 (System Error)<br />
when you call LastStatus. The hasp( ) routine may also return a<br />
warning code in Par3.<br />
When the hasp( ) routine returns an error, the execution of the<br />
service is stopped and not completed.<br />
LastStatus codes are divided into two groups:<br />
Status codes 1 to 127 - indicate errors in communication between<br />
the protected application and the HASP License Manager, or<br />
errors in parameters you passed to the hasp( ) routine.<br />
Status codes 129 to 151 - indicate errors that occur after the<br />
client-server communication has been established.<br />
The following table shows the possible values of Par1 (NetStatus).<br />
Table 15.3 <strong>HASP4</strong> Net Status Codes<br />
Code Description<br />
0 Operation successful.<br />
1 The IPX, NetBIOS, or TCP/IP protocols have not been<br />
installed properly – act accordingly.<br />
2 Communication error – unable to get the socket number<br />
(applies to IPX and TCP/IP).<br />
Verify that the protocol is installed properly.<br />
3 Communication error.<br />
NetBIOS – unable to establish the session.<br />
IPX – unable to get the immediate address of the HASP<br />
License Manager. Verify that the protocol is installed<br />
properly.<br />
TCP/IP – unable to connect to the server. Verify that the<br />
server address is correct.<br />
200 © Aladdin Knowledge Systems, 2002
Using the HASP API HASP API Status Codes<br />
Code Description<br />
4 No HASP License Manager was found.<br />
Check whether your application has a path to the address<br />
file and read permission.<br />
5 Cannot read the HASP License Manager address file.<br />
6 Cannot close the HASP License Manager address file.<br />
7 Communication error – failed to send packet.<br />
Verify that the protocol is installed properly.<br />
8 The network is busy.<br />
IPX - the network is busy or incorrect address files were<br />
found. In the latter case, delete all copies of the haspaddr.dat<br />
and newhaddr.dat files.<br />
10 You called the hasp( ) routine with one of the services,<br />
without first calling the Login service.<br />
11 Communication error – adapter error (applies only to<br />
NetBIOS).<br />
Verify that the protocol is properly installed.<br />
15 No active HASP License Manager was found.<br />
18 Cannot perform a <strong>HASP4</strong> Net login because of an<br />
unsuccessful SetServerByName call.<br />
19 Syntax error in the configuration file. The LastStatus<br />
service returns the line number in which the error occurred<br />
in Par2.<br />
If LastStatus returns 0 in Par2, there is an environment<br />
variable with an illegal setting.<br />
20 Error handling the <strong>HASP4</strong> Net configuration file. A file<br />
operation such as "open file" or "read file" failed. One<br />
possible reason could be that the system is out of file<br />
handles. The LastStatus service returns the OS system<br />
error code in Par2.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 201
HASP API Status Codes Part 3 - Chapter 15<br />
Code Description<br />
21 <strong>HASP4</strong> Net did not succeed in allocating memory. This<br />
error is unique to <strong>HASP4</strong> Net interfaces under DOS<br />
extenders and Windows.<br />
Try to free DOS memory.<br />
22 <strong>HASP4</strong> Net did not succeed in freeing DOS memory. This<br />
error is unique to <strong>HASP4</strong> Net interfaces under DOS<br />
extenders and Windows.<br />
23 Invalid <strong>HASP4</strong> Net memory address.<br />
25 Failed to load winsock.dll (applies only to TCP/IP and<br />
IPX).<br />
26 Failed to unload winsock.dll (applies only to TCP/IP and<br />
IPX).<br />
28 Winsock.dll startup error (applies only to TCP/IP and<br />
IPX).<br />
30 Failed to close socket (applies only to TCP/IP).<br />
33 SetProtocol service requested without performing logout.<br />
34 Access to key prohibited because the application is running<br />
on Citrix Winframe or Windows Terminal Server (service<br />
pack 4+ required to detect if this is running on the console<br />
screen).<br />
129 The correct <strong>HASP4</strong> Net is not connected to the HASP<br />
License Manager.<br />
130 The program number specified is not in the program list of<br />
the <strong>HASP4</strong> Net memory.<br />
131 Error reading from <strong>HASP4</strong> Net memory.<br />
132 Error writing to <strong>HASP4</strong> Net memory.<br />
133 The current Login request exceeds the number of stations<br />
which may run the application at the same time.<br />
134 The current login request exceeds the number of<br />
authorized activations for the application.<br />
202 © Aladdin Knowledge Systems, 2002
Using the HASP API HASP API Status Codes<br />
Code Description<br />
135 You called the hasp( ) routine with the Logout service<br />
without first calling the Login service.<br />
136 The HASP License Manager is busy – this may occur if<br />
your <strong>HASP4</strong> Net system is not well adapted to the<br />
network.<br />
137 There is no space in the <strong>HASP4</strong> Net log table.<br />
138 Internal <strong>HASP4</strong> Net error – the number of licensed<br />
stations is larger than the maximum number allowed by the<br />
<strong>HASP4</strong> Net model.<br />
139 The computer with the <strong>HASP4</strong> Net crashed and was<br />
reactivated, or you called the hasp( ) routine with a service<br />
(not including 40, 85, or 96) without first calling the login<br />
service.<br />
140 The HASP License Manager does not serve the network of<br />
your station.<br />
141 Invalid service, or new version of the HASP API is<br />
communicating with an older version of the HASP License<br />
Manager.<br />
142 The HASP License Manager matching the name specified<br />
in the <strong>HASP4</strong> Net configuration file was not found.<br />
150 No HASP License Manager with the assigned name was<br />
found. This error is returned by the SetServerByName<br />
service.<br />
151 Two or more different HASP License Managers with the<br />
assigned name were found. This error is returned by the<br />
SetServerByName service.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 203
HASP API Status Codes Part 3 - Chapter 15<br />
Code Description<br />
152 The encode operation failed because the hardware does not<br />
support the service.<br />
153 The decode operation failed because the hardware does not<br />
support the service.<br />
155 An old version of the License Manager has been found.<br />
The API used requires a newer version of the License<br />
Manager to be installed.<br />
The following table lists the possible warning codes returned in<br />
Par3 when using the LastStatus service. When Par3 returns a<br />
warning, the execution of the service is completed regardless of<br />
the warning.<br />
Table 15.4 <strong>HASP4</strong> Net Warning Codes<br />
Code Description<br />
1 IPX is enabled via nethasp.ini or via the<br />
NETHASPPROTOCOL environment variable, but IPX is<br />
not installed.<br />
This warning occurs upon <strong>HASP4</strong> Net login.<br />
2 NetBIOS is enabled via nethasp.ini or via an environment<br />
variable, but NetBIOS is not installed.<br />
This warning occurs upon <strong>HASP4</strong> Net login.<br />
3 IPX and NetBIOS are enabled via nethasp.ini or via an<br />
environment variable, but neither of the protocols are<br />
installed. This warning occurs upon <strong>HASP4</strong> Net login.<br />
4 TCP/IP is enabled via nethasp.ini or via an environment<br />
variable, but TCP/IP is not installed.<br />
This warning occurs upon <strong>HASP4</strong> Net login.<br />
5 IPX and TCP/IP are enabled via nethasp.ini or via an<br />
environment variable, but neither of the protocols are<br />
installed. This warning occurs upon <strong>HASP4</strong> Net login.<br />
204 © Aladdin Knowledge Systems, 2002
Using the HASP API HASP API Status Codes<br />
Code Description<br />
6 TCP/IP and NetBIOS are enabled via nethasp.ini or via an<br />
environment variable, but neither of the protocols are not<br />
installed. This warning occurs upon <strong>HASP4</strong> Net login.<br />
7 IPX, NetBIOS and TCP/IP are enabled via nethasp.ini or<br />
via an environment variable, but none of the three<br />
protocols are installed. This warning occurs upon <strong>HASP4</strong><br />
Net login.<br />
18 The HASP License Manager returned a <strong>HASP4</strong> Net logout<br />
status of OK, but due to timeout, a <strong>HASP4</strong> Net logout<br />
might not have been performed. In this case, you should<br />
perform an additional <strong>HASP4</strong> Net logout. If the <strong>HASP4</strong><br />
Net logout returns error 135, then a logout was performed<br />
regardless of the error.<br />
This warning occurs upon <strong>HASP4</strong> Net logout.<br />
19 An invalid keyword or value is defined in nethasp.ini, or a<br />
new keyword is not recognized by an older API version.<br />
This warning occurs upon <strong>HASP4</strong> Net login.<br />
20 TCP or UDP protocols were specified in the nethasp.ini<br />
along with another protocol. If the HASP License<br />
Manager’s IP address is not specified in the nethasp.ini, the<br />
<strong>HASP4</strong> Net client will work with the other protocol<br />
specified, however a warning is returned to notify you that<br />
either TCP or UDP was not employed due to the missing<br />
IP address.<br />
This warning occurs after using SetProtocol.<br />
22 The HASP API cannot free memory.<br />
This warning may occur after any <strong>HASP4</strong> Net API service.<br />
The <strong>HASP4</strong> Net LastStatus codes are constantly being updated.<br />
For the latest updates, see the HASP License Manager help file.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 205
Part 4<br />
Using HASP in a<br />
Network<br />
This part describes the <strong>HASP4</strong> Net system and relevant tools and<br />
procedures.<br />
The chapter "<strong>HASP4</strong> Net Basic Concept" (page 209) explains<br />
terms and concepts that are important if you are protecting<br />
software with <strong>HASP4</strong> Net.<br />
The chapter "Protecting Applications with <strong>HASP4</strong> Net"<br />
(page 221) describes how you can protect your application for<br />
<strong>HASP4</strong> Net use.<br />
The chapter "Managing <strong>HASP4</strong> Net Licenses" (page 227) explains<br />
the installation and use of HASP License Manager which provide<br />
<strong>HASP4</strong> Net licenses in the network.<br />
The chapter "Configuring <strong>HASP4</strong> Net Clients" (page 247)<br />
describes how an application protected for <strong>HASP4</strong> Net - the<br />
<strong>HASP4</strong> Net client - can be configured with a configuration file.<br />
The chapter "Monitoring <strong>HASP4</strong> Net Licenses" (page 257)<br />
explains the use of Aladdin Monitor which permits centralized<br />
administration of the HASP License Manager applications and the<br />
<strong>HASP4</strong> Net keys.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 207
Using HASP in a Network Part 4<br />
The chapter "Adapting <strong>HASP4</strong> Net to the Network" (page 263)<br />
provides information on how to adapt <strong>HASP4</strong> Net to a network<br />
by defining the range of stations and adapting the timeout.<br />
208 © Aladdin Knowledge Systems, 2002
Part 4 - Chapter 17<br />
<strong>HASP4</strong> Net Basic<br />
What is <strong>HASP4</strong> Net?<br />
Concept<br />
This chapter explains terms and concepts that are important if you<br />
are protecting software with <strong>HASP4</strong> Net. Before beginning the<br />
chapter, familiarize yourself with general HASP terms and<br />
concepts. If you are not using <strong>HASP4</strong> Net, you can skip this<br />
chapter.<br />
<strong>HASP4</strong> Net is a HASP designed for networks. It lets you<br />
effectively license your application in network environments by<br />
controlling the number of software copies that can run at the same<br />
time. By connecting a single <strong>HASP4</strong> Net key to any computer in<br />
the network, you can secure your application against unauthorized<br />
use, and monitor the number of stations using your application<br />
simultaneously.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 209
<strong>HASP4</strong> Net Basic Concept Part 4 - Chapter 17<br />
Figure 17.1 <strong>HASP4</strong> Net System<br />
How Does <strong>HASP4</strong> Net Work?<br />
When a protected application is activated from a network station,<br />
it accesses the HASP License Manager and requests permission to<br />
run by performing a <strong>HASP4</strong> Net login. The HASP License<br />
Manager then checks that the correct HASP key is connected and<br />
accesses the <strong>HASP4</strong> Net memory to verify the following:<br />
The protected application is licensed to run.<br />
The number of stations allowed to run the protected<br />
application at the same time has not been exceeded.<br />
If all results produced by the checks are positive, the HASP<br />
License Manager grants the protected application permission to<br />
run, and updates the <strong>HASP4</strong> Net log table. Otherwise, the HASP<br />
License Manager returns an error code.<br />
The following figures illustrate the <strong>HASP4</strong> Net mechanism. The<br />
network shown in these figures consists of four stations. On one<br />
of the stations, a <strong>HASP4</strong> Net key is connected and the HASP<br />
License Manager is active.<br />
Protected application number 1 is licensed to run simultaneously<br />
on five stations. The figures illustrate the process by which<br />
station 3 attempts to activate protected application number 1.<br />
210 © Aladdin Knowledge Systems, 2002
Using HASP in a Network <strong>HASP4</strong> Net Basic Concept<br />
Figure 17.2 Before a <strong>HASP4</strong> Net login...<br />
Stations 1 and 2 are running protected application 1, and are both<br />
listed in the log table. Of the five stations that are licensed to run<br />
the protected application at the same time, two are already listed in<br />
the log table.<br />
Figure 17.3 A <strong>HASP4</strong> Net login is performed...<br />
Station 3 loads protected application 1, which accesses the HASP<br />
License Manager with a <strong>HASP4</strong> Net login. The HASP License<br />
Manager determines whether or not station 3 is licensed to activate<br />
the application.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 211
<strong>HASP4</strong> Net Basic Concept Part 4 - Chapter 17<br />
Preparing Protection<br />
Figure 17.4 After a <strong>HASP4</strong> Net login...<br />
The checks performed by the HASP License Manager are positive,<br />
and application 1 is granted a license to run on station 3. The log<br />
table is updated and now includes station 3.<br />
Protecting applications with <strong>HASP4</strong> Net<br />
When protecting your application, you can choose between<br />
protecting your application for local use, for network use or for<br />
both. To enable <strong>HASP4</strong> Net, use one of the following methods:<br />
Enable <strong>HASP4</strong> Net when using HASP Envelope<br />
Use <strong>HASP4</strong> Net API services instead of or in addition to other<br />
API services<br />
For more information refer to "Protecting Applications with<br />
<strong>HASP4</strong> Net" (page 221).<br />
212 © Aladdin Knowledge Systems, 2002
Using HASP in a Network <strong>HASP4</strong> Net Basic Concept<br />
Providing Licenses with <strong>HASP4</strong> Net Keys<br />
Using <strong>HASP4</strong> Net<br />
Installing <strong>HASP4</strong> Net<br />
<strong>HASP4</strong> Net keys enable you to do the following:<br />
Limit the number of stations for each protected application<br />
Limit the number of activations for each protected application<br />
<strong>HASP4</strong> Net keys come in several models. The <strong>HASP4</strong> Net model<br />
number determines the maximum number of licenses available to<br />
each application (i.e. the maximum number of stations that can<br />
access the application at the same time). For example,<br />
<strong>HASP4</strong> Net5 can allow from zero to five licenses. Other models<br />
allow up to 10, 20, 50 or 100 licenses. With <strong>HASP4</strong> NetU, your<br />
application can have an unlimited number of licenses.<br />
<strong>HASP4</strong> Net keys are available for the parallel port and for the USB<br />
port.<br />
The following steps are necessary to install <strong>HASP4</strong> Net in a<br />
network:<br />
Install the appropriate HASP device driver or daemon and<br />
connect the <strong>HASP4</strong> Net key.<br />
Install and start the HASP License Manager on the same<br />
machine. For more information refer to "Managing<br />
<strong>HASP4</strong> Net Licenses" (page 227)<br />
Customize the HASP License Manager and the <strong>HASP4</strong> Net<br />
client, if necessary. For more information refer to<br />
"Customizing the HASP License Manager" (page 236) and to<br />
"Configuring <strong>HASP4</strong> Net Clients" (page 247).<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 213
<strong>HASP4</strong> Net Basic Concept Part 4 - Chapter 17<br />
Managing Licenses with HASP License Manager<br />
The HASP License Manager is the application that communicates<br />
with the protected application and the <strong>HASP4</strong> Net key,<br />
functioning as a link between the two. It can communicate with<br />
several protected applications running on the network and with<br />
multiple <strong>HASP4</strong> Net keys connected to the computer.<br />
The HASP License Manager is available for the following<br />
environments: Windows 95/98/ME, Windows NT/2000/XP,<br />
Mac OS X and Novell Netware 3.12 and higher.<br />
The HASP License Manager maintains a log table which lists all<br />
the protected applications that have performed a <strong>HASP4</strong> Net<br />
login. The list identifies each protected application, and the station<br />
that activated the application. An application and its station remain<br />
listed in the log table until the application performs a <strong>HASP4</strong> Net<br />
logout.<br />
For more information refer to "Managing <strong>HASP4</strong> Net Licenses"<br />
(page 227).<br />
Requesting Licenses with <strong>HASP4</strong> Net Client<br />
The protected application acts as the <strong>HASP4</strong> Net client. It<br />
requests the <strong>HASP4</strong> Net license and communicates with the<br />
HASP License Manager. When you activate the protected<br />
application, it performs a <strong>HASP4</strong> Net login to access the<br />
HASP License Manager with a request to run. When the protected<br />
application is terminated, it informs the HASP License Manager<br />
by performing a <strong>HASP4</strong> Net logout.<br />
Do not confuse the <strong>HASP4</strong> Net login and logout with<br />
the standard network login and logout.<br />
The <strong>HASP4</strong> Net client is available for the following environments:<br />
Windows 3.1, Windows 95/98/ME, Windows NT/2000/XP, Mac<br />
OS 8.6, Mac OS 9.x and Mac OS X.<br />
214 © Aladdin Knowledge Systems, 2002
Using HASP in a Network <strong>HASP4</strong> Net Basic Concept<br />
<strong>HASP4</strong> Net clients can be configured individually. For more<br />
information refer to "Configuring <strong>HASP4</strong> Net Clients"<br />
(page 247).<br />
Monitoring Licenses with Aladdin Monitor<br />
Aladdin Monitor permits centralized administration of the<br />
HASP License Manager applications and the <strong>HASP4</strong> Net keys.<br />
The following options are available:<br />
Checking the properties of the HASP License Manager.<br />
Checking <strong>HASP4</strong> Net keys.<br />
Starting and stopping the HASP License Manager service.<br />
Aladdin Monitor is available for the following environments:<br />
Windows 98/ME, Windows NT/2000/XP. It can communicate<br />
via TCP/IP and IPX.<br />
For more information refer to "Monitoring <strong>HASP4</strong> Net Licenses"<br />
(page 257).<br />
Distributing <strong>HASP4</strong> Net<br />
Distributing <strong>HASP4</strong> Net<br />
Along with the protected application, you should supply your<br />
customer with the following:<br />
<strong>HASP4</strong> Net key<br />
HASP device driver<br />
HASP License Managers (with configuration file Nhserv.ini)<br />
Aladdin Monitor<br />
Configuration file for <strong>HASP4</strong> Net client Nethasp.ini<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 215
<strong>HASP4</strong> Net Basic Concept Part 4 - Chapter 17<br />
Assisting the End-User<br />
The Aladdin Diagnostic utility lets your customers collect<br />
information on their system and on their HASP key. This<br />
information will help you and your customer to solve problems<br />
they may encounter when using the protected application.<br />
Your customers can use the Aladdin Diagnostic utility:<br />
To check for a HASP key.<br />
To create a report file that contains data for Aladdin devices<br />
and other relevant system information.<br />
Aladdin Diagnostic is available for the following environments:<br />
Windows 95/98/ME and Windows NT/2000/XP.<br />
For more information refer to "Assisting End-Users" (page 107).<br />
216 © Aladdin Knowledge Systems, 2002
Using HASP in a Network <strong>HASP4</strong> Net Basic Concept<br />
Supported Protocols, Platforms and<br />
Operating Systems<br />
<strong>HASP4</strong> Net is a cross-platform solution which supports the<br />
following operating systems.<br />
Table 17.1 <strong>HASP4</strong> Net Supported Platforms<br />
<strong>HASP4</strong> Net<br />
client<br />
HASP License<br />
Manager<br />
Aladdin<br />
Monitor<br />
Aladdin<br />
Diagnostic<br />
Windows<br />
3.x<br />
Windows<br />
95/98/ME<br />
NT/2000/XP<br />
Mac<br />
OS 8.6<br />
The following protocols can be used for communication between<br />
the <strong>HASP4</strong> Net client and the HASP License Manager.<br />
Table 17.2 <strong>HASP4</strong> Net Protocols<br />
Mac<br />
OS 9.x<br />
Mac<br />
OS X<br />
available available available available available<br />
Novell<br />
available available available available<br />
available<br />
available available<br />
Windows Apple<br />
Macintosh<br />
Novell<br />
Netware<br />
IPX supported supported<br />
TCP/IP (UDP/IP) supported supported<br />
NetBIOS supported<br />
TCP/IP is used to refer to both TCP/IP and UDP/IP.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 217
<strong>HASP4</strong> Net Basic Concept Part 4 - Chapter 17<br />
Frequently Asked Questions<br />
Question Do I need to install <strong>HASP4</strong> Net on the network file server?<br />
Answer No. You can install the <strong>HASP4</strong> Net key and the HASP License<br />
Manager on any station in the network. The designated station<br />
must be active and the HASP License Manager loaded for as<br />
long as any application protected with <strong>HASP4</strong> Net is running.<br />
Question Can I see which stations are accessing a <strong>HASP4</strong> Net key?<br />
Answer Yes. The Aladdin Monitor utility shows you all the stations<br />
activating an application that has performed a <strong>HASP4</strong> Net login<br />
to the HASP License Manager. See "Monitoring<br />
<strong>HASP4</strong> Net Licenses" (page 257) for details.<br />
Question If I connect two <strong>HASP4</strong> Net5 keys of the same developer code<br />
to a single station, will I receive 10 licenses?<br />
Answer No. When two <strong>HASP4</strong> Net keys with the same developer code<br />
are connected to the same computer, only one <strong>HASP4</strong> Net key<br />
responds. To enable ten licenses with two <strong>HASP4</strong> Net5 keys,<br />
connect each key to a separate station and run the correct HASP<br />
License Manager. Alternatively, use a <strong>HASP4</strong> Net10.<br />
Question My customer already has a <strong>HASP4</strong> Net from another software<br />
vendor connected to a station on the network and a HASP<br />
License Manager loaded. What must be done to install my<br />
<strong>HASP4</strong> Net key?<br />
Answer All your customer needs to do is connect your <strong>HASP4</strong> Net key to<br />
the same computer. The already loaded HASP License Manager<br />
serves both <strong>HASP4</strong> Net keys.<br />
218 © Aladdin Knowledge Systems, 2002
Using HASP in a Network <strong>HASP4</strong> Net Basic Concept<br />
Question Will <strong>HASP4</strong> Net work over the Internet?<br />
Answer Yes. <strong>HASP4</strong> Net works over the Internet with TCP/IP.<br />
Question If, for example, I have a <strong>HASP4</strong> Net20 can I grant access to just<br />
17 users?<br />
Answer Yes, using HASP Edit you can specify any number of users up to<br />
20.<br />
Question When using <strong>HASP4</strong> Net, on which station do I need to install<br />
the HASP device driver?<br />
Answer Only on the station with the <strong>HASP4</strong> Net key.<br />
The HASP device driver serves as a link between the HASP and<br />
the protected application. Since the application protected by<br />
<strong>HASP4</strong> Net communicates with the HASP License Manager,<br />
which in turn accesses the <strong>HASP4</strong> Net key, install the HASP<br />
device driver on the station which is running the HASP License<br />
Manager.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 219
Part 4 - Chapter 18<br />
Protecting<br />
Applications with<br />
<strong>HASP4</strong> Net<br />
This chapter describes how you can protect your application with<br />
<strong>HASP4</strong> Net.<br />
When protecting your application, you can choose between<br />
protecting your application for local use, for network use or for<br />
both. To enable <strong>HASP4</strong> Net, use one of the following methods:<br />
Enable <strong>HASP4</strong> Net when using HASP Envelope<br />
Use <strong>HASP4</strong> Net API services instead of or in addition to other<br />
API services<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 221
Protecting Applications with <strong>HASP4</strong> Net Part 4 - Chapter 18<br />
HASP Envelope Options for <strong>HASP4</strong> Net<br />
HASP Envelope for Win32<br />
HASP Envelope enables you to protect your application without<br />
having to alter the source code. For information on the basic<br />
procedures refer to "Protecting with HASP Envelope" (page 43).<br />
In addition to the usual procedure, perform the following steps:<br />
Enter the <strong>HASP4</strong> Net passwords.<br />
Specify a number for the program.<br />
Specify how many licenses and activations you want to provide<br />
for this program file. If you do not want to limit the number,<br />
activate the Unlimited option. This information is only<br />
relevant if you want to write it to the connected <strong>HASP4</strong> Net<br />
key following the protection process.<br />
Enter the name of the <strong>HASP4</strong> Net configuration file, or<br />
browse for it. For more information on the configuration file,<br />
refer to "Configuring <strong>HASP4</strong> Net Clients" (page 247).<br />
If you want to protect your application for both<br />
local and network use, you can specify the <strong>HASP4</strong><br />
Net parameters in addition to the parameters for<br />
local use.<br />
222 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Protecting Applications with <strong>HASP4</strong> Net<br />
HASP Envelope Command Line Tool<br />
If you are using the HASP Envelope command line tool, the<br />
following switches are relevant to enable <strong>HASP4</strong> Net:<br />
Table 18.1 HASP Envelope Switches for <strong>HASP4</strong> Net<br />
Switch Function<br />
-nhpass Specify the <strong>HASP4</strong> Net<br />
passwords.<br />
-prgnum Specify a unique program<br />
number from 1 to 112.<br />
-netcfg Specify a <strong>HASP4</strong> Net<br />
configuration file.<br />
<strong>HASP4</strong> Net API Services<br />
When protecting your application for network use by adding API<br />
calls to your source code, you need to use the <strong>HASP4</strong> Net<br />
services. For a detailed description of every service refer to<br />
"<strong>HASP4</strong> Net Services" (page 171).<br />
If you want to protect your application for both<br />
local and network use, you need to implement<br />
both <strong>HASP4</strong> Net services and basic and/or<br />
memory services.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 223
Protecting Applications with <strong>HASP4</strong> Net Part 4 - Chapter 18<br />
Table 18.2 <strong>HASP4</strong> Net API Services<br />
Service Name Operation<br />
40 LastStatus Check the status of the last call.<br />
Use this service after each call<br />
to the hasp( ) routine.<br />
42 Login Request permission from the<br />
HASP License Manager to<br />
activate the application.<br />
Unless you use services 85 or<br />
96, login must be your first call<br />
to the hasp( ) routine.<br />
43 Logout Request <strong>HASP4</strong> Net session<br />
termination from the HASP<br />
License Manager.<br />
44 ReadWord Read one word of data from<br />
the <strong>HASP4</strong> Net memory.<br />
45 WriteWord Write one word of data to the<br />
<strong>HASP4</strong> Net memory.<br />
46 HaspID Get the <strong>HASP4</strong> Net ID<br />
number.<br />
48 Idle<strong>Ti</strong>me Set a maximum time frame for<br />
idle stations.<br />
52 ReadBlock Read a block of data from the<br />
<strong>HASP4</strong> Net memory.<br />
53 WriteBlock Write a block of data to the<br />
<strong>HASP4</strong> Net memory.<br />
85 SetConfigFilename Set name of <strong>HASP4</strong> Net<br />
configuration file.<br />
224 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Protecting Applications with <strong>HASP4</strong> Net<br />
Service Name Operation<br />
88 HaspEncodeData Encode data sent to the<br />
connected <strong>HASP4</strong> Net key.<br />
Use in conjunction with<br />
HaspDecodeData to verify that<br />
a specific <strong>HASP4</strong> Net key is<br />
present on the network.<br />
89 HaspDecodeData Decode data sent to the<br />
connected <strong>HASP4</strong> Net key.<br />
Use in conjunction with<br />
HaspEncodeData to verify that<br />
a specific <strong>HASP4</strong> Net key is<br />
present on the network.<br />
96 SetServerByName Set the name of the HASP<br />
License Manager to which the<br />
protected application will<br />
perform a <strong>HASP4</strong> Net login.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 225
Part 4 - Chapter 19<br />
Managing<br />
<strong>HASP4</strong> Net Licenses<br />
This chapter describes how to manage <strong>HASP4</strong> Net licenses with<br />
the HASP License Manager.<br />
The HASP License Manager is the application that communicates<br />
with the protected application and the <strong>HASP4</strong> Net key,<br />
functioning as a link between the two. It can communicate with<br />
several protected applications running on the network and with<br />
multiple <strong>HASP4</strong> Net keys connected to the computer.<br />
The HASP License Manager is available for the following<br />
environments: Windows 95/98/ME, Windows NT/2000/XP,<br />
Mac OS X and Novell Netware 3.12 and higher.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 227
Managing <strong>HASP4</strong> Net Licenses Part 4 - Chapter 19<br />
How does the HASP License Manager<br />
Work?<br />
The HASP License Manager maintains a log table which lists all<br />
the protected applications that have performed a <strong>HASP4</strong> Net<br />
login. The list identifies each protected application, and the station<br />
that activated the application. An application and its station remain<br />
listed in the log table until the application performs a <strong>HASP4</strong> Net<br />
logout.<br />
The HASP License Manager uses the log table to keep track of the<br />
number of stations running a protected application at the same<br />
time. It ensures that the number of stations does not exceed the<br />
maximum number licensed by the software developer. By default<br />
the login table can track logins for up to 250 applications.<br />
228 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Managing <strong>HASP4</strong> Net Licenses<br />
HASP License Manager for Windows<br />
The HASP License Manager for Windows is available as an<br />
executable for Windows 95/98/ME/NT/2000/XP and as a<br />
service for Windows NT/2000/XP.<br />
The HASP License Manager for Windows can communicate via<br />
TCP/IP, IPX and NetBIOS. The protocols can be loaded and<br />
unloaded using the HASP License Manager graphical user<br />
interface or command-line switches.<br />
Installing HASP License Manager under Windows<br />
Both types of HASP License Managers can be installed with the<br />
setup file lmsetup.exe.<br />
Install the appropriate HASP License Manager on the station the<br />
<strong>HASP4</strong> Net key is connected to.<br />
The installation can be customized using the following methods:<br />
Start the HASP License Manager with switches, see "Switches<br />
for the HASP License Manager" (page 236).<br />
Use the configuration file nhsrvw32.ini, see "Settings in nhsrv.ini<br />
Configuration File" (page 239).<br />
Use the License Manager Installation API (only Win32<br />
service), see "HASP License Manager Installation API"<br />
(page 240).<br />
On a Windows 95/98/ME Station<br />
The HASP License Manager for Windows is nhsrvw32.exe. Use the<br />
setup file lmsetup.exe to install it.<br />
1. Install the HASP device driver and connect the <strong>HASP4</strong> Net key<br />
to a station.<br />
2. Install the HASP License Manager by running lmsetup.exe from<br />
your HASP CD and following the instructions of the<br />
installation wizard.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 229
Managing <strong>HASP4</strong> Net Licenses Part 4 - Chapter 19<br />
On a Windows NT/2000/XP Station<br />
The HASP License Manager for Windows NT/2000/XP is<br />
nhsrvice.exe. Use the setup file lmsetup.exe to install it.<br />
It is recommended that you install the HASP License Manager as<br />
an NT service, so there is no need to log in to the station to<br />
provide the functionality.<br />
1. Install the HASP device driver and connect the <strong>HASP4</strong> Net key<br />
to a station.<br />
2. Install the License Manager by running lmsetup.exe from your<br />
HASP CD and following the instructions of the installation<br />
wizard. As installation type, select Service.<br />
You can also integrate the HASP License Manager<br />
service installation into your application by using the<br />
HASP License Manager Install API, which can be<br />
found in the utility\servers \win32\service\lmapi directory.<br />
Activating and Deactivating HASP License Manager<br />
HASP License Manager Application<br />
To activate the HASP License Manager application, start it from<br />
the Start menu or Windows Explorer. The HASP License<br />
Manager application is always active when any protocol is loaded<br />
and a <strong>HASP4</strong> Net key is connected.<br />
To deactivate it, select Exit from the main menu.<br />
HASP License Manager Service<br />
To activate the HASP License Manager service, start it from the<br />
Start menu or Windows Explorer.<br />
To deactivate the HASP License Manager service, use the standard<br />
Windows Service administration in the Control Panel.<br />
You can also use Aladdin Monitor start and stop the HASP<br />
License Manager service.<br />
230 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Managing <strong>HASP4</strong> Net Licenses<br />
Operating the HASP License Manager<br />
You can operate the HASP License Manager by using the<br />
graphical user interface. Alternatively you can operate it as a<br />
command-line tool.<br />
To open the main window of the graphical user interface, doubleclick<br />
the icon of the red <strong>HASP4</strong> Net key in the system tray.<br />
The HASP License Manager main window displays the following<br />
information:<br />
HASP License Manager version number<br />
Status of each protocol (loaded, unloaded, or failed to load)<br />
and the date and time of the last change of status<br />
Status of the HASP License Manager (active or not active)<br />
You can close the HASP License Manager main window by<br />
clicking the close button at the right corner of the title bar.<br />
However, the HASP License Manager will continue to run, and its<br />
icon will remain in the system tray.<br />
To exit the program, choose Exit from the menu bar. If the HASP<br />
License Manager is installed as a Windows NT service, you cannot<br />
exit using this menu option.<br />
Loading Protocols<br />
To enable a protocol, select it in the Load menu. You can only<br />
enable protocols which have been installed on the machine.<br />
Unloading Protocols<br />
To disable a protocol, select it in the Remove menu.<br />
Viewing the Activity Log<br />
To view a log of the HASP License Manager activity, select<br />
Activity Log from the menu bar. The Activity Log window is<br />
opened.<br />
To view the log for a specific protocol, select the protocol from<br />
the drop-down list.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 231
Managing <strong>HASP4</strong> Net Licenses Part 4 - Chapter 19<br />
HASP License Manager for Mac<br />
The HASP License Manager for Mac is available for Mac OS X. It<br />
can communicate via TCP/IP.<br />
The HASP License Manager for Mac consists of a daemon and a<br />
graphical user interface. The HASP License Manager for Mac can<br />
be operated by using the graphical user interface. Alternatively you<br />
can operate daemon as a command-line tool.<br />
Installing HASP License Manager<br />
To install HASP License Manager under MAC OS X use the<br />
HASP License Manager Install installation utility.<br />
1. Double-click the HASP License Manager Install file in the HASP<br />
License Manager directory on the HASP CD.<br />
2. Enter your adminstrator password.<br />
3. Choose a location.<br />
To install HASP License Manager you need to log on as<br />
administrator.<br />
4. Select Install to perform installation.<br />
Activating and Deactivating HASP License Manager<br />
To activate the HASP License Manager, start the application from<br />
the applications menu and start the daemon by choosing Start<br />
Daemon in the application window. Alternatively you can start the<br />
daemon using the the installation script.<br />
To load the HASP License Manager automatically,<br />
activate the Activate in system startup option.<br />
232 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Managing <strong>HASP4</strong> Net Licenses<br />
Operating HASP License Manager<br />
You can operate the HASP License Manager by using the<br />
graphical user interface. Alternatively you can operate it as a<br />
command-line tool, see "Switches for the HASP License Manager"<br />
(page 236).<br />
The HASP License Manager for Mac displays the following<br />
information:<br />
Server name and IP address of the server<br />
Available switches<br />
If the daemon is started during system startup<br />
The Daemon status<br />
The following options are available:<br />
Setting switches (only when the daemon process is not<br />
running)<br />
Starting and stopping the daemon<br />
Activating the daemon at start up<br />
Setting a Server Name<br />
You can assign up to six server names to the HASP License<br />
Manager.<br />
You cannot assign server names to a running daemon,<br />
because the names are assigned when the daemon is<br />
started.<br />
To assign a server name, stop the daemon if it has already been<br />
started. Activate the SRVNAMES option and enter up to six<br />
names. Separate the names with semicolons, colons, or spaces. The<br />
names will be assigned when the daemon is started.<br />
Avoid using non-ASCII characters in server names,<br />
since their codes differ form system to system. Server<br />
names are not case-sensitive.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 233
Managing <strong>HASP4</strong> Net Licenses Part 4 - Chapter 19<br />
Setting a Configuration File<br />
You can configure the HASP License Manager for Mac using a<br />
configuration file. To set name and path of the configuration file,<br />
activate the CFGFILE option and enter path and name. For<br />
information about the configuration file refer to "Settings in<br />
nhsrv.ini Configuration File" (page 239).<br />
Starting and Stopping the Daemon<br />
To start and stop the daemon, use the buttons in the application<br />
window.<br />
Activating the Daemon Automatically<br />
You have the option to activate the daemon automatically at<br />
system start up. To do this, activate the Activate in system<br />
startup option.<br />
234 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Managing <strong>HASP4</strong> Net Licenses<br />
HASP License Manager on<br />
Novell File Server<br />
The HASP License Manager for Novell Netware file servers is<br />
haspserv.nlm. It can communicate via IPX.<br />
Loading HASP License Manager<br />
On Novell, USB keys are not supported.<br />
To load the HASP License Manager:<br />
1. Connect the HASP key to a Novell server.<br />
2. Copy haspserv.nlm to the system directory of the file server.<br />
3. Load the HASP License Manager by entering:<br />
load haspserv<br />
The HASP License Manager screen appears showing operation<br />
details.<br />
Removing HASP License Manager<br />
To load the HASP License Manager automatically, add<br />
the line load haspserv to the autoexec.ncf file in the<br />
sys:system directory.<br />
To remove HASP License Manager enter unload haspserv.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 235
Managing <strong>HASP4</strong> Net Licenses Part 4 - Chapter 19<br />
Customizing the HASP License Manager<br />
When installing and operating the HASP License Manager you<br />
may want to adapt it to the network environment. You can use one<br />
the following methods:<br />
Operate the HASP License Manager with switches.<br />
Use the configuration file nhsrv.ini.<br />
Use the License Manager Installation API (only Win32<br />
service).<br />
Switches for the HASP License Manager<br />
The HASP License Manager can be activated with various<br />
switches that instruct the <strong>HASP4</strong> Net system which protocols to<br />
use and how to serve the <strong>HASP4</strong> Net clients.<br />
Table 19.1 HASP License Manager Switches<br />
Switch Explanation<br />
-? Display a list of available switches. yes<br />
-addrpath=<br />
<br />
-c<br />
Specify a location for saving haspaddr.dat. By default,<br />
the HASP License Manager places haspaddr.dat in the<br />
directory where it is loaded.<br />
Specify the location of the configuration file for the<br />
HASP License Manager.<br />
236 © Aladdin Knowledge Systems, 2002<br />
Novell<br />
Windows<br />
yes yes<br />
-help Display a list of available switches. yes yes<br />
-ipx<br />
Instruct the <strong>HASP4</strong> Net system to use the IPX<br />
protocol with SAP.<br />
yes yes<br />
Mac<br />
yes
Using HASP in a Network Managing <strong>HASP4</strong> Net Licenses<br />
Switch Explanation<br />
-ipxnosap<br />
-ipxsocketnum=<br />
<br />
-localnet<br />
-nbname=<br />
<br />
-netbios<br />
-portnum=<br />
<br />
Instruct the <strong>HASP4</strong> Net system to use only the IPX<br />
protocol (without SAP). With the HASP License<br />
Manager for Win32, you can still load other protocols<br />
by using either the -tcpip or -netbios switch or both.<br />
When you use this switch, the HASP License Manager<br />
creates a file called newhaddr.dat. This file contains the<br />
node address of the station running the HASP License<br />
Manager. When you load the HASP License Manager<br />
with this switch, only protected applications with<br />
access to newhaddr.dat can communicate with the<br />
HASP License Manager.<br />
Use this switch if you want to change the IPX socket<br />
the License Manager is using for communication. The<br />
default is 7483 (hex).<br />
Use this switch if you want the HASP License<br />
Manager to serve only requests from stations in the<br />
local network.<br />
If requests come from stations that are not part of the<br />
local network, the HASP License Manager returns<br />
error 140.<br />
Assign a NetBIOS name to the HASP License<br />
Manager. This switch is identical to the -<br />
nethaspnbname switch.<br />
Force the <strong>HASP4</strong> Net system to listen only to the<br />
NetBIOS protocol. With the HASP License Manager<br />
for Win32, you can still load other protocols by using<br />
either the -tcpip or -ipxnosap switch or both.<br />
If you are using the TCP/IP protocol, you can use this<br />
switch to instruct the HASP License Manager to listen<br />
to the port you specify. The default Port Number is<br />
475.<br />
yes yes<br />
yes yes<br />
yes yes<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 237<br />
Novell<br />
Windows<br />
yes<br />
yes<br />
yes yes<br />
Mac
Managing <strong>HASP4</strong> Net Licenses Part 4 - Chapter 19<br />
Switch Explanation<br />
-saptofile<br />
-srvname=<br />
[,name]<br />
-tcpip<br />
-uselananum=<br />
[,]<br />
-userlist<br />
When you use this switch, the HASP License Manager<br />
creates the newhaddr.dat file. This file contains the node<br />
address of the station running the HASP License<br />
Manager.<br />
Assign one or more IPX, TCP/IP or NetBIOS names<br />
to the HASP License Manager. You can assign up to<br />
six names for IPX and TCP/IP or one name for<br />
NetBIOS.<br />
Force the <strong>HASP4</strong> Net system to listen only to the<br />
TCP/IP protocol. With the <strong>HASP4</strong> Net License<br />
Manager for Win32, you can still load other protocols<br />
by using either the -ipx or -netbios switch or both.<br />
Instruct the HASP License Manager to listen to<br />
specific lana numbers.<br />
Limits or increases the maximum number of users<br />
that are served by the HASP License Manager.<br />
Default value is 250.<br />
238 © Aladdin Knowledge Systems, 2002<br />
Novell<br />
yes<br />
Windows<br />
yes yes yes<br />
yes<br />
yes<br />
yes<br />
Mac
Using HASP in a Network Managing <strong>HASP4</strong> Net Licenses<br />
Settings in nhsrv.ini Configuration File<br />
Search Order<br />
To configure the HASP License Manager you can use the<br />
configuration file nhsrv.ini. A copy of nhsrv.ini is included with the<br />
HASP utilities.<br />
You can place nhsrv.ini and the executable of the HASP License<br />
Manager in the same directory or in any other location in<br />
accordance with the nhsrv.ini search order described in the table<br />
below.<br />
Table 19.2 Search Order for nhsrv.ini<br />
Operating System Search Order<br />
Windows 95/98/ME Executable file directory<br />
Current directory<br />
Windows system directory<br />
Windows directory<br />
Path<br />
Windows NT4/2000/XP Executable file directory<br />
Current directory<br />
Windows system directory<br />
Windows directory<br />
Path<br />
Novell Current directory<br />
Mac Current directory. You can set a name<br />
and the path for the configuration file<br />
using the -c switch.<br />
Keywords in [NHS_SERVER] Section<br />
Modify the keywords in the [NHS_SERVER] section of the<br />
nhsrv.ini file to customize the HASP License manager according to<br />
your needs.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 239
Managing <strong>HASP4</strong> Net Licenses Part 4 - Chapter 19<br />
nhs_ip_limit<br />
nhs_adapter<br />
HASP License Manager Installation API<br />
Installing with HaspLMInstall()<br />
Possible values ,,...<br />
Description Specify the range of stations the HASP<br />
License Manager serves. Applicable for the<br />
HASP License Manager for Win 32, Novell<br />
and Mac. For example: 10.1.1.1,10.1.1.*,<br />
10.1.1.1/32, 10.1.1.1/24<br />
Possible values ,,...<br />
Description Specify the IP address of one or more<br />
network cards to which the HASP License<br />
Manager listens. Applicable only for the<br />
HASP License Manager for Win32.<br />
For example: 10.1.1.111-255.255.0.0<br />
The custom API provides a set of functions with which you can<br />
install and remove the HASP License Manager service.<br />
Purpose Installs and/or enters the correct registry settings for the HASP<br />
License Manager Windows NT service.<br />
Structure DWORD HaspLMInstall(<br />
DWORD InstallMode //Installation mode<br />
LPSTR LMPath //Path to HASP License Manager<br />
LPSTR CmdLineSwitches //Command-line switches<br />
);<br />
240 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Managing <strong>HASP4</strong> Net Licenses<br />
Parameters<br />
InstallMode<br />
Options<br />
InstallMode Sets the characteristics of the installation<br />
process.<br />
LMPath Full path to the location where the HASP<br />
License Manager program file nhsrvice.exe<br />
resides. It is used by the Service Control<br />
Manager to locate the HASP License Manager.<br />
If you pass a Null string, then the function uses<br />
the path to the DLL, appending the default<br />
name of the HASP License Manager executable,<br />
"nhservw32.exe".<br />
It is recommended that the path be to the file<br />
which on the HASP CD is found at:<br />
Utilities\Servers\Win32\Service\nhsrvice.exe.<br />
CmdLineSwitches Empty string or other string containing<br />
command-line switches used in loading the<br />
HASP License Manager. See "Switches for the<br />
HASP License Manager" (page 236).<br />
LM_SERVICE_INSTALL Installs the HASP License Manager as<br />
a Windows NT service.<br />
LM_SERVICE_START While LM_SERVICE_INSTALL<br />
installs the HASP License Manager as<br />
a Windows NT service, this option<br />
enables you to run the HASP License<br />
Manager without reboot. Call<br />
HaspLMInstall() with this parameter<br />
after you first call with<br />
LM_SERVICE_INSTALL, or call this<br />
parameter ORED<br />
LM_SERVICE_INSTALL.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 241
Managing <strong>HASP4</strong> Net Licenses Part 4 - Chapter 19<br />
Return Values If successful, the function returns the value LM_SUCCESS. If it<br />
failed, the function returns the value LM_FAIL. You can retrieve<br />
the error details by calling HaspLMLastError().<br />
Special<br />
Considerations<br />
Removing with HaspLMRemove()<br />
This function does not copy HASP License Manager files.<br />
Purpose Removes the registry settings for the HASP License Manager<br />
service or uninstalls the service.<br />
Structure DWORD HaspLMRemove(<br />
Parameters<br />
RemoveMode<br />
Options<br />
);<br />
Return Values If successful, the function returns the value LM_SUCCESS. If it<br />
failed, the function returns the value: LM_FAIL. You can retrieve<br />
the error details by calling HILastErrorEx().<br />
Special<br />
Considerations<br />
DWORD RemoveMode //Removal mode<br />
LPSTR LMPath //For future use<br />
RemoveMode Sets the characteristic of removal process.<br />
LMPath For future use. Currently, the value is NULL.<br />
LM_REMOVE_<br />
SERVICE<br />
LM_REMOVE_<br />
SERVICE_UNLOAD<br />
Removes the HASP License Manager<br />
Windows NT service.<br />
Removes the HASP License Manager<br />
Windows NT service from memory. The<br />
service remains installed and will run again<br />
upon the next restart.<br />
Removing the HASP License Manager Windows NT service sends<br />
a command to the HASP License Manager to close if it is running.<br />
242 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Managing <strong>HASP4</strong> Net Licenses<br />
Displaying Information with HaspLMInfo()<br />
Purpose Receives information related to the installed<br />
HASP License Manager Windows NT service and other general<br />
information.<br />
Structure DWORD HaspLMInfo(<br />
Parameters<br />
LPLMINFO lpLMInfo, //Address of structure of information<br />
);<br />
lpLMInfo Points to a LMINFO structure that receives<br />
information relating to the installed HASP<br />
License Manager service.<br />
Return Values If successful the function returns the value LM_SUCCESS. If<br />
failed the function returns the value: LM_FAIL. You can retrieve<br />
the error details by calling HILastErrorEx().<br />
Requesting Status with HaspLMLastError()<br />
Purpose Retrieves information about the last call to one of the<br />
HASP License Manager API functions.<br />
Structure DWORD HaspLMLastError(<br />
DWORD *System Error //Address of location of system error<br />
LPSTR ErrorStr //Address of error description buffer<br />
DWORD ErrorStrSize //Size of error description buffer<br />
);<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 243
Managing <strong>HASP4</strong> Net Licenses Part 4 - Chapter 19<br />
Parameters<br />
Return Values If successful, the function returns the value LM_SUCCESS. If it<br />
failed, the function returns the value LM_FAIL.<br />
Error Messages<br />
*System Error Points to a variable containing the system<br />
error number.<br />
ErrorStr Points to a buffer to receive the last error<br />
description of the HASP License Manager<br />
Windows NT service.<br />
ErrorStrSize Size of ErrorStr buffer (in bytes).<br />
The HASP LM Installation functions return the following error<br />
messages:<br />
Table 19.3 HASP LM Installation API Error Codes<br />
Error Description<br />
CLOSE_KEY_FAIL Failed to close the key.<br />
CLOSE_SERVICE_FAIL Failed to close the service.<br />
CLOSE_SERVICE_MANAGER_FAIL Failed to close the service database manager.<br />
CONTROL_SERVICE_FAIL Failed to control the service<br />
CREATE_SERVICE_FAIL Failed to create the service.<br />
DELETE_SERVICE_FAIL Failed to delete the service<br />
FREE_LIB_FAIL Failed to free the DLL.<br />
GET_DATE_FAIL Failed to get date.<br />
GET_PROC_ADDR_FAIL Failed to get an address from the DLL.<br />
INVALID_PARAM Invalid parameter.<br />
LOAD_LIB_FAIL Failed to load the DLL.<br />
OPEN_KEY_FAIL Failed to open the key.<br />
244 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Managing <strong>HASP4</strong> Net Licenses<br />
Error Description<br />
OPEN_SERVICE_FAIL Failed to open the service.<br />
OPEN_SERVICE_MANAGER_FAIL Failed to open the service database manager.<br />
SERVICE_NOT_SUPPORTED This service is not supported.<br />
SET_VALUE_FAIL Failed to set a value.<br />
START_SERVICE_FAIL Failed to start the service.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 245
Part 4 - Chapter 20<br />
Configuring<br />
<strong>HASP4</strong> Net Clients<br />
This chapter describes how an application protected for<br />
<strong>HASP4</strong> Net - the <strong>HASP4</strong> Net client - can be configured with a<br />
configuration file.<br />
If the client finds its respective configuration file, it reads the file<br />
and uses the information. If not, default values are used.<br />
In the <strong>HASP4</strong> Net client configuration file you can fine-tune how<br />
the <strong>HASP4</strong> Net client searches for the HASP License Manager.<br />
The default filename of the <strong>HASP4</strong> Net configuration file is<br />
nethasp.ini. A copy of nethasp.ini is included with the HASP utilities<br />
and also with each HASP API. If you want to change the name,<br />
you need to implement the new name when protecting the<br />
application with HASP Envelope or the HASP API.<br />
Search Sequence for Configuration File<br />
The search sequence for the file depends on the operating system<br />
and the type of application.<br />
The protected application searches for the configuration file when<br />
the first <strong>HASP4</strong> Net service is accessed. It searches for the <strong>HASP4</strong><br />
Net client configuration file in the following locations:<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 247
Configuring <strong>HASP4</strong> Net Clients Part 4 - Chapter 20<br />
Table 20.1 Search Order for Configuration File<br />
Application Type/<br />
Operationg System<br />
Sections in the Configuration File<br />
The <strong>HASP4</strong> Net client configuration file consists of four sections,<br />
each of which is optional:<br />
[NH_COMMON] for general settings<br />
[NH_IPX] for the IPX protocol<br />
Search Sequence<br />
Win16 Current directory → Windows directory →<br />
Windows system directory → Executable<br />
file directory → Path<br />
Win32 Executable file directory → Current<br />
directory → Windows system directory →<br />
Windows directory → Path<br />
Mac OS 8.6, 9.1,<br />
Mac OS X (only<br />
Carbon applications)<br />
Current directory<br />
Mac OS X Current directory → Home directory of<br />
the current user → /etc directory<br />
Under Mac OS X, nethasp.ini is searched without a<br />
leading dot. If you are using a case-sensitive system on<br />
Mac OS X, make sure the filename nethasp.ini is in<br />
lowercase.<br />
[NH_NETBIOS] for the NetBios protocol<br />
[NH_TCPIP] for the TCP/IP protocol<br />
The [NH_COMMON] section contains global settings for all<br />
configuration file sections. Each of the other sections contains<br />
settings which fine-tune operations for the specific protocol.<br />
248 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Configuring <strong>HASP4</strong> Net Clients<br />
Specifying Keywords<br />
In each section, you can specify either general or section-specific<br />
keywords. If you set a general keyword in one of the three protocol<br />
sections, you override the setting in the [NH_COMMON] section<br />
(for that protocol only).<br />
Use the section-specific keywords to adjust additional settings for<br />
a particular protocol.<br />
API and Envelope settings override configuration file settings.<br />
Every line of the HASP configuration file you receive with the<br />
HASP software is preceded by a semicolon (;). To use a line,<br />
remove the semicolon. If you want to add comments, precede<br />
them with a semicolon.<br />
Names of <strong>HASP4</strong> Net configuration files and their<br />
keywords are not case-sensitive (except for the filename<br />
under Mac OS X if a case-sensitive file system is used).<br />
The following sections describe each section in the <strong>HASP4</strong> Net<br />
client configuration file. For each keyword, the possible values and<br />
a short description are included. When a default value exists, it is<br />
listed.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 249
Configuring <strong>HASP4</strong> Net Clients Part 4 - Chapter 20<br />
[NH_COMMON]<br />
Section-Specific Keywords for [NH_COMMON]<br />
nh_ipx<br />
Possible values enabled, disabled<br />
Description Use the IPX protocol.<br />
nh_netbios<br />
Possible values enabled, disabled<br />
Description Use the NetBIOS protocol.<br />
nh_tcpip<br />
Possible value enabled, disabled<br />
Description Use the TCP/IP protocol.<br />
General Keywords for [NH_COMMON]<br />
nh_session<br />
Possible values <br />
Description Set the maximum length of time during which<br />
the protected application tries to establish<br />
communication with the HASP License<br />
Manager.<br />
Default 2 seconds<br />
250 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Configuring <strong>HASP4</strong> Net Clients<br />
[NH_IPX]<br />
nh_send_rcv<br />
Possible values <br />
Description Set the maximum length of time for the HASP<br />
License Manager to send or receive a packet.<br />
Default 1 second<br />
Section-Specific Keywords for [NH_IPX]<br />
nh_use_bindery<br />
Possible values enabled, disabled<br />
Description: Use IPX with bindery. Ignored under Win32<br />
API. This switch replaces the older switch<br />
named NH_USE_SAP.<br />
Default: disabled<br />
nh_use_broadcast<br />
Possible values enabled, disabled<br />
Description Use the IPX Broadcast mechanism.<br />
Default enabled<br />
nh_bc_socket_num<br />
Possible values <br />
Description Set the socket number for the broadcast<br />
mechanism. The number is hexadecimal.<br />
Default 7483H<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 251
Configuring <strong>HASP4</strong> Net Clients Part 4 - Chapter 20<br />
nh_use_int<br />
nh_server_name<br />
nh_search_method<br />
nh_datfile_path<br />
General Keywords for [NH_IPX]<br />
Possible values 2F_NEW, 7A_OLD<br />
Description 2F_NEW means that the IPX protocol will use<br />
interrupt 2Fh ONLY. 7F_OLD means that the<br />
IPX protocol will use interrupt 7Ah ONLY.<br />
disabled<br />
Default 2F_NEW<br />
Possible values , ,...<br />
Description Communicate with the HASP License Manager<br />
with the specified name.<br />
Maximum: 6 names, up to 7 case insensitive<br />
characters each.<br />
Possible values localnet, internet<br />
Description Determine whether the protected application<br />
communicates with only HASP License<br />
Managers on the local network, or with any<br />
HASP License Manager on the internetwork.<br />
Default internet<br />
Possible values <br />
Description Specify the location of the HASP License<br />
Manager’s address file.<br />
252 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Configuring <strong>HASP4</strong> Net Clients<br />
nh_session<br />
Possible values <br />
Description Set the maximum length of time during which<br />
the protected application tries to establish<br />
communication with the HASP License<br />
Manager.<br />
Default 2 seconds<br />
nh_send_rcv<br />
Possible values <br />
Description Set the maximum length of time for the HASP<br />
License Manager to send or receive a packet.<br />
Default 1 second<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 253
Configuring <strong>HASP4</strong> Net Clients Part 4 - Chapter 20<br />
[NH_NETBIOS]<br />
Section-Specific Keywords for [NH_NETBIOS]<br />
nh_nbname<br />
Possible values <br />
Description Assign a name to the HASP License<br />
Manager.Maximum: 1 name, up to 8 characters<br />
(not case-sensitive).<br />
nh_uselananum<br />
Possible values <br />
Description Assign a lana number to be used as a<br />
communication channel.<br />
General Keywords for [NH_NETBIOS]<br />
nh_session<br />
Possible values <br />
Description Set the maximum length of time during which<br />
the protected application tries to establish<br />
communication with the HASP License<br />
Manager.<br />
Default 2 seconds<br />
nh_send_rcv<br />
Possible values <br />
Description Set the maximum length of time for the HASP<br />
License Manager to send or receive a packet.<br />
Default 1 second<br />
254 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Configuring <strong>HASP4</strong> Net Clients<br />
[NH_TCPIP]<br />
Section-Specific Keywords for [NH_TCPIP]<br />
nh_server_addr<br />
Possible values , <br />
Description Set IP addresses of all the HASP License<br />
Managers you want to search. Unlimited<br />
addresses and multiple lines are possible.<br />
nh_server_name<br />
nh_port_number<br />
nh_tcpip_method<br />
Possible address format examples include:<br />
IP address: 192.114.176.65<br />
Local hostname: ftp.aladdin.co.il<br />
Possible values , ,...<br />
Description Communicate with the HASP License Manager<br />
with the specified name(s). Maximum: 6 names,<br />
up to 7 characters each (not case-sensitive).<br />
Possible values <br />
Description Set the TCP/IP port number (optional).<br />
Default 475<br />
Possible values TCP, UDP<br />
Description Send a TCP packet or a UDP packet.<br />
Default UDP<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 255
Configuring <strong>HASP4</strong> Net Clients Part 4 - Chapter 20<br />
nh_use_broadcast<br />
Possible values enabled, disabled<br />
General Keywords for [NH_TCPIP]<br />
Description Use the UDP Broadcast mechanism.<br />
Default enabled<br />
nh_session<br />
Possible values <br />
Description Set the maximum length of time during which<br />
the protected application tries to establish<br />
communication with the HASP License<br />
Manager.<br />
Default 2 seconds<br />
nh_send_rcv<br />
Possible values <br />
Description Set the maximum length of time for the HASP<br />
License Manager to send or receive a packet.<br />
Default 1 second<br />
256 © Aladdin Knowledge Systems, 2002
Part 4 - Chapter 21<br />
Monitoring<br />
<strong>HASP4</strong> Net Licenses<br />
Aladdin Monitor permits centralized administration of the<br />
HASP License Manager applications and the <strong>HASP4</strong> Net keys.<br />
The following options are available:<br />
Checking the properties of the HASP License Manager.<br />
Checking <strong>HASP4</strong> Net keys.<br />
Starting and stopping the HASP License Manager service.<br />
Aladdin Monitor is available for the following environments:<br />
Windows 98/ME, Windows NT/2000/XP. It can communicate<br />
via TCP/IP and IPX.<br />
Distributing Aladdin Monitor<br />
Supply your customers with Aladdin Monitor. The Aladdin<br />
Monitor comes with a online help file.<br />
You can configure Aladdin Monitor with a <strong>HASP4</strong> Net<br />
client configuration file, see "Configuring<br />
<strong>HASP4</strong> Net Clients" (page 247)<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 257
Monitoring <strong>HASP4</strong> Net Licenses Part 4 - Chapter 21<br />
Installing Aladdin Monitor<br />
You can install Aladdin Monitor on any station in the network. It<br />
is not necessary to install a HASP License Manager on the same<br />
station.<br />
To install Aladdin Monitor use the installation utility aksmon.exe.<br />
and follow the instructions of the installation wizard.<br />
Settings for Aladdin Monitor<br />
You can adapt the following program settings to meet your<br />
requirements:<br />
The language used (German or English).<br />
The refresh frequency for the dialog box (default setting every<br />
2 seconds).<br />
The frequency of network queries (default setting every 3<br />
minutes).<br />
If you want to use the Hardlock mode, the HASP mode or<br />
both.<br />
If you want to use the nethasp.ini configuration file.<br />
To change the settings, select Settings from the File menu. The<br />
changes become active after the program is restarted.<br />
258 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Monitoring <strong>HASP4</strong> Net Licenses<br />
Checking the Properties of<br />
HASP License Manager<br />
In the left-hand part of the window, click the<br />
HASP License Manager for which you want to check the login<br />
information.<br />
If HASP License Manager is not displayed, first doubleclick<br />
the HASP LM folder or refresh the view by<br />
selecting File/Rescan.<br />
The HASP License Manager information is displayed in the righthand<br />
part of the window.<br />
HASP License Managers listening to NetBIOS only are<br />
currently not recognized by Aladdin Monitor.<br />
The following information about the selected<br />
HASP License Manager is displayed:<br />
General information about the selected<br />
HASP License Manager (Table 21.1).<br />
Information about the <strong>HASP4</strong> Net keys being managed<br />
(Table 21.2).<br />
Table 21.1 HASP License Manager Information<br />
Box Meaning<br />
Name Name of the computer on which<br />
HASP License Manager is running.<br />
Version Version of the HASP License Manager.<br />
IP IP address of the computer<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 259
Monitoring <strong>HASP4</strong> Net Licenses Part 4 - Chapter 21<br />
Box Meaning<br />
Table 21.2 HASP Key Information<br />
Checking HASP Keys<br />
IPX IPX address of the computer<br />
LM Type Version of HASP License Manager<br />
TCP/IP,<br />
IPX<br />
Box Meaning<br />
Here, you can see which protocols are used.<br />
HASP # Cumulative number of the HASP key.<br />
HASP<br />
Model<br />
Current<br />
Stations<br />
Maximum possible number of licenses.<br />
Stations currently logged in.<br />
In the left-hand part of the window, click the HASP key for which<br />
you want to check the login information. The HASP key can only<br />
be checked, if a login has been performed.<br />
If the key is not displayed, first double-click the<br />
HASP License Manager which is making the key<br />
available, or refresh the view by selecting File/Rescan.<br />
The HASP information is displayed in the right-hand part of the<br />
window.<br />
The following information about the selected HASP key is<br />
displayed:<br />
General information about the HASP key (Table 21.3).<br />
An overview of the programs (Table 21.4).<br />
An overview of logins for the individual programs (Table 21.5).<br />
260 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Monitoring <strong>HASP4</strong> Net Licenses<br />
Table 21.3 HASP Information<br />
Box Meaning<br />
HASP # Cumulative number of the HASP key.<br />
Table 21.4 Program Table<br />
Box Meaning<br />
Program No. Number representing the protected program.<br />
Current Stations Stations currently logged in.<br />
Maximum Stations Maximum possible number of stations.<br />
Activations Maximum number of program activations.<br />
Table 21.5 Login Table<br />
Box Meaning<br />
No. Cumulative number of the login.<br />
Login ID Address under which the station logged in.<br />
Protocol Protocol used.<br />
<strong>Ti</strong>meout <strong>Ti</strong>me which must elapse without activity until<br />
the login entry is deleted or cancelled (in<br />
seconds).<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 261
Monitoring <strong>HASP4</strong> Net Licenses Part 4 - Chapter 21<br />
Starting and Stopping HASP License<br />
Manager as a Service<br />
Starting the Service<br />
Stopping the Service<br />
The HASP License Manager service enables you to administer<br />
<strong>HASP4</strong> Net keys on an NT workstation.<br />
You can use the Aladdin Monitor to start and stop the<br />
HASP License Manager service on the local computer.<br />
Select Start HASP LM Service in the HASP LM Service menu<br />
or the Services/HASP menu. Alternatively, you can use the<br />
traffic light symbol. The service is started and can now make<br />
available locally connected <strong>HASP4</strong> Net keys within the network.<br />
Alternatively, you can start the service using the context-sensitive<br />
menu. To do this, right-click the HASP LM folder and select<br />
Start HASP LM.<br />
Select Stop HASP LM Service in the HASP LM Service menu<br />
or the Services/HASP menu. Alternatively, you can use the<br />
traffic light symbol.<br />
The service is stopped. The view is then refreshed. This may take<br />
some time since it involves searching through the entire network.<br />
Alternatively, you can stop the service using the context-sensitive<br />
menu. To do this, right-click the HASP LM folder and select Stop<br />
HASP LM.<br />
262 © Aladdin Knowledge Systems, 2002
Part 5 - Chapter 22<br />
Adapting <strong>HASP4</strong> Net<br />
to the Network<br />
Defining the Range of Stations under<br />
IPX<br />
This section describes additional HASP License Manager switches<br />
and nethasp.ini keywords you can use to further adjust the <strong>HASP4</strong><br />
Net system to your network environment.<br />
With IPX, you can allow specific stations on a different segment to<br />
access the HASP License Manager.<br />
To allow access from a different segment:<br />
1. Load the HASP License Manager with the -ipxnosap switch.<br />
This ensures that the address of the HASP License Manager is<br />
not advertised using the SAP mechanism, and is advertised in<br />
the <strong>HASP4</strong> Net address file newhaddr.dat.<br />
2. Edit the nethasp.ini file as follows:<br />
In the [NH_COMMON] section, set NH_IPX = Enabled<br />
In the [NH_IPX] section, set NH_USE_BROADCAST =<br />
Disabled<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 263
Adapting <strong>HASP4</strong> Net to the Network Part 5 - Chapter 22<br />
In the [NH_IPX] section, set NH_USE_BINDERY =<br />
Disabled<br />
These settings instruct the protected application running on<br />
stations in the range to search for the address file and read the<br />
address of the HASP License Manager.<br />
3. Copy the protected application and the nethasp.ini file to the<br />
same directory. Make sure that each station in the range, and<br />
only stations in the range, load the application from this<br />
directory.<br />
Defining the Range of Stations under<br />
TCP/IP<br />
There are two methods to define the range of stations under TCP/<br />
IP. You can either specify the range of stations that the HASP<br />
License Manager serves, or you can specify that the range of<br />
stations search for a particular HASP License Manager.<br />
Specifying the Range Using nhsrv.ini<br />
The HASP License Managers for Windows and Win32 can read a<br />
configuration file - nhsrv.ini. You can edit this file to specify the<br />
range of stations the HASP License Manager serves under TCP/<br />
IP.<br />
To specify the range of stations, edit the nhsrv.ini<br />
file as follows:<br />
In the [NHS_SERVER] section, NHS_IP_LIMIT = <br />
[,
Using HASP in a Network Adapting <strong>HASP4</strong> Net to the Network<br />
The HASP License Manager serves only the station with the<br />
specified IP address.<br />
10.1.2.*<br />
The HASP License Manager serves only stations that match the<br />
specified IP address mask, i.e. 10.1.2.0 through 10.1.2.255.<br />
10.1.*.*<br />
The HASP License Manager serves only stations that match the<br />
specified IP address mask, i.e. 10.1.0.0 through 10.1.255.255.<br />
Note that you can also exclude certain addresses by using the !<br />
notation. For example, you can write !10.1.2.7.<br />
To allow only some of the stations to access the<br />
<strong>HASP4</strong> Net in a TCP/IP-based network:<br />
1. Edit nhsrv.ini and set the range of stations.<br />
2. Copy nhsrv.ini to a location accessible by the HASP License<br />
Manager.<br />
Specifying the Range Using nethasp.ini<br />
You can edit the <strong>HASP4</strong> Net configuration file to specify the<br />
HASP License Manager (according to address) for which a range<br />
of stations searches.<br />
To specify the HASP License Manager for which a<br />
range of stations searches:<br />
1. Edit the nethasp.ini file: In the [NH_TCPIP] section, set<br />
NH_SERVER_ADDRESS= <br />
2. Copy the nethasp.ini to a location accessible only to the desired<br />
range of stations.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 265
Adapting <strong>HASP4</strong> Net to the Network Part 5 - Chapter 22<br />
Defining the Range of Stations under<br />
NetBIOS<br />
To allow only some of the stations to access the<br />
key in a NetBIOS-based network:<br />
1. Load the HASP License Manager with the -nbname switch set<br />
to a name of your choice (up to 8 characters, not case-sensitive).<br />
This defines the NetBIOS name of the HASP License<br />
Manager.<br />
For example, to load haspserv.exe and define the NetBIOS name<br />
of the station as firstsrv, enter:<br />
haspserv -nbname = firstsrv<br />
2. Edit the nethasp.ini file:<br />
In the [NH_COMMON] section, set NH_NETBIOS =<br />
Enabled<br />
In the [NH_NETBIOS] section, set NH_NBNAME =<br />
firstsrv<br />
This links the stations to the NetBIOS name.<br />
3. Copy the protected application and the nethasp.ini file to the<br />
same directory. Make sure that each station in the range, and<br />
only stations in the range, load the application from this<br />
directory.<br />
You cannot have two stations with the same NetBIOS<br />
name. If you want to load the HASP License Manager<br />
on more than one station, you must define a different<br />
NetBIOS name for each HASP License Manager.<br />
266 © Aladdin Knowledge Systems, 2002
Using HASP in a Network Adapting <strong>HASP4</strong> Net to the Network<br />
Adapting the <strong>Ti</strong>meout Length<br />
The HASP License Manager cannot serve more than one request<br />
at a time. The timeout length determines how long a protected<br />
application repeatedly tries to access the HASP License Manager<br />
before giving up.<br />
In almost all networks, the default timeout values are sufficient, so<br />
you only need to change the default values in networks that have a<br />
<strong>HASP4</strong> Net connected to a slow or busy station.<br />
To define the timeout length:<br />
In the appropriate section of the nethasp.ini file, set:<br />
NH_SESSION = <br />
NH_SEND_RCV = <br />
where m and n are measured in seconds. By default, m is 2<br />
seconds and n is 1 second.<br />
Defining the Number of Protected<br />
Applications Served<br />
With the HASP License Manager, you can change the default<br />
number of protected applications served. By default the HASP<br />
License Manager can serve a maximum of 250 (NLM) or 1000<br />
(Win32, Mac) protected applications.<br />
The HASP License Manager allocates memory space for the<br />
maximum number of protected applications. If necessary, you can<br />
save memory space by changing this default value.<br />
To change the default memory space allocation:<br />
Load the HASP License Manager with the switch:<br />
nhsrvw32 -userlist = n<br />
where n is the number of protected applications it serves.<br />
The -userlist switch is only available for Win32.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 267
Part 5<br />
Using the Remote<br />
Update System<br />
This part provides you with information on the Remote Update<br />
System, which enables you to update the memory of HASP keys<br />
already in your customers’ possession.<br />
The chapter "Remote Update System" (page 271) describes the<br />
RUS concept and relevant tools.<br />
The chapter "Remote Update System Win32 API" (page 291)<br />
contains information on the API which can be used to update keys<br />
remotely.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 269
Part 5 - Chapter 24<br />
Remote Update<br />
System<br />
The HASP Remote Update System (RUS) is an advanced utility<br />
for secure, remote updating of a customer’s HASP key(s).<br />
RUS enables you to update the memory of HASP keys already in<br />
your customers’ possession. You encrypt the additions and<br />
changes you make to the memory and then send them to your<br />
customer via telephone, fax or e-mail.<br />
Your revisions to the memory enable or modify the execution of<br />
software modules. For example, with the new parameters you set,<br />
the customers can upgrade a demo application to a fully licensed<br />
version.<br />
With RUS, you are able to update the memory of the <strong>HASP4</strong> M1,<br />
M4, <strong>Ti</strong>meHASP and <strong>HASP4</strong> <strong>Ti</strong>me models.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 271
Remote Update System Part 5 - Chapter 24<br />
Implementing RUS<br />
RUS Utilities<br />
Update Procedure<br />
Implementation of RUS involves the two following stages:<br />
Creating the RUS Utilities<br />
Updating your customer’s HASP<br />
With RUS, you create two utilities:<br />
Vendor utility<br />
Customer utility<br />
Keep the Vendor utility for use at your site and supply the<br />
Customer utility to your customer.<br />
To update the HASP, you and your customer each use your<br />
respective RUS utilities to update the HASP memory.<br />
To update the HASP memory:<br />
1. The customer uses the Customer utility to retrieve the ID<br />
number of the key which requires updating and informs you of<br />
the number.<br />
2. Enter the ID number and the updated data in the Vendor<br />
utility.<br />
3. Generate the RUS passwords in the Vendor utility, and supply<br />
them to your customer.<br />
4. Your customer enters the RUS passwords into the Customer<br />
utility and updates the memory of the HASP key.<br />
272 © Aladdin Knowledge Systems, 2002
Using the Remote Update System Remote Update System<br />
.<br />
The process of updating a customer's HASP key is<br />
completely secure. All data passed between you and<br />
your customer is randomly encrypted. In addition, RUS<br />
passwords are specific to the key for which they were<br />
generated, and cannot update any other key but that<br />
one.<br />
Stages of the Remote Update System<br />
The illustrations that follow display the two stages involved in the<br />
remote updating of HASP keys:<br />
Figure 24.1 Stage 1: Creating the RUS Utilities<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 273
Remote Update System Part 5 - Chapter 24<br />
Figure 24.2 Updating the HASP Memory<br />
274 © Aladdin Knowledge Systems, 2002
Using the Remote Update System Remote Update System<br />
Creating the RUS Utilities<br />
When you generate the two separate utilities - one for you and one<br />
for your customer - you use two RUS installation programs:<br />
vendinst.exe and custinst.exe.<br />
Specifically, vendinst.exe generates the Vendor utility, vendor.exe, and<br />
the custinst.exe generates the Customer utility, customer.exe.<br />
Both vendinst.exe and custinst.exe are located in the RUS directory.<br />
The RUS directory also contains two subdirectories. The IBM<br />
subdirectory contains BIN files needed to generate the RUS<br />
utilities for IBM computers and compatibles. The NEC<br />
subdirectory contains BIN files needed to generate the RUS<br />
utilities for Japanese NEC computers. When you generate the<br />
utilities, you copy the contents of the appropriate subdirectory to<br />
the RUS directory.<br />
Generating the RUS Utilities<br />
You should supply your customers with customer.exe and<br />
customer.hlp.<br />
When you generate the RUS utilities, make sure that the files<br />
vendinst.exe, vendor.bin, custinst.exe and customer.bin are located in the<br />
same directory:<br />
If you intend to run the RUS utilities on an IBM, copy the<br />
contents of the IBM subdirectory to the RUS root directory.<br />
If you intend to run the RUS utilities on an NEC computers,<br />
copy the contents of the NEC subdirectory to the RUS root<br />
directory.<br />
To generate the RUS utilities:<br />
1. Connect your application’s HASP key to your computer.<br />
2. Enter the following from the DOS command line to generate<br />
the Vendor utility:<br />
vendinst [target pc]<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 275
Remote Update System Part 5 - Chapter 24<br />
3. Enter the following from the DOS command line to generate<br />
the Customer utility:<br />
custinst [target pc]<br />
You have now generated the RUS utilities<br />
RUS Installation Parameters<br />
As the Vendor and Customer utilities are generated with<br />
passwords belonging to a specific HASP key (or a batch<br />
of keys with the same developer code), they are<br />
customized to update only this particular HASP key (or<br />
batch of keys).<br />
When you generate the RUS utilities from the DOS command<br />
line, specify the following parameters:<br />
password1, password2<br />
The passwords of the required HASP key.<br />
target pc<br />
An optional switch which specifies the type of computer on which<br />
the RUS utility is to run:<br />
Switch Function<br />
-ibm The target computer is an IBM PC or compatible. It<br />
is the default.<br />
-nec The target computer is a Japanese NEC computer.<br />
276 © Aladdin Knowledge Systems, 2002
Using the Remote Update System Remote Update System<br />
The Vendor Utility<br />
You use the Vendor utility to specify the new data for your<br />
customer’s HASP key.<br />
This new data is transferred in the form of RUS passwords which<br />
you generate and supply to your customer.<br />
Refer to "The Customer Utility" (page 286) to see how your<br />
customer later uses these RUS passwords to update the HASP key.<br />
Generating RUS Passwords<br />
To generate RUS passwords:<br />
1. Type the following DOS command line to activate vendor.exe:<br />
vendor<br />
The Vendor main screen appears:<br />
2. Click the arrow to the right of the HASP Type field and select<br />
your customer’s HASP model from the drop-down list.<br />
3. Enter the HASP ID number of your customer’s key in the ID<br />
Number field.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 277
Remote Update System Part 5 - Chapter 24<br />
This number is supplied to you by your customer, who uses the<br />
Customer utility to retrieve it. For more details, see "The<br />
Customer Utility" on page 286.<br />
4. Enter the data with which you want to update your customer’s<br />
key. There are two ways to enter data, FAS mode and Direct<br />
mode.<br />
Click FAS to enter new Full Authorization System (FAS)<br />
protection parameters. The screen displays the FAS<br />
parameters for the HASP model you selected. See the<br />
section below, "Entering Data in FAS Mode"for further<br />
instructions.<br />
Click Direct to edit the HASP memory. See the section<br />
below, "Entering Data in Direct Mode"for further<br />
instructions.<br />
During a single RUS session you can either enter FAS<br />
parameters or edit the key’s memory, but you cannot do both.<br />
5. Click Config if you want to use a configuration file. In the<br />
window that opens, you can:<br />
Save the parameters you have set to a configuration file.<br />
Type the filename, or choose a file by clicking Browse, and<br />
then click Save.<br />
Load previously saved parameters from a configuration file.<br />
Type the filename, or choose a file by clicking Browse, and<br />
then click Load.<br />
6. Click Generate to generate the RUS passwords and then OK<br />
to display the RUS passwords. There can be as many as 11 RUS<br />
passwords.<br />
You can save the RUS passwords to a file by checking Save<br />
RUS passwords to a File, entering the name of a file, and then<br />
clicking OK. This file can then be used with the Customer<br />
utility to load the RUS passwords automatically.<br />
278 © Aladdin Knowledge Systems, 2002
Using the Remote Update System Remote Update System<br />
Now supply the RUS passwords to your customer, who can then<br />
update the HASP key by using them with the Customer utility.<br />
Entering Data in FAS Mode<br />
With settings for the Full Authorization System (FAS), you can set<br />
the protection parameters of your program(s). See page 20 and<br />
page 159 for details on FAS.<br />
The following are the FAS parameters you can set in RUS:<br />
Program Number<br />
Each program is assigned its own number. If you are updating the<br />
protection parameters of a program, specify the number you<br />
previously assigned it. If you are adding a new program, give it a<br />
new number.<br />
You can set FAS parameters for only one<br />
program during a single RUS session. You<br />
generate RUS passwords separately for each<br />
program you update.<br />
Do not assign a value greater than the maximum number of<br />
programs which can be saved in the HASP key. The following is<br />
the range of numbers you can assign the different keys:<br />
1-16 for <strong>HASP4</strong> M1<br />
1-112 for <strong>HASP4</strong> M4<br />
1-8 for <strong>HASP4</strong> <strong>Ti</strong>me<br />
1-112 for <strong>HASP4</strong> Net<br />
Number of Authorized Activations<br />
This value is the maximum number of activations you allow a<br />
protected application. Enter a number of your choice in this field.<br />
Alternatively, enter U to authorize an unlimited number of<br />
activations. You can specify this parameter when using <strong>HASP4</strong><br />
M1, M4 and <strong>HASP4</strong> Net.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 279
Remote Update System Part 5 - Chapter 24<br />
Expiry Date<br />
This parameter, which is relevant only for the <strong>HASP4</strong> <strong>Ti</strong>me keys,<br />
indicates the date after which the protected program cannot run.<br />
Enter two-digit numbers for the day, month and year of the<br />
application’s expiry date. Type “00-00-00” if you want to set an<br />
unlimited expiry date.<br />
Number of Authorized Stations<br />
This parameter, which is relevant only for the <strong>HASP4</strong> Net keys,<br />
indicates the number of stations authorized to run the protected<br />
application at the same time.<br />
Assign a value no greater than the maximum number of stations<br />
supported by your customer’s <strong>HASP4</strong> Net model (i.e., 5 for<br />
<strong>HASP4</strong> Net5, and 10 for <strong>HASP4</strong> Net10 etc.). If you have a<br />
<strong>HASP4</strong> NetU, you can enter U to authorize an unlimited number<br />
of stations.<br />
Entering Data in Direct Mode<br />
When you enter data in Direct mode, you can edit up to 16<br />
consecutive memory cells.<br />
The Edit Memory in Direct Mode screen appears as follows:<br />
Enter data in the following fields:<br />
280 © Aladdin Knowledge Systems, 2002
Using the Remote Update System Remote Update System<br />
Start Address<br />
At this address, you begin updating the HASP memory. Enter a<br />
decimal value. Do not leave this field empty.<br />
Data Cells<br />
The 16 data cells are displayed in three modes (Characters,<br />
Decimal, and Hexadecimal), each in a separate pane. Enter data<br />
in any one of the three panes in the format of that pane.<br />
Entering data in one pane updates simultaneously the<br />
corresponding cells in the other panes with analogous values.<br />
To move between panes, click the mouse on any one of the cells in<br />
the desired pane.<br />
You can enter data in fewer than 16 cells. However, do<br />
not leave an empty memory cell between any two cells<br />
containing values.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 281
Remote Update System Part 5 - Chapter 24<br />
Activating the Vendor Utility with Switches<br />
Using DOS command line switches can save you time and<br />
keystrokes. Switches also enable you to execute the Vendor utility<br />
from batch files or from within your own applications without<br />
going through the utility screens.<br />
Vendor Utility Command-Line Switches<br />
The following table lists the command-line switches and a brief<br />
description of each. You can use the full string of a switch or its<br />
brief notation represented by the upper-case characters contained<br />
within the string. For example, you can enter either -HT or -<br />
HaspType.<br />
Table 24.1 Vendor Utility Command Line Switches<br />
Switch Function<br />
-Help Displays a list of all switches and a brief explanation of each.<br />
-HaspType Enter the type of HASP key your customer uses.<br />
Possible values are:<br />
memoFor <strong>HASP4</strong> M1, M4 keys<br />
time For <strong>HASP4</strong> <strong>Ti</strong>me<br />
netFor <strong>HASP4</strong> Net keys<br />
-IDnum <br />
-CfgFile <br />
The hexadecimal value of the customer's HASP ID number.<br />
The full path and name of a configuration file in which some or<br />
all of the parameters set in the Vendor utility were previously<br />
saved.<br />
-DiRect Indicate that the data is entered in Direct mode.<br />
-Fas The data with which you set FAS parameters.<br />
-GenPassFile The name of the file to which you save the RUS passwords.<br />
-PrgNum <br />
The number you assign the program.<br />
282 © Aladdin Knowledge Systems, 2002
Using the Remote Update System Remote Update System<br />
Switch Function<br />
-STations <br />
-ACtivations <br />
The number of stations authorized to activate a program. This<br />
FAS parameter is relevant to <strong>HASP4</strong> Net keys only.<br />
The maximum number of activations for a program. Enter U to<br />
allow an unlimited number of activations. This FAS parameter is<br />
applicable to <strong>HASP4</strong> M1, M4 and <strong>HASP4</strong> Net keys.<br />
-ExpDate The program’s expiry date. Enter 00-00-00 to set an unlimited<br />
expiry date. This FAS parameter is relevant only to <strong>HASP4</strong> <strong>Ti</strong>me.<br />
-StartAddr The start address for editing memory in Direct mode.<br />
-DataD<br />
..<br />
-DataH<br />
..<br />
Up to 16 decimal values with which you edit the HASP memory.<br />
Up to 16 hexadecimal values with which to edit the HASP<br />
memory.<br />
-DataS The number of characters (up to 32 for <strong>HASP4</strong> M1, M4 and<br />
<strong>HASP4</strong> Net keys, and up to 16 for <strong>HASP4</strong> <strong>Ti</strong>me) with which to<br />
update the HASP memory. Enter the string using quotation<br />
marks.<br />
-BatcH Runs the Vendor utility in batch mode without entering the utility<br />
screens.<br />
Sample Use of Command Line Switches<br />
The following examples demonstrate the activation of the Vendor<br />
utility from the command line:<br />
vendor -bh -ht memo -id 7a37381e -f -pn 5 -ac u -gpf<br />
ruspass.txt<br />
Run the Vendor utility (vendor) in batch mode (-bh) without<br />
entering the utility screen. The customer’s key which requires<br />
updating is a <strong>HASP4</strong> M1, M4 (-ht memo), whose ID number<br />
is 7a37381e (-id 7a37381e). Update it using FAS (-f), setting for<br />
program number 5 (-pn 5) an unlimited number of authorized<br />
activations (-ac u). Generate the RUS passwords, saving them<br />
to a file named ruspass.txt (-gpf ruspass.txt)<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 283
Remote Update System Part 5 - Chapter 24<br />
The file ruspass.txt can be used in conjunction<br />
with the Customer utility to load the RUS<br />
passwords automatically.<br />
vendor -ht net -dr -dd 12 15 25<br />
Run the Vendor utility (vendor) to update a <strong>HASP4</strong> Net (-ht<br />
net). Edit the memory (-dr) so that the first three memory cells<br />
(-dd) receive 12, 15, and 25 as decimal values. (The character<br />
and hexadecimal data fields receive the corresponding values<br />
automatically.)<br />
Vendor Utility Error Codes<br />
The Vendor utility returns the DOS error level codes listed in the<br />
table below:<br />
Table 24.2 Vendor Utility Error Codes<br />
Code Description<br />
2, 5 Invalid/missing ID number<br />
3, 4 Invalid/missing Hasp key type<br />
7, 8 Invalid/missing program number for FAS<br />
9, 10 Invalid/missing number of authorized activations for<br />
FAS<br />
11, 12 Invalid/missing number of authorized stations<br />
13, 14, 16 Invalid/missing start address<br />
15, 20 Invalid/missing data arguments<br />
17, 18 Data argument is out of range<br />
22 Missing data string<br />
23, 24 Data string is too long<br />
25 Only one data switch may be entered (DataD, DataH,<br />
or DataS)<br />
284 © Aladdin Knowledge Systems, 2002
Using the Remote Update System Remote Update System<br />
Code Description<br />
26, 27 Invalid/missing expiry date for FAS<br />
29 Impossible to use CfgFile switch from within a<br />
configuration file<br />
30 Missing configuration file name<br />
31, 35 Error opening/reading configuration file<br />
32, 39 Cannot create/missing RUS passwords file<br />
33 Out of memory when reading file<br />
34 This is not a Vendor utility configuration file<br />
36 Missing data entry mode (FAS/Direct)<br />
40 Too many data words<br />
41 Invalid switch<br />
52 Invalid ID number<br />
55, 56 Cannot use FAS switches for direct mode and vice<br />
versa<br />
59 The range for activations is 0-65534, or U for<br />
unlimited<br />
60 The range for stations is 1-65534, or U for unlimited<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 285
Remote Update System Part 5 - Chapter 24<br />
The Customer Utility<br />
In order for your customers to be able to update the HASP key,<br />
you must supply them with the Customer utility, customer.exe. The<br />
following instructions explain how customers should install the<br />
utility at their worksites.<br />
You should supply these instructions to your customers together<br />
with the help file customer.hlp.<br />
Using the Customer Utility<br />
When you or your customer use the Customer utility, there are two<br />
main steps:<br />
Retrieving the HASP ID number<br />
Updating the HASP key<br />
Retrieving your HASP ID Number<br />
In this step, you check the ID number of your HASP key, and<br />
supply that number to your vendor.<br />
To retrieve the HASP ID number:<br />
1. Connect your HASP key to the computer.<br />
2. From the DOS command line enter:<br />
customer<br />
The customer utility main screen appears.<br />
3. Click Get ID to retrieve the HASP ID number (and to see the<br />
HASP type).<br />
The HASP ID number screen appears, displaying the HASP ID<br />
number and HASP type:<br />
286 © Aladdin Knowledge Systems, 2002
Using the Remote Update System Remote Update System<br />
4. If you want to save these two parameters to a configuration file,<br />
click Save and enter the name of the file, or click Browse and<br />
choose a file from your directories, and then click OK.<br />
Supply your vendor with your key’s ID number and HASP type<br />
either by reporting them directly or by sending the configuration<br />
file. With this data, the vendor can generate the RUS passwords<br />
you need to update your HASP key.<br />
Updating your HASP Key with RUS Passwords<br />
In this step, you get the RUS passwords from your vendor. These<br />
passwords contain the data which will be saved to the HASP key’s<br />
memory.<br />
To update your HASP key with RUS passwords:<br />
1. Connect the HASP key to the computer.<br />
2. From the DOS command line enter:<br />
customer<br />
The Customer utility main screen appears.<br />
3. Enter the RUS passwords you received from your vendor into<br />
the Customer utility either:<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 287
Remote Update System Part 5 - Chapter 24<br />
By clicking Manual and typing the passwords in the<br />
following screen:<br />
By clicking Config, typing the name of the configuration<br />
file containing the RUS passwords (or clicking Browse to<br />
find it) and clicking OK. This procedure loads the<br />
passwords automatically from a configuration file supplied<br />
by your vendor.<br />
The RUS passwords are displayed.<br />
4. Click Update after the passwords have been entered or loaded<br />
from the configuration file in order to update your HASP key.<br />
Activating the Customer Utility with Switches<br />
Using DOS command line switches can save you time and<br />
keystrokes. Switches also enable you to execute the Customer<br />
utility from batch files or from within your own applications<br />
without going through the utility screens.<br />
Customer Utility Command-Line Switches<br />
The following is a list of the command line switches and a brief<br />
description of each. You can use the full string of a switch or its<br />
brief notation represented by the upper-case characters contained<br />
within the string. For example, you can enter -UP or -UPdate.<br />
288 © Aladdin Knowledge Systems, 2002
Using the Remote Update System Remote Update System<br />
Table 24.3 Customer Utility Command Line Switches<br />
Switch Function<br />
-Help Displays a list of all the switches with a brief explanation of<br />
each.<br />
-GetId Displays the HASP ID Number.<br />
-VenFile Name of a file to which the HASP ID number will be saved.<br />
-UPdate .. Updates the HASP key by means of the specified RUS<br />
passwords. There can be up to 11 passwords.<br />
-CfgFile <br />
Name of the configuration file containing the RUS passwords.<br />
-BatcH Runs the Customer utility in batch mode without entering the<br />
utility screens.<br />
-NoBatch Disables batch mode (for instance, when loading the RUS<br />
passwords from a configuration file).<br />
Sample Use of Command Line Switches<br />
The following examples demonstrate the activation of the<br />
Customer utility from the command line:<br />
customer -bh -cf ruspass.txt<br />
Run the Customer utility (customer) in batch mode (-bh)<br />
without entering the utility screen. Update the HASP key by<br />
retrieving the RUS passwords from a configuration file named<br />
ruspass.txt (-cf ruspass.txt).<br />
customer -cf ruspass.txt -nb<br />
Run the Customer utility (customer). Enter the utility screen (nb)<br />
and update the HASP by retrieving the RUS passwords<br />
from a configuration file named ruspass.txt (-cf ruspass.txt).<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 289
Remote Update System Part 5 - Chapter 24<br />
Customer Utility Error Codes<br />
The Customer utility returns the DOS error level codes listed in<br />
the table below:<br />
Table 24.4 Customer Utility Error Codes<br />
Code Description<br />
1, 2 Invalid/missing RUS passwords<br />
4 Missing configuration file name<br />
6 Error opening configuration file<br />
7 Not a legal configuration file<br />
8 Out of memory reading configuration file<br />
12 Incorrect HASP key is connected<br />
13 Impossible to generate file without ID number<br />
14 Missing filename for saving the ID number<br />
18 Error opening/creating file for saving ID number<br />
19 Invalid switch<br />
101 HASP key not found<br />
104 Wrong HASP ID number<br />
106 Invalid start address<br />
107 Too many data words<br />
108 Incorrect RUS passwords<br />
109 Error reading from HASP memory<br />
290 © Aladdin Knowledge Systems, 2002
Part 5 - Chapter 25<br />
Remote Update<br />
System Win32 API<br />
With RUS Win32 API you can remotely update the memory of<br />
<strong>HASP4</strong> M1, M4, <strong>HASP4</strong> <strong>Ti</strong>me and <strong>HASP4</strong> Net keys. The update<br />
generates a secure set of strings which can be sent to the user, to<br />
be interpreted by a specified key. The following components are<br />
relevant when updating HASP keys using this interface. The RUS<br />
API directory on the HASP CD contains the following files:<br />
haspdev.dll<br />
Dynamic Link Library for the vendor. This library offers two<br />
different functions to create update strings for HASP keys: one for<br />
a general memory update, the second for a FAS memory update.<br />
haspclnt.dll<br />
Dynamic Link Library for the customer. This library offers two<br />
different functions that are relevant for updating HASP keys: one<br />
for integrating memory updates into the customer's HASP keys,<br />
the second for retrieving the IDs of HASP keys.<br />
Customization Utility<br />
The customization utility (confdll.exe) is a command line<br />
application for integrating HASP passwords into the customer<br />
DLL, haspclnt.dll, and spawning the HASP Envelope.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 291
Remote Update System Win32 API Part 5 - Chapter 25<br />
Implementing RUS<br />
Sample Applications<br />
The Win32 API is released with sample applications to help you<br />
implement the Win32 RUS into your application.<br />
The following sections describe how to implement the Win32 API<br />
into your application and how to perform updates using the<br />
Win32 API.<br />
Before updating HASP keys using the Win32 RUS API, you<br />
should familiarize with the RUS concepts. To do this, take a closer<br />
look at the sample applications provided.<br />
Implementation of Win32 RUS involves the following stages:<br />
Stage 1: Preparing Your Application for RUS<br />
1. Customize the haspclnt.dll with your HASP passwords. The<br />
customized DLL can be shipped together with your<br />
application. See page 299, Customization Utility.<br />
2. Implement the RUS update client routines into your<br />
application. See sample applications.<br />
Stage 2: Performing Updates<br />
1. Use the haspclnt.dll (customer DLL) to retrieve the ID number<br />
of the key to be updated.<br />
2. Use the haspdev.dll from your production environment to<br />
create the necessary update strings.<br />
Send the update data to your customer to enter it into the<br />
application.<br />
292 © Aladdin Knowledge Systems, 2002
Using the Remote Update System Remote Update System Win32 API<br />
Functions Provided in Vendor DLL<br />
RUS_CreateUpdateDirect<br />
Description<br />
Syntax<br />
The Dynamic Link Library hasdev.dll is the Win32 API for vendors.<br />
It provides the following two functions:<br />
signed int RUS_CreateUpdateDirect for general memory<br />
updates, and<br />
signed int RUS_CreateUpdateFAS for FAS memory updates.<br />
Both functions generate update strings, which is then sent to the<br />
customer for updating their HASP key memory.<br />
When using this function, no HASP key has to be connected.<br />
signed int RUS_CreateUpdateDirect (<br />
DWORD IdNum,<br />
int Password1,<br />
int Password2,<br />
int KeyType,<br />
int Address,<br />
int NumOfBytesToUpdate,<br />
char *MemoryImage,<br />
int CodeBufferSize,<br />
char *Code,<br />
void *sKey)<br />
Parameters Used<br />
IdNum ID number of the customer's HASP key. Enter the unique 32bit<br />
ID number of your customer's HASP key. If you want to<br />
generate data for keys without checking the ID number during<br />
the update process, enter 0. This will update all keys with the<br />
passwords specified below.<br />
Password1,<br />
Password2<br />
Passwords of the HASP keys to be updated.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 293
Remote Update System Win32 API Part 5 - Chapter 25<br />
KeyType Type of HASP key. Possible key types are <strong>HASP4</strong> M1, M4,<br />
<strong>HASP4</strong> Net or <strong>HASP4</strong> <strong>Ti</strong>me.<br />
Address Start address of HASP memory at which you begin updating<br />
the HASP memory.<br />
NumOfBytesToUpdate Number of bytes to be updated in the HASP memory.<br />
MemoryImage Pointer to the data you want to write to the HASP memory.<br />
CodeBufferSize Length of buffer provided.<br />
Code Pointer to the data area which is to hold the ASCIIZ (ASCII<br />
zero terminated string) string of generated codes.<br />
sKey Parameter (pointer) reserved for future use. Currently must be<br />
set to NULL.<br />
Return Values Please refer to the chapter “Return Values” below.<br />
294 © Aladdin Knowledge Systems, 2002
Using the Remote Update System Remote Update System Win32 API<br />
RUS_CreateUpdateFAS<br />
Description<br />
Syntax<br />
Parameters Used<br />
When using this function, no HASP key has to be connected.<br />
The function is available for <strong>HASP4</strong> Net, <strong>HASP4</strong> <strong>Ti</strong>me and<br />
<strong>HASP4</strong> M1, M4 keys.<br />
signed int RUS_CreateUpdateFAS (<br />
DWORD Idnum,<br />
int Password1,<br />
int Password2,<br />
int KeyType,<br />
int ProgramNumber,<br />
int Activations,<br />
int Year,<br />
int Month,<br />
int Day,<br />
int Stations,<br />
int CodeBufferSize,<br />
char *Code,<br />
void *sKey)<br />
IdNum ID number of the customer's HASP key. Enter the unique 32bit<br />
ID number of your customer's HASP key. If you want to<br />
generate data for keys without checking the ID number during<br />
the update process, enter 0. This will update all keys with the<br />
passwords specified below.<br />
Password1,<br />
Password2<br />
Passwords of the HASP keys to be updated.<br />
KeyType Type of HASP key. Possible key types are <strong>HASP4</strong> M1, M4,<br />
<strong>HASP4</strong> Net or <strong>HASP4</strong> <strong>Ti</strong>me.<br />
ProgramNumber Each program is assigned its own number. If you are updating<br />
the protection parameters of a program, specify the number<br />
you previously assigned it. If you are adding a new program,<br />
give it a new number.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 295
Remote Update System Win32 API Part 5 - Chapter 25<br />
Activations Number of authorized activations you allow a protected<br />
application. Relevant for updates of <strong>HASP4</strong> Net and <strong>HASP4</strong><br />
M1, M4 only. Set to 65535 to authorize an unlimited number of<br />
activations.<br />
Year, Month, Day Expiration date. Relevant for <strong>HASP4</strong> <strong>Ti</strong>me only. Note that the<br />
year must be given in the range 1992 - 2091. Set all values to 0<br />
for unlimited date.<br />
Stations Number of authorized stations. Relevant for <strong>HASP4</strong> Net only.<br />
This parameter indicates the number of stations authorized to<br />
run the protected application at the same time. Set to 0 to<br />
authorize an unlimited number of stations.<br />
CodeBufferSize Length of buffer provided.<br />
Code Pointer to the data area which is to hold the ASCIIZ string of<br />
generated codes.<br />
sKey Parameter (pointer) reserved for future use. Currently must be<br />
set to NULL.<br />
Return Values Please refer to the chapter “Return Values” below.<br />
296 © Aladdin Knowledge Systems, 2002
Using the Remote Update System Remote Update System Win32 API<br />
Functions Provided in Client DLL<br />
RUS_PerformUpdate<br />
Description<br />
Syntax<br />
The Dynamic Link Library HASPCLNT.DLL provides the<br />
following functions which are to be called on the PC with the<br />
corresponding key connected:<br />
signed int RUS_PerformUpdate to update the memory of the<br />
customer's HASP.<br />
signed int Get_KeyID to retrieve the ID of the connected<br />
HASP key.<br />
Before calling one of the above functions, the DLL must have<br />
been customized. See "Customization Utility" on page 301.<br />
This function updates the memory of one or more HASP keys.<br />
In case the update is ID-number dependent, the ID number,<br />
the key type and the passwords are checked for correctness.<br />
Otherwise, only the key type and the passwords are checked.<br />
signed int RUS_PerformUpdate (char *Code)<br />
Parameters Used<br />
Code ASCIIZ data string for update (generated using the<br />
corresponding function of the vendor DLL).<br />
Return Values<br />
Please refer to the chapter “Return Values” below.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 297
Remote Update System Win32 API Part 5 - Chapter 25<br />
Get_KeyID<br />
Description<br />
Syntax<br />
This function retrieves the ID number of the connected key.<br />
This function is similar to the corresponding HASP API<br />
function, but is provided in the DLL for completeness.<br />
signed int Get_KeyID (unsigned int *KeyID)<br />
Parameters Used<br />
KeyID Returns the ID of the key currently connected.<br />
Return Values Please refer to the chapter “Return Values” below.<br />
298 © Aladdin Knowledge Systems, 2002
Using the Remote Update System Remote Update System Win32 API<br />
Return Values<br />
General<br />
l<br />
SUCCESS The function was executed successfully.<br />
HASP_ERROR_IN_LOW_WORD Unexpected error occurred during a HASP call.<br />
The HASP API error code is returned in the low<br />
word.<br />
OPERATION_FAILED The operation isn’t performed successfully.<br />
DLL_NOT_CUSTOMIZED The Dynamic Link Library has not been<br />
customized.<br />
RUS ID<br />
HASP_NOT_FOUND The key could not be found<br />
UNDEFINED_HASP The HASP key<br />
HASP_3_DETECTED A HASP 3 key has been detected.<br />
BATTERY_DEAD_OR_MEMORY_<br />
CORRUPT<br />
The battery of the key doesn’t work or the memory<br />
is corrupt.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 299
Remote Update System Win32 API Part 5 - Chapter 25<br />
RUS Update<br />
INVALID_CODE The string specified in the Code parameter is not<br />
valid.<br />
INVALID_KEY_ID The update is ID-number dependent; the ID of the<br />
connected key does not match.<br />
KEY_NOT_FOUND No HASP key found with this password.<br />
KEY_TYPE_MISMATCH The connected HASP key does not match the<br />
specified key type.<br />
Memory Update<br />
BUFFER_TOO_SMALL The length of the buffer specified in the<br />
CodeBufferSize parameter is too small.<br />
ILLEGAL_MODULE_NUMBER The program number is out of range for the<br />
specified key type.<br />
INVALID_PARAMETER At least one input parameter is invalid, e.g.<br />
passwords not specified.<br />
ILLEGAL_KEYTYPE The type of key specified in the KeyType parameter<br />
is unknown.<br />
DETECTED_TAMPERING A manipulation of the license information has been<br />
detected.<br />
HASH_MEMORY_OVERFLOW The buffer which holds the hash is too small.<br />
300 © Aladdin Knowledge Systems, 2002
Using the Remote Update System Remote Update System Win32 API<br />
Customization Utility<br />
Syntax<br />
Example<br />
Each vendor generates a unique DLL with the necessary functions<br />
for remote key updates. This DLL contains the HASP passwords<br />
and is protected with the HASP Win32 Envelope against reverse<br />
engineering. To customize the DLL, a simple command line utility<br />
(confdll.exe) must used:<br />
confdll <br />
<br />
confdll.exe C:\demo\haspclnt.dll 15417 9632<br />
D:\demo\instw32.exe<br />
In the above example, the DLL will be customized with the HASP<br />
Demo passwords and secured using the win32 HASP Envelope<br />
engine, instw32.exe from the CD.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 301
Appendix A<br />
Troubleshooting<br />
The first part of this appendix offers a check-list that can help you<br />
solve some of the most common problems you might encounter<br />
when using HASP. The second part helps you by listing specific<br />
problems you or your customers may experience, along with the<br />
solutions.<br />
The HASP product line conforms to the highest standards of<br />
quality assurance. However, like any other PC peripheral device, it<br />
might not operate on certain PC configurations due to faulty<br />
equipment or improper installation. This appendix on<br />
troubleshooting can assist you if you encounter such a situation.<br />
To avoid difficulties, make sure you are using current HASP<br />
software versions. Contact your local HASP representative for the<br />
latest updates.<br />
If problems persist, check if the HASP sample, test and diagnostic<br />
applications work. Then, communicate the results to your local<br />
HASP representative.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 303
Appendix A: Troubleshooting<br />
Check List<br />
If one of your customers reports a problem, check the following<br />
list:.<br />
Does the same problem occur with another HASP?<br />
If not, then replace the faulty key with a new one.<br />
Is the HASP key connected properly to the parallel port?<br />
Is a printer connected to the HASP?<br />
If yes, and it works properly, disconnect the printer and check<br />
whether the HASP works without it.<br />
If it does, check the quality of the cable, and ensure it conforms<br />
to IEEE standards. This is often printed on to the cable itself.<br />
If the cable conforms to standards, but the HASP does not<br />
work properly, try to use or install a second parallel port for the<br />
HASP to circumvent any problem the printer may be causing.<br />
If the problem still occurs, try to replace the original printer<br />
card or use another parallel port.<br />
Is there a printing problem?<br />
If so, test with another printer on the same computer to<br />
determine whether the problem is printer-specific. Run hinstall<br />
with the switches -i -cnt=yes.<br />
Is the PC infected by a virus (which may be preventing the<br />
application from running properly)?<br />
Does the problem occur when the protected application runs<br />
on another PC of the same model?<br />
304 © Aladdin Knowledge Systems, 2002
Appendix A Troubleshooting<br />
Problems and Solutions<br />
Problem HASP is connected but the protected application cannot find it.<br />
Solution Although every effort has been made to ensure the highest level<br />
of communication, on rare occasions a call to the hasp( ) routine<br />
might not be activated or transmitted well. We recommend that<br />
you call the hasp( ) routine with a service several times before<br />
assuming the HASP is not connected.<br />
Problem You get printer errors when trying to print from a protected<br />
Windows application.<br />
Solution This situation is due to a conflict between printer access and<br />
HASP access. To avoid conflicts between HASP and other<br />
parallel devices (such as printers), install the HASP device driver.<br />
Problem A HASP is connected to the printer and Windows 3.x warns that<br />
the printer is inaccessible or that there is a device conflict.<br />
Solution 1. Select Main from the Program Manager.<br />
2. Select Control Panel.<br />
3. Select 386 Enhanced.<br />
4. Select LPT1 in the Device Contention frame and click Never<br />
Warn.<br />
5. Repeat step 4 for LPT2 and LPT3.<br />
6. Click OK.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 305
Appendix A: Troubleshooting<br />
Problem You try to use hinstall.exe to install the HASP device dHASP<br />
device driver under Windows NT but receive error 9121.<br />
Solution If you try to activate the Hinstall utility under Windows NT<br />
without administrator privileges, you receive this error. Make sure<br />
you have administrator privileges.<br />
Problem You try to activate a <strong>HASP4</strong> M1/M4-protected application under<br />
Windows NT/2000/XP and Windows 95/98/ME, but the<br />
application cannot find the key.<br />
Solution Make sure the HASP device driver is installed. If the problem<br />
persists when the HASP device driver is installed, run:<br />
hinstall -info<br />
The Hinstall utility displays the version number, installation date,<br />
and computer type. Contact your local HASP representative with<br />
the details of these parameters.<br />
Problem Your 16-bit application is protected with <strong>HASP4</strong> Net and the<br />
Envelope. Although the number of stations activating the<br />
application is less than the number of licenses issued, when an<br />
additional station tries to activate it, you receive a “too many<br />
users” error.<br />
Solution A 16-bit application, protected only with <strong>HASP4</strong> Net and the<br />
Envelope, does not perform a <strong>HASP4</strong> Net logout. When such an<br />
application terminates, it remains listed in the log table, and<br />
therefore the license is not released.<br />
Re-protect your application using the HASP API to perform a<br />
<strong>HASP4</strong> Net logout. This removes the application from the log<br />
table and frees the license.<br />
306 © Aladdin Knowledge Systems, 2002
Appendix A Troubleshooting<br />
Problem You protected an application for both stand-alone PCs and<br />
network environments by using <strong>HASP4</strong> M1/M4 and <strong>HASP4</strong> Net.<br />
Now you discover that one more station than the number you<br />
have licensed can activate the application.<br />
Solution This situation occurs because an application first tries to access<br />
the local port to find a <strong>HASP4</strong> M1/M4. If the developer codes of<br />
your <strong>HASP4</strong> M1/M4 and <strong>HASP4</strong> Net are the same, an<br />
application activated from the station with the <strong>HASP4</strong> Net<br />
connected finds the local <strong>HASP4</strong> Net. The application treats the<br />
local <strong>HASP4</strong> Net as if it were a stand-alone key and does not<br />
record the activation in the <strong>HASP4</strong> Net log table. Therefore, the<br />
application does not use a license.<br />
To avoid this situation, make sure the <strong>HASP4</strong> M1/M4 and<br />
<strong>HASP4</strong> Net have different developer codes.<br />
Problem Your <strong>HASP4</strong> Net-protected Windows application returns <strong>HASP4</strong><br />
Net LastStatus Error 21.<br />
Solution DOS extender and Windows applications require an average of 8<br />
KB of DOS memory. The <strong>HASP4</strong> Net API requires 1 KB of<br />
DOS memory.<br />
<strong>HASP4</strong> Net LastStatus Error 21 is issued when the amount of<br />
DOS memory is less than 1 KB and therefore insufficient for the<br />
<strong>HASP4</strong> Net system. In such cases, not only <strong>HASP4</strong> Net-protected<br />
applications, but other Windows applications are disabled.<br />
To solve this problem, either remove some TSRs or exit some<br />
open Windows applications. You would use the same solution<br />
with any application that complains about insufficient DOS<br />
memory.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 307
Appendix A: Troubleshooting<br />
Problem Your application is running on a station that does not have<br />
network drivers loaded. The station stops responding when the<br />
application performs a <strong>HASP4</strong> Net login.<br />
Solution This happens when the <strong>HASP4</strong> Net configuration file enables a<br />
specific protocol. The <strong>HASP4</strong> Net system tries to use the<br />
specified protocol without checking if it is actually present. If the<br />
station does not have the protocol drivers installed, it stops<br />
responding.<br />
The solution is to delete the <strong>HASP4</strong> Net configuration file. Or, if<br />
you need the <strong>HASP4</strong> Net configuration file, load the network<br />
drivers.<br />
Problem Accessing the parallel port causes the computer to hang.<br />
Solution Parallel ports of IBM PCs and compatibles are assigned to one of<br />
the following I/O ports: 3BCh, 378h, or 278h.<br />
Network cards usually take up 10h or 20h I/O ports<br />
consecutively from their base address.<br />
When the I/O port of a network card overlaps that of a parallel<br />
card, accessing the parallel port can cause the computer to stop<br />
responding. For example: printing, accessing software protection<br />
keys, and accessing peripherals connected to the parallel port may<br />
all cause the computer to hang.<br />
It is therefore essential to avoid overlapping the I/O ports by<br />
changing the I/O base of the network card.<br />
There are two ways to change a network card I/O base:<br />
Some network cards let you assign the I/O base with jumpers.<br />
See the documentation supplied with the card for a<br />
description of the jumper positions for a given I/O base.<br />
With newer cards, you can change the I/O base using the<br />
software supplied with the cards.<br />
308 © Aladdin Knowledge Systems, 2002
Appendix A Troubleshooting<br />
Problem Your <strong>HASP4</strong> Net-protected application is running on a Windows for<br />
Workgroups station in a Novell network using IPX and returns<br />
error 3.<br />
Solution The frame types in the net.cfg file and in the Windows network setup<br />
are not identical. Check the frame type in net.cfg and set an identical<br />
Windows frame type.<br />
To set the frame types in Windows:<br />
1. Choose Network Setup from the Control panel.<br />
2. Double click IPX/SPX Compatible Transport with NetBIOS.<br />
3. Select Frame Type.<br />
4. In the Value list box, select the desired frame type and click Set.<br />
5. Click OK.<br />
6. Restart your computer.<br />
Problem Your application takes a long time to find the <strong>HASP4</strong> Net on a<br />
large Novell network.<br />
Solution In this case, it is recommended to customize the search<br />
mechanism. Use the <strong>HASP4</strong> Net configuration file to disable the<br />
broadcast and bindery search mechanisms. By doing so, the<br />
<strong>HASP4</strong> Net client searches for the HASP License Manager using<br />
the address file mechanism, which is much faster.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 309
Appendix A: Troubleshooting<br />
Problem Your application takes a long time to find the <strong>HASP4</strong> Net on a<br />
large TCPIP network.<br />
Solution In this case, it is recommended to customize the search<br />
mechanism. Use the <strong>HASP4</strong> Net configuration file to specify the<br />
UDP or TCP search method and to set the IP address of the<br />
HASP License Manager. By doing so, the <strong>HASP4</strong> Net client<br />
searches for the HASP License Manager with the specified IP<br />
address, which is much faster.<br />
Problem You receive error 8 with <strong>HASP4</strong> Net.<br />
Solution Error 8 means that query reached the HASP License Manager, but<br />
that the <strong>HASP4</strong> Net client did not receive an answer back. To<br />
solve this, try increasing the time frame in which the <strong>HASP4</strong> Net<br />
client waits for the answer. Do so by increasing the timeout length<br />
in the <strong>HASP4</strong> Net configuration file.<br />
Problem You receive error 15 with <strong>HASP4</strong> Net under TCPIP or IPX?<br />
Solution Error 15 under TCPIP/IPX occurs only when you use the<br />
broadcast search mechanism. Error 15 means that a broadcast<br />
was made by the <strong>HASP4</strong> Net client, but no HASP License<br />
Manager was found.<br />
Increase the timeout length in the nethasp.ini file to 8 seconds. If<br />
after doing so, Error 15 still returns, it is due to one of the<br />
following:<br />
A HASP License Manager was not loaded.<br />
If the TCPIP protocol was used, then the HASP License<br />
Manager is in a different subnetwork.<br />
If the IPX protocol was used, then SAP is not supported.<br />
If you repeatedly receive Error 15, try using another search<br />
mechanism.<br />
310 © Aladdin Knowledge Systems, 2002
Appendix A Troubleshooting<br />
Problem You are using a <strong>HASP4</strong> Net5 and authorized your application five<br />
licenses, but only three users can activate the application.<br />
Solution First use HaspEdit and make sure that your application is<br />
programmed for five licenses in the <strong>HASP4</strong> Net. If it is, it is<br />
possible that it escaped your notice that all five licenses are being<br />
used. Use the Aladdin Monitor to confirm which stations are<br />
actually using licenses.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 311
Appendix A: Troubleshooting<br />
312 © Aladdin Knowledge Systems, 2002
Appendix B<br />
HASP Demo<br />
Passwords<br />
When you order HASP keys, you are assigned a unique developer<br />
code and unique HASP passwords. You receive the passwords<br />
together with your HASP keys.<br />
The following tables list the passwords you use with the HASP<br />
demo key you receive in your HASP Developer’s Kit.<br />
Table B.1 Passwords of HASP Demo Memory Keys<br />
Developer Code First Password Second Password<br />
DEMOMA 15417 9632<br />
DEMOMB 29875 28774<br />
DEMOMC 29313 23912<br />
Table B.2 Passwords of <strong>HASP4</strong> Std Demo Keys<br />
Developer Code First Password Second Password<br />
DEMO3A 5932 25657<br />
DEMO3B 20580 22012<br />
DEMO3C 10038 15697<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 313
Appendix C<br />
Technical<br />
Specifications<br />
Table C.1 General Specifications for All HASP keys<br />
Plastic case material ABS<br />
Operating temperature 0 ° - 55 ° C (32 ° - 131 ° F)<br />
Storage temperature -25 ° - 70 ° C (-13 ° - 158 ° F)<br />
Humidity rating 0 - 100% without condensation<br />
UL-6C61 1950 standard 94-V0<br />
ASIC operating voltage range* 1.8 - 5.5V<br />
Daisy chaining (not applicable to <strong>HASP4</strong> USB) up to 10 units<br />
Number of times a HASP memory cell can be<br />
rewritten<br />
at least 1,000,000<br />
HASP memory data retention at least 10 years<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 315
Appendix C: Technical Specifications<br />
Table C.2 Specifications for <strong>HASP4</strong> Std, <strong>HASP4</strong> M1, <strong>HASP4</strong> M4, <strong>HASP4</strong> Net<br />
Dimensions 39 x 53 x 17 mm<br />
Weight ~33 g<br />
Connectors DB25<br />
Lines used<br />
Read/write memory<br />
D0-D7, INIT, ATFDXT, PE<br />
<strong>HASP4</strong> without memory none<br />
<strong>HASP4</strong> M1 112 bytes<br />
<strong>HASP4</strong> M4 496 bytes<br />
<strong>HASP4</strong> Net 496 bytes<br />
Batteries/external power none<br />
Table C.3 Specifications for <strong>HASP4</strong> <strong>Ti</strong>me<br />
Dimensions 52 x 53 x 16 mm<br />
Weight ~50 g<br />
Connectors DB25<br />
Lines used D0-D7, INIT, ATFDXT, PE<br />
Read/write memory 512 bytes<br />
<strong>HASP4</strong> <strong>Ti</strong>me clock counts hour, minute, second, year, month, day<br />
<strong>HASP4</strong> <strong>Ti</strong>me clock accuracy 2 hours per year<br />
Battery lifetime 4+ years<br />
316 © Aladdin Knowledge Systems, 2002
Appendix C Technical Specifications<br />
Table C.4 Specification for USB models<br />
Dimensions 57 x 16 x 8 mm<br />
Weight ~7 g<br />
Connectors USB Type A<br />
Lines used<br />
Read/write memory<br />
Power, ground, two data lines<br />
<strong>HASP4</strong> USB none<br />
<strong>HASP4</strong> USB M1 112 bytes<br />
<strong>HASP4</strong> USB M4 496 bytes<br />
<strong>HASP4</strong> USB Net 496 bytes<br />
Batteries / external power none<br />
Table C.5 HASP PC-Card<br />
Dimensions Type II<br />
Weight ~25g<br />
Operating temperature 0 ° - 70 ° C (32 ° - 158 ° F)<br />
Humidity rating 20 - 80 % relative humidity<br />
Power consumption < 100 mA (typically 50 mA)<br />
Operating voltage 5 V<br />
Batteries / external power none<br />
ASIC technology CMOS 2µA with E2 cells<br />
Number of programming cycles > 100 000<br />
Data retention > 10 years<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 317
Appendix C: Technical Specifications<br />
Table C.6 AladdinCARD ISA<br />
Dimensions 113 mm x 100 mm<br />
Weight ~105g (including adapter cables)<br />
Connector ISA Bus 8-bit slot<br />
internal DB25 female<br />
IO addresses 278h, 378h, 3BCh<br />
IRQ None, IRQ5, IRQ7<br />
Operating voltage 4.5 V .. 5.5 V<br />
Table C.7 AladdinCARD PCI<br />
Dimensions 180 mm x 124 mm<br />
Weight 105 g (including adapter cables)<br />
Connector PCI connector 32-bit /33 MHz /5 V<br />
internal DB25 female<br />
IO addresses dynamically assigned<br />
IRQ dynamically assigned<br />
Operating voltage 5 V<br />
318 © Aladdin Knowledge Systems, 2002
Glossary<br />
Activations The number of times a HASP-protected application can be<br />
started.<br />
Address File<br />
Search<br />
Mechanism<br />
A search mechanism in which the <strong>HASP4</strong> Net client accesses a file<br />
to retrieve the address of the HASP Net License Manager.<br />
ASIC The Application Specific Integrated Circuit (ASIC) of the HASP is<br />
a propriety, full-custom chip containing a unique algorithm.<br />
Background<br />
HASP Checks<br />
Bindery Search<br />
Mechanism<br />
Ongoing checks for the presence of the HASP key performed by<br />
the HASP Envelope during application run time.<br />
A search mechanism in which the <strong>HASP4</strong> Net client searches the<br />
Novell bindery to find the HASP Net License Manager.<br />
Broadcast A method of communicating across a network by sending<br />
(broadcasting) messages to every workstation. When transmitting<br />
messages, you either target a specific computer as the destination,<br />
or you broadcast the same message to all network workstations.<br />
Broadcast<br />
Search<br />
Mechanism<br />
A search mechanism in which the <strong>HASP4</strong> Net client uses a SAP<br />
broadcast to find the HASP Net License Manager.<br />
Daisy-chaining The connecting of HASP keys one after the other.<br />
DataHASP A feature of the HASP Envelope utility that you use to protect<br />
data files.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 319
Glossary<br />
DemoMA The developer code of HASP demo keys.<br />
Developer Code A unique code assigned to each software developer and burnt into<br />
the ASIC component of the HASP.<br />
Expiration Date The date after which the protected application can no longer run.<br />
Full<br />
Authorization<br />
System (FAS)<br />
A powerful feature that allows you to protect multiple applications<br />
with a single key, and to specify the conditions under which each<br />
application can be used.<br />
HASP HASP is a hardware-based system for software protection.<br />
HaspEdit A utility used to access the HASP and edit the memory of HASP<br />
memory keys.<br />
HASP<br />
Application<br />
Programming<br />
Interface (API)<br />
An interface to a HASP object file or DLL that you link to your<br />
application, allowing you to insert calls to the HASP throughout<br />
your code.<br />
HASP Demo Key A HASP key with demo passwords (15147 9632) AND<br />
DEVELOPER CODE DEMOMA that you use to evaluate the<br />
HASP protection system.<br />
HASP<br />
Developer’s Kit<br />
HASP Device<br />
Driver<br />
HASP Device<br />
Driver Dynamic<br />
Load<br />
Aladdin<br />
Diagnostic<br />
A package that contains everything needed to evaluate the HASP<br />
protection system.<br />
A driver that interfaces between HASP-protected applications and<br />
the HASP.<br />
A property of the HASP Device Driver which enables it to load<br />
without the need to reboot your system.<br />
A tool used to check all the information in your system related to<br />
HASP.<br />
HASP Envelope A HASP utility that wraps an application in a protective shield and<br />
ensures that the protected application cannot run unless the<br />
correct HASP is connected to the computer.<br />
320 © Aladdin Knowledge Systems, 2002
HASP Envelope<br />
Wizard<br />
HASP ID<br />
Number<br />
Glossary<br />
A step-by-step guide through the protection process using the<br />
HASP Envelope.<br />
A unique number assigned to each HASP memory key during the<br />
manufacturing process.<br />
HASP Memory Internal read/write memory contained in the HASP, the amount<br />
of which depends upon the particular HASP model.<br />
HASP Memory<br />
Key<br />
HASP memory keys have internal read/write memory, the size of<br />
which varies depending on the model. The following HASP<br />
models contain a memory: <strong>HASP4</strong> M1 (112 bytes), <strong>HASP4</strong> M4<br />
(496 bytes), <strong>HASP4</strong> <strong>Ti</strong>me (496 + 16 bytes), <strong>HASP4</strong> Net<br />
(496 bytes)<br />
HASP Passwords Two unique passwords assigned to each software developer,<br />
enabling access to the HASP.<br />
hasp( ) Routine The HASP API routine that accesses the HASP.<br />
HASP Stand-<br />
Alone Key<br />
HASP Starter’s<br />
Kit<br />
HASP Test<br />
Utilities<br />
HASP key designed for stand-alone computers.<br />
A package containing everything needed to evaluate and<br />
immediately protect your software.<br />
Utilities for testing the HASP API and <strong>HASP4</strong> Net operations.<br />
<strong>HASP4</strong> <strong>Ti</strong>me A HASP stand-alone key containing an ASIC chip, an internal<br />
real-time clock, and depending on the model, up to 512 bytes of<br />
internal/write memory.<br />
Hinstall An application that installs the HASP Device Driver.<br />
Idle <strong>Ti</strong>me The period after which a station is considered inactive in accessing<br />
a <strong>HASP4</strong> Net.<br />
<strong>HASP4</strong> Net<br />
Automatic<br />
Search<br />
The default method by which the <strong>HASP4</strong> Net protected<br />
application searches for the HASP Net License Manager.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 321
Glossary<br />
<strong>HASP4</strong> Net<br />
Client<br />
<strong>HASP4</strong> Net<br />
Configuration<br />
Files<br />
<strong>HASP4</strong> Net<br />
Custom Search<br />
HASP Net<br />
License<br />
Manager<br />
<strong>HASP4</strong> Net Log<br />
Table<br />
<strong>HASP4</strong> Net<br />
Login<br />
<strong>HASP4</strong> Net<br />
Logout<br />
The station activating a <strong>HASP4</strong> Net-protected application.<br />
Files that contain settings for the fine-tuning of <strong>HASP4</strong> Net client<br />
and HASP Net License Manager behavior on the network.<br />
A customized method by which the <strong>HASP4</strong> Net client searches<br />
for the HASP Net License Manager.<br />
An application that communicates between the protected<br />
application and the <strong>HASP4</strong> Net key, functioning as a link between<br />
the two.<br />
A list of all protected applications that have performed a <strong>HASP4</strong><br />
Net Login and the stations from which they were activated.<br />
The process by which a <strong>HASP4</strong> Net-protected application<br />
requests permission to run from the HASP Net License Manager.<br />
The process by which a <strong>HASP4</strong> Net-protected application informs<br />
the HASP Net License Manager that it is no longer using its<br />
license.<br />
nethasp.ini The <strong>HASP4</strong> Net configuration file for the protected application. It<br />
contains settings for fine-tuning <strong>HASP4</strong> Net behavior on the<br />
network.<br />
<strong>HASP4</strong> Net<br />
Models<br />
<strong>HASP4</strong> Net<br />
Monitor<br />
The series of <strong>HASP4</strong> Net keys which allow different maximum<br />
numbers of licenses for a protected application.<br />
A tool used to track the use of <strong>HASP4</strong> Net-protected applications<br />
on a network. (monitor.exe)<br />
nhsrv.ini The configuration file for the HASP Net License Manager. It<br />
contains settings for fine-tuning the HASP Net License Manager.<br />
Number of<br />
Activations<br />
The number of times a protected application can run.<br />
322 © Aladdin Knowledge Systems, 2002
Number of<br />
Licenses<br />
Glossary<br />
The number of stations that can run the protected application at<br />
the same time.<br />
Pattern A structure in the protected application which is updated when a<br />
hidden call to the HASP is triggered.<br />
PC-CardHASP An advanced software protection card that is inserted to PC-Card<br />
(PCMCIA) slots found on most notebook PCs.<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 323
A<br />
Access to HASP key.......................... 32 - 33<br />
Activations ................................................ 102<br />
Adapt timeout length............................... 267<br />
AKS Monitor. See Aladdin Monitor<br />
aksparlnx.o .................................................. 35<br />
aksusbd ................................................. 32, 35<br />
Aladdin Diagnostic .................................... 26<br />
check HASP keys.............................. 109<br />
diagnose HASP keys ........................ 108<br />
Key Access History pane................. 111<br />
Aladdin Monitor... 215, 218, 257 - 262, 311<br />
Anti debug modules................................... 65<br />
Anti-debugging........................................... 71<br />
API ....................................................... 19 - 20<br />
Application activations, limit........... 21, 279<br />
Application programming interface ...... 115<br />
Application protection, prepare............... 73<br />
ASCIIZ...................................................... 297<br />
ASIC........................................................ 5, 17<br />
B<br />
Background HASP checks........................ 71<br />
Basic services ............................................ 143<br />
Batch code. See Developer Code<br />
Battery in <strong>HASP4</strong> <strong>Ti</strong>me ............................ 22<br />
Big Endian................................................. 151<br />
Index<br />
C<br />
-c .................................................................. 65<br />
Cascading. See Daisy-chaining<br />
-cfgfile ......................................................... 65<br />
Chaining. See Daisy-chaining<br />
Check<br />
clock date .......................................... 165<br />
clock time.......................................... 163<br />
for HASP presence.......................... 146<br />
HASP ID number..... 88, 156, 170, 183<br />
HASP type ........................................ 147<br />
port..................................................... 147<br />
status of call to <strong>HASP4</strong> Net........... 176<br />
Checksumming ........................................ 138<br />
Clearing the memory................................. 97<br />
Clock<br />
check date.......................................... 165<br />
check time ......................................... 163<br />
setting date ........................................ 164<br />
setting time........................................ 162<br />
Compilers, support.................................. 130<br />
Configuration file ...................................... 65<br />
Conflicts with parallel devices, avoid ... 305<br />
Crash, reactivating after.......................... 177<br />
Create templates ...................................... 101<br />
-createcfg..................................................... 65<br />
custinst.exe. See Customer utility<br />
Customer utility .. 272 - 273, 276, 286 - 290<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 325
Index<br />
Status codes ....................................... 290<br />
D<br />
Daemon....................................................... 32<br />
Daisy-chaining ............................................ 23<br />
Data<br />
decode ....................................... 150, 193<br />
encode .............................. 135, 149, 191<br />
Data files, protecting. See DataHASP<br />
DataHASP............................................ 23, 60<br />
Dates. See Clock<br />
Decode data ..................................... 150, 193<br />
DecodeData service................................... 15<br />
Defining range of stations ........... 263 - 266<br />
Demo applications................................... 115<br />
Demo key passwords............................... 313<br />
Demo keys ................................................ 313<br />
Determine HASP ID.......................... 79, 98<br />
Determining HASP ID ........................... 116<br />
Developer code .......... 15, 17, 218, 307, 313<br />
Device conflict, avoiding ........................ 305<br />
Device driver. See HASP device driver<br />
-dhfilter ........................................................ 65<br />
-dhfilterx...................................................... 66<br />
-dhkey .......................................................... 66<br />
dinst.............................................................. 32<br />
Disk space requirements........................... 44<br />
Distribution<br />
preparing for........................................ 73<br />
DLLs<br />
protecting........................................... 130<br />
DOS extender............................................. 69<br />
DOS, memory requirements .................. 307<br />
Driver........................................................... 33<br />
-drvwait........................................................ 66<br />
E<br />
Editing HASP memory ........................... 116<br />
Editing memory ......................................... 88<br />
<strong>HASP4</strong> M1/M4.................................. 89<br />
<strong>HASP4</strong> Net ......................................... 92<br />
Remote Update System.......... 278, 280<br />
-enc .............................................................. 66<br />
-enclevel ...................................................... 66<br />
Encode ...................................................... 138<br />
Encode data.................... 116, 135, 149, 191<br />
with HASP Edit............................ 77, 98<br />
Encode of HASP memory..................... 138<br />
Encryption key........................................... 66<br />
endian ........................................................ 151<br />
Envelope. See HASP Envelope<br />
Error codes. See Status codes<br />
Error messages<br />
HASP Envelope ................................. 64<br />
Errors<br />
error 15 .............................................. 310<br />
error 21 .............................................. 307<br />
error 3 ................................................ 309<br />
error 8 ................................................ 310<br />
error 9121.......................................... 306<br />
HASP not found .............................. 306<br />
Expiration dates....................................... 102<br />
Expiry date................................................ 280<br />
-exsecnum................................................... 66<br />
F<br />
FAS ............................................................ 102<br />
HASP Envelope ................................. 46<br />
-fas................................................................ 66<br />
FAS area.................................................... 103<br />
-fasprgnum.................................................. 66<br />
File pattern.................................................. 65<br />
Frame types .............................................. 309<br />
Full Authorization System........ 20 - 21, 102<br />
program list ................................. 81 - 88<br />
Remote Update System......... 278 - 279<br />
326 © Aladdin Knowledge Systems, 2002
G<br />
GetDate..................................................... 165<br />
GetHaspID............................................... 170<br />
Get<strong>Ti</strong>me .................................................... 163<br />
Getting started...................................... 1 - 39<br />
H<br />
-h3easy......................................................... 66<br />
-h3hard ........................................................ 66<br />
-h3pass......................................................... 66<br />
Hard disk space.................................. 78 - 79<br />
Hardware....................................................... 8<br />
HASP<br />
in a network......................................... 23<br />
interfaces............................................ 115<br />
problems............................................ 303<br />
software updates............................... 303<br />
HASP API ................. 19 - 20, 26, 115 - 131<br />
basic services..................................... 143<br />
<strong>HASP4</strong> Net services .............. 171 - 196<br />
<strong>HASP4</strong> <strong>Ti</strong>me services............ 159 - 170<br />
Memory services..................... 151 - 158<br />
status codes ............................. 197 - 205<br />
HASP basic concept.......................... 13 - 24<br />
HASP daemon .................................. 32, 116<br />
HASP Demo .............................................. 27<br />
HASP demo keys....................................... 97<br />
HASP Developer Kit ................................ 11<br />
HASP Device Driver ..................... 215, 306<br />
for Windows NT.............................. 306<br />
removing.............................................. 31<br />
HASP device driver................................... 26<br />
HASP driver .............................. 32 - 33, 116<br />
for Mac OS 8.6, 9............................... 33<br />
for Mac OS X ..................................... 32<br />
HASP Edit................................. 26, 73 - 104<br />
configuration file ................................ 75<br />
prepare for application protection... 98<br />
Index<br />
retrieve HASP ID ........................ 79, 98<br />
setting preferences............................. 97<br />
template files..................................... 100<br />
HASP Envelope ......... 19 - 20, 43 - 72, 141<br />
and API protection............................ 43<br />
error messages.................................... 64<br />
Instdos.exe .......................................... 65<br />
Instw16.exe......................................... 65<br />
Instw32.exe......................................... 65<br />
switches ............................................... 65<br />
window ................................................ 45<br />
with <strong>HASP4</strong> Net.............................. 306<br />
HASP hardware............................................ 8<br />
HASP ID number ... 17, 22, 76, 79, 98, 272<br />
and HASP API protection ............. 116<br />
and HASP Envelope protection...... 58<br />
calculating.......................................... 131<br />
check........................... 88, 156, 170, 183<br />
entering in Vendor utility................ 277<br />
retrieving with Customer utility..... 286<br />
HASP key<br />
check presence of .............................. 15<br />
HASP keys<br />
demo .................................................. 313<br />
HASP License Manager 177, 195, 200, 215,<br />
263<br />
switches ........................... 236 - 238, 263<br />
HASP License Manager configuration file..<br />
264<br />
HASP memory........................................... 21<br />
options................................................. 17<br />
HASP memory, encode of..................... 138<br />
HASP passwords................ 17, 22, 276, 313<br />
changing .............................................. 22<br />
hiding ................................................. 139<br />
HASP protection keys ................................. 8<br />
HASP software, overview................ 25 - 27<br />
HASP Starter Kit....................................... 11<br />
HASP test utilities ..................................... 27<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 327
Index<br />
HASP Test Utility .................................... 128<br />
hasp( ) routine....... 117, 129, 133, 143, 151,<br />
159, 171, 197, 305<br />
and TCP/IP....................................... 172<br />
time required to call.......................... 129<br />
-hasp4........................................................... 66<br />
<strong>HASP4</strong> key models...................................... 9<br />
<strong>HASP4</strong> key types.......................................... 9<br />
<strong>HASP4</strong> M1............................................. 8, 10<br />
services .................................... 151 - 158<br />
<strong>HASP4</strong> M1/M4.......................................... 24<br />
editing memory ................................... 89<br />
HASP Envelope.................................. 46<br />
update................................................... 24<br />
<strong>HASP4</strong> M4....................................... 8, 10, 89<br />
services .................................... 151 - 158<br />
<strong>HASP4</strong> Net ......................... 10, 55, 209, 219<br />
and the HASP Envelope ................. 306<br />
client configuration file......... 247 - 256<br />
editing memory ................................... 92<br />
error 21............................................... 307<br />
HASP Envelope.................................. 46<br />
Internet............................................... 219<br />
key........................................................... 8<br />
LastStatus codes..................... 200 - 205<br />
LastStatus service.............................. 176<br />
License Manager ............................... 215<br />
log table........... 177, 179, 185, 214, 228<br />
login ........................................... 177, 308<br />
logout................................... 70, 179, 306<br />
program list......................... 86, 182, 189<br />
services .................................... 171 - 196<br />
<strong>HASP4</strong> Net configuration files.............. 263<br />
client ........................................ 247 - 256<br />
setting the name................................ 190<br />
<strong>HASP4</strong> Standard .......................................... 9<br />
<strong>HASP4</strong> Std.............................................. 8 - 9<br />
<strong>HASP4</strong> <strong>Ti</strong>me.................................... 8, 10, 22<br />
clock...................................................... 92<br />
HASP Envelope ................................. 46<br />
setting clock ........................................ 97<br />
<strong>HASP4</strong> <strong>Ti</strong>me services ................... 159 - 170<br />
<strong>HASP4</strong> without memory.......................... 81<br />
HaspDecodeData ........................... 150, 193<br />
haspdemo.exe ............................................... 128<br />
HaspEdit................................................... 311<br />
HaspEdit. See HASP Edit<br />
HaspEncodeData ........................... 149, 191<br />
haspenv.exe................................................. 45<br />
HaspID............................................. 156, 183<br />
HaspQueryLicense .................................. 196<br />
HaspStatus................................................ 147<br />
HDD16.EXE............................................. 29<br />
HDD32.EXE............................................. 29<br />
-highsecoff .................................................. 67<br />
-highsecon................................................... 67<br />
Hinstall utility ..................................... 30, 306<br />
I<br />
I/O base, changing.................................. 308<br />
IBM...................................................... 54, 276<br />
-ibm.............................................................. 67<br />
ID number............................................ 17, 22<br />
Identify key................................................. 15<br />
Idle time ...................................................... 70<br />
Idle<strong>Ti</strong>me.................................................... 184<br />
Implementing API................................... 117<br />
Installation .......................................... 25 - 39<br />
customize under Linux................ 37, 39<br />
customize under Mac OS X ............. 32<br />
customize under Windows ............... 30<br />
Linux ............................................ 35 - 39<br />
Mac............................................... 32 - 34<br />
Windows...................................... 29 - 31<br />
Installing<br />
driver .................................................... 33<br />
Instdos.exe.................................................. 65<br />
328 © Aladdin Knowledge Systems, 2002
Instw16.exe................................................. 65<br />
Instw32.exe................................................. 65<br />
Interfaces................................................... 115<br />
-interval........................................................ 67<br />
IPX protocol<br />
defining range of stations................ 263<br />
IsHasp........................................................ 146<br />
K<br />
kernel mode driver..................................... 35<br />
L<br />
Languages<br />
support............................................... 130<br />
LastStatus.................................................. 176<br />
codes......................................... 200 - 205<br />
error 21 .............................................. 307<br />
Licensing .......................... 55, 218, 306 - 307<br />
Limit<br />
application activations ....................... 21<br />
Limiting<br />
applications served........................... 267<br />
licenses ................................................. 55<br />
number of licences............................. 55<br />
Linux............................................................ 35<br />
Little Endian............................................. 151<br />
-loader.......................................................... 67<br />
Loading time............................................... 71<br />
Log table......... 177, 179, 185, 214, 228, 306<br />
Login......................................... 177, 214, 308<br />
-loginx.......................................................... 67<br />
Logout ............................... 70, 179, 214, 306<br />
LptNum..................................................... 119<br />
M<br />
Mac 9.x ........................................................ 33<br />
Mac OS 8.6 ................................................. 33<br />
Mac OS X ................................................... 32<br />
Index<br />
Memory....................................................... 21<br />
editing .................................................. 88<br />
<strong>HASP4</strong> Net reserved...... 104, 182, 189<br />
reading .... 154, 157, 167, 169, 181, 186<br />
remote update..................................... 24<br />
update .................................................. 24<br />
writing to 155, 158, 166, 168, 182, 188<br />
Memory services............................ 151 - 158<br />
-mhid ........................................................... 67<br />
-mhpass....................................................... 67<br />
Micro .............................................................. 5<br />
Micro-controller ........................................... 5<br />
Multi key programming tool.................. 101<br />
N<br />
NEC<br />
as target computer ........................... 276<br />
-nec .............................................................. 67<br />
NetBIOS protocol<br />
defining range of stations ............... 266<br />
station name...................................... 266<br />
-netcfg ......................................................... 67<br />
NetHASP<br />
login ................................................... 214<br />
logout................................................. 214<br />
NetHASP Monitor. See Aladdin Monitor<br />
Network cards.......................................... 308<br />
Networks and <strong>HASP4</strong> Net ............ 209, 219<br />
New Envelope Configuration ................. 45<br />
NH_COMMON ............................. 248, 250<br />
NH_IPX................................................... 251<br />
NH_NETBIOS....................................... 254<br />
NH_TCPIP.............................................. 255<br />
-nhpass ........................................................ 67<br />
-nodbgcheck............................................... 67<br />
-noenc ......................................................... 67<br />
-nofas........................................................... 67<br />
-nohasp4 ..................................................... 68<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 329
Index<br />
-norandomsize............................................ 68<br />
-nores ........................................................... 68<br />
-nospecial..................................................... 68<br />
Novell network......................................... 309<br />
-novir............................................................ 68<br />
Number of Licenses field<br />
<strong>HASP4</strong> Net.......................................... 55<br />
O<br />
Open Envelope Configuration ................ 45<br />
-out ............................................................... 68<br />
Overlay File field........................................ 54<br />
Overlay handling ........................................ 69<br />
-ovl................................................................ 68<br />
P<br />
Parallel keys................................................... 9<br />
Parallel port...................................... 119, 308<br />
Parameters<br />
hasp( ) routine 118, 143, 151, 159, 171<br />
Passwords. See HASP passwords<br />
PC-Cards ....................................................... 9<br />
PCMCIA........................................................ 9<br />
-pcs ............................................................... 68<br />
Port, check ................................................ 147<br />
Prepare for application protection .......... 98<br />
Preparing HASP keys ................................ 99<br />
-prg ............................................................... 68<br />
-prgnum....................................................... 68<br />
Printing problems ......................... 304 - 305<br />
Problems.................................................... 303<br />
Program list........................ 81 - 88, 182, 189<br />
Program number ...... 51, 66, 68, 83 - 87, 89<br />
Remote Update System ................... 279<br />
Programming HASP keys......................... 99<br />
Programming multiple keys............. 94, 101<br />
Programming single HASP keys..... 99, 101<br />
Protect Application............................. 46, 50<br />
Protect icon ................................................ 46<br />
Protection<br />
for networks and stand-alone keys 127<br />
for networks and stand-alones....... 307<br />
HASP API........................... 19, 26 - 131<br />
HASP Envelope ................................. 19<br />
main stages .......................................... 28<br />
maximizing..................... 133 - 141, 221<br />
methods ............................................... 19<br />
of data files.......................................... 23<br />
of DLLs ............................................. 130<br />
quick reference ................................... 28<br />
Protection parameters............................. 102<br />
Q<br />
-quiz ............................................................. 68<br />
R<br />
RAM .................................................... 78 - 79<br />
-randomsize ................................................ 68<br />
Reactivating, after crash.......................... 177<br />
Read/write memory .................................. 10<br />
ReadBlock................................ 157, 169, 186<br />
ReadByte ................................................... 167<br />
Reading memory... 154, 157, 167, 169, 181,<br />
186<br />
ReadWord........................................ 154, 181<br />
Real-time clock........................................... 10<br />
Remote Update System . 24, 269, 271 - 301<br />
client DLL......................................... 297<br />
Customer utility.. 272 - 273, 276, 286 -<br />
290<br />
customization utility........ 291, 299, 301<br />
DLL for customer............................ 291<br />
DLL for vendor................................ 291<br />
editing memory........................ 278, 280<br />
Full Authorization System .... 278 - 279<br />
passwords ......................... 272, 277, 287<br />
330 © Aladdin Knowledge Systems, 2002
performing updates.......................... 292<br />
preparing your application .............. 292<br />
sample applications .......................... 292<br />
switches.............................................. 288<br />
vendor DLL ...................................... 293<br />
Vendor utility ....... 272 - 273, 277 - 285<br />
Win32 API for HASP keys... 291 - 301<br />
Report, Aladdin Diagnostic utility......... 108<br />
Retrieve HASP ID............................... 79, 98<br />
Return codes<br />
hiding.................................................. 139<br />
Rmote Update System<br />
preparing your application .............. 292<br />
RUS. See Remote Update System<br />
S<br />
Sample applications ................................. 115<br />
Scanning for connected keys.................... 98<br />
Searching, parallel port............................ 119<br />
Security, improving........................ 133 - 141<br />
Serial number.See HASP ID<br />
Services<br />
basic.................................................... 143<br />
HASP Memory ....................... 151 - 158<br />
<strong>HASP4</strong> Net ............................. 171 - 196<br />
<strong>HASP4</strong> <strong>Ti</strong>me........................... 159 - 170<br />
Service 1............................................. 146<br />
Service 104......................................... 196<br />
Service 3............................................. 154<br />
Service 40........................................... 176<br />
Service 42........................................... 177<br />
Service 43........................................... 179<br />
Service 44........................................... 181<br />
Service 45........................................... 182<br />
Service 46........................................... 183<br />
Service 48........................................... 184<br />
Service 5............................................. 147<br />
Service 50........................................... 157<br />
Index<br />
Service 51 .......................................... 158<br />
Service 52 .......................................... 186<br />
Service 53 .......................................... 188<br />
Service 6 ............................................ 156<br />
Service 60 .......................................... 149<br />
Service 61 .......................................... 150<br />
Service 70 .......................................... 162<br />
Service 71 .......................................... 163<br />
Service 72 .......................................... 164<br />
Service 73 .......................................... 165<br />
Service 74 .......................................... 166<br />
Service 75 .......................................... 167<br />
Service 76 .......................................... 168<br />
Service 77 .......................................... 169<br />
Service 78 .......................................... 170<br />
Service 85 .......................................... 190<br />
Service 88 .......................................... 191<br />
Service 89 .......................................... 193<br />
Service 96 .......................................... 195<br />
Service4 ............................................. 155<br />
SetConfigFilename.................................. 190<br />
SetDate...................................................... 164<br />
SetServerByName.................................... 195<br />
Set<strong>Ti</strong>me..................................................... 162<br />
Setting<br />
clock date .......................................... 164<br />
clock time.......................................... 162<br />
FAS Program List for <strong>HASP4</strong> M1/M4<br />
82<br />
FAS Program List for <strong>HASP4</strong> <strong>Ti</strong>me 84<br />
frame type ......................................... 309<br />
HASP License Manager name ....... 195<br />
<strong>HASP4</strong> Net configuration file ....... 190<br />
<strong>HASP4</strong> <strong>Ti</strong>me clock............................ 92<br />
number of licences............................. 55<br />
Setup utility................................................. 29<br />
setup.exe. See Setup utility<br />
<strong>Soft</strong>ware<br />
HASP, overview......................... 25 - 27<br />
<strong>HASP4</strong> Programmer’s <strong>Guide</strong> 331
Index<br />
updates ............................................... 303<br />
-special ......................................................... 69<br />
-special1 ....................................................... 69<br />
Specifying the port................................... 119<br />
Specifying USB port number ................. 120<br />
Stand-alone HASP keys in a network ..... 23<br />
Start HASP Wizard.................................... 45<br />
Status codes<br />
Customer utility ................................ 290<br />
HASP API .............................. 197 - 205<br />
<strong>HASP4</strong> Net LastStatus ......... 200 - 205<br />
Vendor utility .................................... 284<br />
Switches<br />
Customer utility ................................ 288<br />
HASP Envelope.................................. 65<br />
HASP License Manager 236 - 238, 263<br />
Remote Update System ................... 288<br />
Vendor utility ......................... 282 - 284<br />
T<br />
TCP/IP protocol<br />
and hasp( ) routine............................ 172<br />
defining range of stations ................ 264<br />
Technical support .................................... 108<br />
Template files ........................................... 100<br />
<strong>Ti</strong>me. See Clock<br />
<strong>Ti</strong>meout length ......................................... 267<br />
Troubleshooting....................................... 303<br />
U<br />
Unprotected File ................................. 46, 48<br />
Update HASP keys ............... 269, 291 - 301<br />
Update System....................... 269, 291 - 301<br />
USB enumeration..................................... 120<br />
USB HASP.................................................... 5<br />
USB keys ....................................................... 9<br />
USB port number..................................... 120<br />
Use <strong>HASP4</strong> Security Features field......... 54<br />
Using API ................................................. 117<br />
Using Full Authorization System .......... 102<br />
V<br />
vendinst.exe. See Vendor utility<br />
Vendor utility .............. 272 - 273, 277 - 285<br />
status codes ....................................... 284<br />
switches.................................... 282 - 284<br />
Verify<br />
presence of HASP.............................. 15<br />
-vir................................................................ 69<br />
W<br />
Win32 data files<br />
protecting ............................................ 47<br />
Working with templates.......................... 100<br />
WriteBlock............................... 158, 168, 188<br />
WriteByte .................................................. 166<br />
WriteWord....................................... 155, 182<br />
Writing to HASP keys............................... 99<br />
Writing to memory 155, 158, 166, 168, 182,<br />
188<br />
332 © Aladdin Knowledge Systems, 2002
For further info: www.eAladdin.com/HASP<br />
International T: +972-3-636-2222 F: +972-3-537-5796, HASP@eAladdin.com<br />
North America T: 1-800-562-2543, 1-847-818-3800, F: 1-847-818-3810, HASP.us@eAladdin.com<br />
UK T: +44-1753-622266 F: +44-1753-622262, HASP.uk@eAladdin.com<br />
Germany T: +49-89-89-42-21-0 F: +49-89-89-42-21-40, HASP.de@eAladdin.com<br />
Benelux T: +31-30-688-0800 F: +31-30-688-0700, HASP.nl@eAladdin.com<br />
France T: +33-1-41-37-70-30 F: +33-1-41-37-70-39, HASP.fr@eAladdin.com<br />
Israel T: +972-3-636-2222 F: +972-3-537-5796, HASP.il@eAladdin.com<br />
Brazil T: +55-21-235-2499 F: +55-21-236-0768, HASP.br@eAladdin.com<br />
Japan T: +81-426-60-7191 F: +81-426-60-7194, HASP.jp@eAladdin.com<br />
Russia T: +7-095-923-0588 F: +7-095-928-6781, HASP.ru@eAladdin.com<br />
Spain T: +34-91-375-99-00 F: +34-91-754-26-71, HASP.es@eAladdin.com<br />
China T: +86-10-6526-9920 F: +86-10-6526-9921, HASP.cn@eAladdin.com<br />
à03782!ä<br />
0 3 7 8 2<br />
Printed in Israel 11/2001 © Aladdin Knowledge Systems Ltd. HASP ® is a registered trademark of Aladdin Knowledge Systems Ltd.<br />
All other product names are trademarks or registered trademarks of their respective owners.
<strong>HASP4</strong> _<strong>Guide</strong>.fh9 2/12/2001 11:55 Page 2<br />
Composite<br />
C M Y CM MY CY CMY K<br />
Programmer’s <strong>Guide</strong><br />
Version 11