read Method

Package: Aladdin

Description

Retrieves content from a memory file in a Sentinel protection key.

Syntax

boolean Aladdin.Hasp.read ( long   fileid,
                            int    offset,
                            byte[] buffer
                          )

Parameters

fileid

Identifier for the file that is to be read. Possible values are:

>For default read-only memory: HASP_FILEID_RO

>For default read/write memory: HASP_FILEID_RW

>For a dynamic memory file (read-only, read/write, or read/write-once): The ID that was assigned to the file when the file was created. The ID is a value from 1 through 65471.

NOTE   Dynamic memory files are supported by Sentinel SL keys and Sentinel HL (Driverless configuration) keys (excluding HL Basic and HL Pro keys).

offset

Byte offset of a segment in the file

buffer

Pointer to the retrieved data

Return Values

true/false - indicates success or failure.

Usage Notes

Use the GetSize method to determine the size of the file that you want to read.

NOTE   To defeat a protection key emulator attempting to bypass software protection, you can check periodically that the protection key is available and that a session for the key exists. This should not be done using GetSessionInfo (this method does not detect a remote broken session). Instead, use one of the following methods: Encrypt, Decrypt, Read, Write. These methods will return HASP_BROKEN_SESSION if a session for the protection key does not exist.

Related Topics

GetLastError Method

GetSize Method

Write Method