From 76c74bf9ad3db017873a460a496ca9dbb432fa23 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 10 Jan 2017 18:23:05 +0100 Subject: [PATCH] CHG: 'hf iclass decrypt' - adjusted the loops, to only decrypt Application 1. However I've noticed not all blocks in Application 1 is encrypted. :/ Still needs to be adjusted. CHG: 'hf iclass reader' - added some output accessrights from the CopyReader source code. And ofcourse, moved around stuff, like the usages in cmdhficlass.c --- client/cmdhficlass.c | 397 +++++++++++++++++++++---------------------- client/cmdhficlass.h | 24 +++ common/protocols.c | 55 +++--- common/protocols.h | 22 +++ 4 files changed, 270 insertions(+), 228 deletions(-) diff --git a/client/cmdhficlass.c b/client/cmdhficlass.c index 89c0f7584..020ee51ae 100644 --- a/client/cmdhficlass.c +++ b/client/cmdhficlass.c @@ -10,32 +10,11 @@ // 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" -#include "protocols.h" -#include "usb_cmd.h" -#include "cmdhfmfu.h" -#include "cmdhf.h" static int CmdHelp(const char *Cmd); +#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 }, @@ -52,6 +31,148 @@ typedef struct iclass_block { uint8_t d[8]; } iclass_block_t; +int usage_hf_iclass_sim(void) { + PrintAndLog("Usage: hf iclass sim