#ocx 以及 .net 用下面的
D:\tmp2_src_extract\域天\driver_2k\驱动程序\加密锁驱动\多文件安装版\Syunew6A.dll, 也是一个 ocx
.net 也调用了 里面的函数
sub_1000B180 proc near, 加载 SetupApi.dll 里面的 \\hid.dll 里面的函数 , 实现了 usb 信息的读取
HidD_FreePreparsedData
HidD_GetAttributes
HidD_GetFeature
HidD_GetHidGuid
HidD_GetPreparsedData
HidD_SetFeature
HidP_GetButtonCaps
HidP_GetCaps
HidP_GetScaledUsageValue
HidP_GetUsageValue
HidP_GetUsages
HidP_GetValueCaps
HidP_MaxUsageListLength
HidP_SetUsageValue
HidP_SetUsages
#==========================================================================
#2013_10_25 星期五 add by greshem
J:\sdb1\_xfile\2013_all_iso\_xfile_2013_10\yutian_域天_加密狗\Linux_yutian_demo.chm::/index.html
D:\tmp2_src_extract\域天\EncSamle_zhyx.rar\常用例子及源码\Linux
########################################################################
#域天 的代码 api 都以 FindPort 来命名
int NT_FindPort(int start,usb_dev_handle * *OutDevHandle)//ok
usb_init();
usb_find_busses();
usb_find_devices();
busses = usb_get_busses();
for (bus = busses; bus; bus = bus->next)
for (dev = bus->devices; dev; dev = dev->next)
if (usb 设备 0X83d3:0x3773) )
usb_detach_kernel_driver_np(*OutDevHandle, i); #注意要 detach 一下
#因为 usb 设备可能以 hid 的方式 挂载上去的, 但是
# 其实要用的话 应该 把他 修改成 raw 的格式.
# 获取加密狗的ID 信息 这些信息应该是烧录 在硬件中的.
# 域天加密狗 usb 读取的 魔数一般是
# 0x21,9,0x0302 send
# 0xa1,1,0x0301 接受读取.
int NT_GetIDVersion(DWORD *ID,int *Version,usb_dev_handle *DevHandle)//ok
ret=usb_control_msg(DevHandle,0x21,9,0x0302,0,(char *)array_in,0x18,0);
ret=usb_control_msg(DevHandle,0xa1,1,0x0301,0,(char *)array_out,0x18,0);
# 加密狗写数据,
153 int Write(BYTE InData,short address ,usb_dev_handle *DevHandle )
ret=usb_control_msg(DevHandle,0x21,9,0x0302,0,(char *)array_in,0x18,0);
ret=usb_control_msg(DevHandle,0xa1,1,0x0301,0,(char *)array_out,0x18,0);
#加密狗读取usb中的数据
Y_Read(BYTE *OutData,short address ,short len,char *KeyPath )
usb_control_msg(DevHandle,0x21,9,0x0302,0,(char *)array_in,0x18,0);
usb_control_msg(DevHandle,0xa1,1,0x0301,0,(char *)array_out,0x18,0);
int NT_GetIDVersion(DWORD *ID,int *Version,usb_dev_handle *DevHandle)//ok
ret=usb_control_msg(DevHandle,0x21,9,0x0302,0,(char *)array_in,0x18,0);
ret=usb_control_msg(DevHandle,0xa1,1,0x0301,0,(char *)array_out,0x18,0);
# 加密狗写数据,
153 int Write(BYTE InData,short address ,usb_dev_handle *DevHandle )
ret=usb_control_msg(DevHandle,0x21,9,0x0302,0,(char *)array_in,0x18,0);
ret=usb_control_msg(DevHandle,0xa1,1,0x0301,0,(char *)array_out,0x18,0);
#加密狗读取usb中的数据
Y_Read(BYTE *OutData,short address ,short len,char *KeyPath )
usb_control_msg(DevHandle,0x21,9,0x0302,0,(char *)array_in,0x18,0);
usb_control_msg(DevHandle,0xa1,1,0x0301,0,(char *)array_out,0x18,0);