From 7ed8f08e096e94a86e1e8022bd6d10d07485f7a1 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Mon, 4 Jul 2022 00:35:44 +0300 Subject: [PATCH] make style --- armsrc/hfops.c | 8 ++++---- armsrc/hfops.h | 2 +- doc/commands.json | 29 +++++++++++++++++++++++++---- doc/commands.md | 1 + 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/armsrc/hfops.c b/armsrc/hfops.c index 8785e0d85..591e80fda 100644 --- a/armsrc/hfops.c +++ b/armsrc/hfops.c @@ -101,7 +101,7 @@ static void EncodeInit(void) { encode_indx = 0; } -static void EncodeAddBit(uint8_t* data, uint8_t bit, uint8_t bit_count) { +static void EncodeAddBit(uint8_t *data, uint8_t bit, uint8_t bit_count) { for (int i = 0; i < bit_count; i++) { encode_acc = (encode_acc << 1) | (bit & 0x01); encode_acc_bit_count++; @@ -113,7 +113,7 @@ static void EncodeAddBit(uint8_t* data, uint8_t bit, uint8_t bit_count) { } } -static uint32_t EncodeFinish(uint8_t* data) { +static uint32_t EncodeFinish(uint8_t *data) { if (encode_acc_bit_count > 0) { encode_acc = encode_acc << (8 - encode_acc_bit_count); data[encode_indx++] = encode_acc; @@ -158,7 +158,7 @@ static uint32_t HfEncodeTkm(uint8_t *uid, uint8_t modulation, uint8_t *data) { // 0 --- 8 --- 12-15 --- 18-19 --- 26-28 --- 32 // DO NOT NORMALIZE!!!! it must be with some error like this!!!! // `00` -- 1-25-1-5 - // `01` -- 1-12-1-18 + // `01` -- 1-12-1-18 // `10` -- 1-17-1-13 // `11` -- 1-7-1-23 @@ -206,7 +206,7 @@ int HfWriteTkm(uint8_t *uid, uint8_t modulation, uint32_t timeout) { LEDsoff(); - uint8_t* data = BigBuf_calloc(256); + uint8_t *data = BigBuf_calloc(256); uint32_t elen = HfEncodeTkm(uid, modulation, data); if (elen == 0) { DbpString("encode error"); diff --git a/armsrc/hfops.h b/armsrc/hfops.h index f1d705913..91f1de539 100644 --- a/armsrc/hfops.h +++ b/armsrc/hfops.h @@ -24,4 +24,4 @@ int HfReadADC(uint32_t samplesCount, bool ledcontrol); int HfWriteTkm(uint8_t *uid, uint8_t modulation, uint32_t timeout); -#endif \ No newline at end of file +#endif diff --git a/doc/commands.json b/doc/commands.json index 5fb476e59..dfc8a4647 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -6324,6 +6324,27 @@ ], "usage": "hf texkom reader [-hv]" }, + "hf texkom sim": { + "command": "hf texkom sim", + "description": "Simulate a texkom tag", + "notes": [ + "hf texkom sim", + "", + "hf texkom sim --raw FFFF638C7DC45553 -> simulate TK13 tag with id 8C7DC455", + "hf texkom sim --tk17 --raw FFFFCA17F31EC512 -> simulate TK17 tag with id 17F31EC5", + "hf texkom sim --id 8C7DC455 -> simulate TK13 tag with id 8C7DC455", + "hf texkom sim --id 8C7DC455 --tk17 -> simulate TK17 tag with id 17F31EC5" + ], + "offline": false, + "options": [ + "-h, --help This help", + "-v, --verbose Verbose work", + "-t, --tk17 Use TK-17 modulation (TK-13 by default)", + "--raw Raw data for texkom card, 8 bytes. Manual modulation select.", + "--id Raw data for texkom card, 8 bytes. Manual modulation select." + ], + "usage": "hf texkom sim [-hvt] [--raw ] [--id ]" + }, "hf thinfilm help": { "command": "hf thinfilm help", "description": "help This help list List NFC Barcode / Thinfilm history - not correct", @@ -6585,8 +6606,8 @@ "command": "hw connect", "description": "Connects to a Proxmark3 device via specified serial port. Baudrate here is only for physical UART or UART-BT, NOT for USB-CDC or blue shark add-on", "notes": [ - "hw connect -p /dev/ttyACM0", - "hw connect -p /dev/ttyACM0 -b 115200" + "hw connect -p /dev/ttyacm0", + "hw connect -p /dev/ttyacm0 -b 115200" ], "offline": true, "options": [ @@ -11055,8 +11076,8 @@ } }, "metadata": { - "commands_extracted": 698, + "commands_extracted": 699, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2022-06-30T19:19:33" + "extracted_on": "2022-07-03T21:31:15" } } \ No newline at end of file diff --git a/doc/commands.md b/doc/commands.md index fe57dfbdb..4f03dee72 100644 --- a/doc/commands.md +++ b/doc/commands.md @@ -654,6 +654,7 @@ Check column "offline" for their availability. |------- |------- |----------- |`hf texkom help `|Y |`This help` |`hf texkom reader `|N |`Act like a Texkom reader` +|`hf texkom sim `|N |`Simulate a Texkom tag` ### hf xerox