⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msk.c

📁 这是用VB6.0写的一个通用的CPU卡操作程序,支持PC/SC接口 安装任何一个PC/SC驱动的IC读写器后,都可以使用此程序进行CPU卡的测试
💻 C
字号:
/* ============================================================================   Project Name : jayaCard TCK   Module Name  : proto/tck/common/msk.c   Version : $Id: msk.c,v 1.6 2004/01/11 09:56:34 dgil Exp $	Description: Default MSK definition    The Original Code is jayaCard TCK code.    The Initial Developer of the Original Code is Gilles Dumortier.	Portions created by the Initial Developer are Copyright (C) 2002-2004 the    Initial Developer. All Rights Reserved.    Contributor(s):	Permission is granted to any individual to use, copy, or redistribute	this software so long as all of the original files are included	unmodified, that it is not sold for profit, and that this copyright	notice is retained.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   History Rev	Description   042203 dgil	wrote it from scratch   ============================================================================*/#include "precomp.h"/* ============================================================================	Default MSK   ========================================================================= */jbyte MSK[18] ={	0x00,0x00, /* CRC */	0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x70,0x60,0x50,0x40,0x30,0x20,0x10,0x55,0xAA};/* ============================================================================	read MSK   ========================================================================= */void read_MSK(void){	FILE*	f;	jword	n;	/* read optional file */	f = fopen("msk.bin","rb");	if (f!=NULL) {	/* only if file exist ! */		n = fread(&MSK[2],1,16,f);		if (n!=16) {			fprintf(stderr,"read_MSK(): can't read from the 'msk.bin' file !\n");			fclose(f);			return;		}		fclose(f);		LOG("TCK","Info: 'msk.bin' key file has been loaded in MSK[] !");	}	HAL_CRC_INIT();	/* calculate the CRC */	for (n=0;n<16;n++) {		HAL_CRC_COMPUTE(MSK[n+2]);	}	MSK[0] = HAL_CRC_LO();	MSK[1] = HAL_CRC_HI();}/* =========================================================================	That's all folks !   ========================================================================= */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -