Read Function
Description
Retrieves content from a memory file in a Sentinel protection key.
Syntax
hasp_status_t HASP_CALLCONV hasp_read(
hasp_handle_t handle,
hasp_fileid_t fileid,
hasp_size_t offset,
hasp_size_t length,
void * buffer
)
Parameters
|
Handle for the session |
|
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). |
|
Byte offset of a segment in the file |
|
Length of the segment (in bytes) to be read from the file |
|
Pointer to the retrieved data |
Return Values
Usage Notes
Use the GetSize function 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 function does not detect a remote broken session). Instead, use one of the following functions: Encrypt, Decrypt, Read, Write. These functions will return HASP_BROKEN_SESSION if a session for the protection key does not exist.
Related Topics
hasp_read screen