找狗函数RY2_Find
看看定义,TRY2_Find=function():integer;stdcall;
简单吧
太简单了,不说了
抄点飞天的解释就成了
//return value
// <0 Error code
// =0 No ROCKEY2 dongle is attached
// >0 The number of attached ROCKEY2 dongle(s)
好了,现在狗找到了,下一步就是打开狗
RY2_Open
看定义
TRY2_Open=function(mode:integer; uid :cardinal; var hid :cardinal):integer;stdcall;
好像也挺简单的吧,通俗的解释下吧
就是打开自己定义好UID和HID的狗
比如说你拿A软件的狗运行B软件是不行滴
这里面比较重要的信息就是mode如果值为0拿恭喜你,可以完美的模拟狗了
否则只能模拟
// input:
// mode----This parameter indicates the way to open the dongle
// mode = 0, open the first found ROCKEY2 dongle
// mode > 0, open the dongle according to the UID. The mode value is the dongle number,
// for example: uid=12345678, mode=2, this means it will open the second dongle with UID 12345678
// mode = -1, open the dongle according to the HID, and *hid can not be 0
现在狗打开了,怎么也得验验正身吧
用这个
function RY2_GenUID(handle:integer; var uid : cardinal; seed: pchar; isProtect:integer):integer;stdcall;
// input:
// handle---Dongle handle. It is the handle returned from RY2_Open.
// uid---Output parameter. The generated UID.
// seed---Seed to generate UID. It is a character string with the maximum length of 64 bytes
// isProtect---Sets write protection. 0=dongle not write protected, 1=dongle write protected.
// ROCKEY2_DISABLE_WRITE_PROTECT = 0
// ROCKEY2_ENSABLE_WRITE_PROTECT =1
// Return:
// Error code. Please refer to the later
如果软件用到了这个函数那么被硬件复制的可能性很大
最重要的是seed数据
{有些很罗嗦的文字就不打了,自己到官方看}
验明正身之后就该读取狗内的数据了
function RY2_Read(handle:integer;block_index : integer; buffer512:pchar):integer;stdcall;
// input:
// handle---Dongle handle. It is the handle returned from RY2_Open.
// block_index---Block index. Specify the block to read. The value range is 0-4.
// buffer512---Read buffer. The buffer must be at least 512 bytes to accommodate the 512 byte block size.
// Return:
// Error code. Please refer to the later
Rockey2定义了4个读模块1.2.3.4为序号就是Index的值 4个模块占据了狗512字节的存储空间
软件执行读命令之后,狗会把相应模块的数据写进内存缓冲区buffer