X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/9a9bcea82baed04c6986d02f671b836e2875dc79..905c55de2bbe642412b47ed4e92344096c817fac:/client/cmdhficlass.c diff --git a/client/cmdhficlass.c b/client/cmdhficlass.c index e0d1d983..3891d431 100644 --- a/client/cmdhficlass.c +++ b/client/cmdhficlass.c @@ -10,51 +10,28 @@ // High frequency iClass commands //----------------------------------------------------------------------------- -#include -#include -#include -#include -#include "iso14443crc.h" // Can also be used for iClass, using 0xE012 as CRC-type -#include "data.h" -#include "proxmark3.h" -#include "ui.h" -#include "cmdparser.h" #include "cmdhficlass.h" -#include "common.h" -#include "util.h" -#include "cmdmain.h" -#include "loclass/des.h" -#include "loclass/cipherutils.h" -#include "loclass/cipher.h" -#include "loclass/ikeys.h" -#include "loclass/elite_crack.h" -#include "loclass/fileutils.h" static int CmdHelp(const char *Cmd); -int xorbits_8(uint8_t val) -{ - uint8_t res = val ^ (val >> 1); //1st pass - res = res ^ (res >> 1); // 2nd pass - res = res ^ (res >> 2); // 3rd pass - res = res ^ (res >> 4); // 4th pass - return res & 1; -} +#define NUM_CSNS 15 +#define ICLASS_KEYS_MAX 8 +static uint8_t iClass_Key_Table[ICLASS_KEYS_MAX][8] = { + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 } +}; -int CmdHFiClassList(const char *Cmd) -{ - PrintAndLog("Deprecated command, use 'hf list iclass' instead"); - return 0; -} +typedef struct iclass_block { + uint8_t d[8]; +} iclass_block_t; -int CmdHFiClassSnoop(const char *Cmd) -{ - UsbCommand c = {CMD_SNOOP_ICLASS}; - SendCommand(&c); - return 0; -} -int usage_hf_iclass_sim() -{ +int usage_hf_iclass_sim(void) { PrintAndLog("Usage: hf iclass sim