From fc2a3dd2c5910c9f4c6cb7784fa386157b0228c5 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 22 Apr 2024 15:41:59 +0200 Subject: [PATCH] Updated the command according to @whywilson's findings. and fixed the wrong byte aswell --- CHANGELOG.md | 2 +- armsrc/iso15693.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5de75914cb..563c6e44bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac - Updated windows workflow to use latest setup-wsl script (@iceman1001) - Added a micro second clock in the client (@iceman1001) - Fix `hf mfdes read` - buffer overflow when reading large files (@iceman1001) -- Changed `hf 15 csetuid` - now supports gen2 command (@iceman1001) +- Changed `hf 15 csetuid` - now supports gen2 command. Thanks @whywilson! (@iceman1001) - Changed `hf mfp info` - to identify Ev2 (@iceman1001) - Updated Graph Markers implementation to include temporary markers and marker labels (@HACKhalo2) - Updated to SWIG 4.2.1 (@iceman1001) diff --git a/armsrc/iso15693.c b/armsrc/iso15693.c index 460bc97499..31b2fdf976 100644 --- a/armsrc/iso15693.c +++ b/armsrc/iso15693.c @@ -2937,17 +2937,17 @@ void SetTag15693Uid(const uint8_t *uid) { void SetTag15693Uid_v2(const uint8_t *uid) { LED_A_ON(); - uint8_t cmd[2][11] = { - - // hf 15 raw -wac -d 02e00941 + uid first four bytes - {ISO15_REQ_DATARATE_HIGH, ISO15693_MAGIC_WRITE, 0x00, 0x09, 0x41, uid[7], uid[6], uid[5], uid[4], 0x00, 0x00}, - - // hf 15 raw -wac -d 02e00940 + uid last four bytes - {ISO15_REQ_DATARATE_HIGH, ISO15693_MAGIC_WRITE, 0x00, 0x09, 0x40, uid[3], uid[2], uid[1], uid[0], 0x00, 0x00} + uint8_t cmd[4][10] = { + { ISO15_REQ_DATARATE_HIGH, ISO15693_MAGIC_WRITE, 0x09, 0x47, 0x3f, 0x03, 0x8b, 0x00, 0x00, 0x00 }, + { ISO15_REQ_DATARATE_HIGH, ISO15693_MAGIC_WRITE, 0x09, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + // hf 15 raw -wac -d 02 e0 09 41 + uid first four bytes + {ISO15_REQ_DATARATE_HIGH, ISO15693_MAGIC_WRITE, 0x09, 0x41, uid[7], uid[6], uid[5], uid[4], 0x00, 0x00}, + // hf 15 raw -wac -d 02 e0 09 40 + uid last four bytes + {ISO15_REQ_DATARATE_HIGH, ISO15693_MAGIC_WRITE, 0x09, 0x40, uid[3], uid[2], uid[1], uid[0], 0x00, 0x00} }; - AddCrc15(cmd[0], 9); - AddCrc15(cmd[1], 9); + AddCrc15(cmd[0], 8); + AddCrc15(cmd[1], 8); uint8_t buf[ISO15693_MAX_RESPONSE_LENGTH] = {0x00}; @@ -2957,7 +2957,7 @@ void SetTag15693Uid_v2(const uint8_t *uid) { int res = PM3_SUCCESS; - for (int i = 0; i < 2; i++) { + for (int i = 0; i < 4; i++) { res = SendDataTag( cmd[i], sizeof(cmd[i]),