• 大小: 29.79MB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2023-08-06
  • 语言: 其他
  • 标签:

资源简介

怎么写入et199加密狗写狗工具,里面有详细的方法供大家学习。

资源截图

代码片段和文件信息

//---------------------------------------------------------------------------

#include 
#include 
#include “et199_32.h“
#pragma hdrstop

//---------------------------------------------------------------------------

#pragma argsused
VOID PostError(char * PerfixDWORD dwErr)
{
char sErr[128];
ETFormatErrorMessage(dwErrsErrsizeof(sErr));
printf(“%s Error:%s“PerfixsErr);
}

int main(int argc char* argv[])
{
DWORD dwRet;
DWORD Frq = 5;//0.5秒闪烁一次
DWORD dwCount=0;
ET_CONTEXT *pContext;
DWORD TokenSizeDFSize;
WORD id=0x1001;
COS_RSA_PUBLIC_KEY_1024 pubKeyData;
COS_RSA_CRT_PRIVATE_KEY_1024 priKeyData;
DWORD pubSize = sizeof(COS_RSA_PUBLIC_KEY_1024)priSize = sizeof(COS_RSA_CRT_PRIVATE_KEY_1024);
HANDLE hFile;
DWORD FileSize;
unsigned char FileBuff[10240];
unsigned char InBuf[256]OutBuf[256];
char szAtr[MAX_ATR_LEN+1];//已0结束

//枚举ET199并返回数量
dwRet=ETEnum(NULL&dwCount);

if(dwRet != ET_E_INSUFFICIENT_BUFFER && dwRet)
return dwRet;

//根据数量分配内存用于存储CONTEXT结构数组
pContext = new ET_CONTEXT[dwCount];

//清0缓冲区
memset(pContext0sizeof(ET_CONTEXT)*dwCount);

//使用分配的缓冲区重新进行枚举
dwRet=ETEnum(pContext&dwCount);
if(dwRet)
return dwRet;

printf(“Find ET199 %d\n“dwCount);

//打开ET199
dwRet = ETOpen(&pContext[0]);
if(dwRet)
return dwRet;

printf(“Open ET199: \n“);
printf(“COS Version: %d.%02d\n“pContext[0].dwVersion>>8 & 0xffpContext[0].dwVersion & 0xff);
printf(“HardSerial: “);
        for( int i = 0 ; i < MAX_ID_LEN ; i++ ){
         printf(“%.2X“pContext[0].bID[i]);
        } ;
        printf(“\n“);
printf(“ATR:%s\n“pContext[0].bAtr);
printf(“Customer: %X \n“  pContext[0].dwCustomer ) ;



if(pContext[0].dwCustomer != 0x1234) //替换成自己的客户号
{
//不是自己的加密锁,进行相应处理(关闭锁等)
}

//设置LED灯闪烁 频率为Frq
ETControl(&pContext[0]ET_LED_WINK&Frqsizeof(Frq)NULL0NULL);

dwRet = ETControl(&pContext[0]ET_GET_DEVICE_USABLE_SPACENULL0&TokenSize4NULL);
if(dwRet)
{
PostError(“ETControl“dwRet);
goto END;
}
printf(“TokenSize:%dK\n“TokenSize/1024);

//切换到根目录检查根目录是否存在
dwRet = ETChangeDir(&pContext[0]“\\“);
if(!dwRet)
{
//使用默认开发商口令验证,如果不是默认口令,这里需要替换成您自己的口令
dwRet = ETVerifyPin(&pContext[0]ET_DEFAULT_DEV_PINET_DEV_PIN_LENET_DEV_PIN);
if(dwRet)
{
PostError(“ETVerifyPin“dwRet);
goto END;
}
//删除根目录
dwRet = ETEraseDir(&pContext[0]NULL);
if(dwRet)
{
PostError(“ETEraseDir“dwRet);
goto END;
}
}

//建立根目录
dwRet = ETCreateDir(&pContext[0]NULL0ET_CREATE_ROOT_DIR);
if(dwRet)
{
PostError(“ETCreateDir“dwRet);
goto END;
}

//使用默认开发商口令验证,如果不是默认口令,这里需要替换成您自己的口令
dwRet = ETVerifyPin(&pContext[0]ET_DEFAULT_DEV_PINET_DEV_PIN_LENET_DEV_PIN);
if(dwRet)
{
PostError(“ETVerifyPin“dwRet);
goto END;
}
//设置ATR
dwRet = ETControl(&pContext[0]ET_SET_DEVICE_ATR“ET199 VC TEST PROJECT           “MAX_ATR_LENNULL0NULL);
if(dwRet)
{
PostE

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-05-13 13:31  Library\
     文件       46690  2009-12-22 09:56  Library\compact_mode.LIB
     文件       46934  2009-12-22 09:57  Library\large_mode.LIB
     文件       46250  2009-12-22 09:57  Library\small_mode.LIB
     目录           0  2011-05-13 13:31  Samples\
     目录           0  2011-05-13 13:31  Samples\CaseStudy\
     文件      692224  2006-09-03 11:52  Samples\CaseStudy\SampleBrowser.exe
     目录           0  2011-05-13 13:31  Samples\CaseStudy\bin\
     文件       65536  2006-09-03 11:51  Samples\CaseStudy\bin\sample_1.exe
     文件       69632  2006-09-03 11:51  Samples\CaseStudy\bin\sample_10.exe
     文件       69632  2006-09-03 11:51  Samples\CaseStudy\bin\sample_11.exe
     文件       77824  2006-09-03 11:51  Samples\CaseStudy\bin\sample_12.exe
     文件       69632  2006-09-03 11:51  Samples\CaseStudy\bin\sample_13.exe
     文件       69632  2006-09-03 11:51  Samples\CaseStudy\bin\sample_14.exe
     文件       69632  2006-09-03 11:51  Samples\CaseStudy\bin\sample_15.exe
     文件       69632  2006-09-03 11:51  Samples\CaseStudy\bin\sample_16.exe
     文件       65536  2006-09-03 11:51  Samples\CaseStudy\bin\sample_2.exe
     文件       69632  2006-09-03 11:51  Samples\CaseStudy\bin\sample_3.exe
     文件       65536  2006-09-03 11:51  Samples\CaseStudy\bin\sample_4.exe
     文件       69632  2006-09-03 11:51  Samples\CaseStudy\bin\sample_5.exe
     文件       69632  2006-09-03 11:51  Samples\CaseStudy\bin\sample_6.exe
     文件       77824  2006-09-03 11:51  Samples\CaseStudy\bin\sample_7.exe
     文件       61440  2006-09-03 11:51  Samples\CaseStudy\bin\sample_8.exe
     文件       69632  2006-09-03 11:51  Samples\CaseStudy\bin\sample_9.exe
     目录           0  2011-05-13 13:31  Samples\CaseStudy\bin\hardware\
     文件        1752  2006-09-03 11:51  Samples\CaseStudy\bin\hardware\sample_07_hw.bin
     文件         707  2006-09-03 11:51  Samples\CaseStudy\bin\hardware\sample_09_hw.bin
     文件         644  2006-09-03 11:51  Samples\CaseStudy\bin\hardware\sample_10_hw.bin
     文件        1171  2006-09-03 11:51  Samples\CaseStudy\bin\hardware\sample_11_hw.bin
     文件         702  2006-09-03 11:51  Samples\CaseStudy\bin\hardware\sample_12_hw.bin
     文件         759  2006-09-03 11:51  Samples\CaseStudy\bin\hardware\sample_13_hw.bin
............此处省略400个文件信息

评论

共有 条评论

相关资源