diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index b86335c66..750c83c6b 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -294,6 +294,7 @@ set (TARGET_SOURCES ${PM3_ROOT}/client/src/cmdhfst25ta.c ${PM3_ROOT}/client/src/cmdhfthinfilm.c ${PM3_ROOT}/client/src/cmdhftopaz.c + ${PM3_ROOT}/client/src/cmdhftexkom.c ${PM3_ROOT}/client/src/cmdhfwaveshare.c ${PM3_ROOT}/client/src/cmdhw.c ${PM3_ROOT}/client/src/cmdlf.c diff --git a/client/Makefile b/client/Makefile index e2dd1a224..d4893b341 100644 --- a/client/Makefile +++ b/client/Makefile @@ -576,6 +576,7 @@ SRCS = mifare/aiddesfire.c \ cmdhfst25ta.c \ cmdhfthinfilm.c \ cmdhftopaz.c \ + cmdhftexkom.c \ cmdhfwaveshare.c \ cmdhw.c \ cmdlf.c \ diff --git a/client/src/cmdhf.c b/client/src/cmdhf.c index ccb697966..9ed214eac 100644 --- a/client/src/cmdhf.c +++ b/client/src/cmdhf.c @@ -47,6 +47,7 @@ #include "cmdhfseos.h" // SEOS #include "cmdhfst25ta.h" // ST25TA #include "cmdhfwaveshare.h" // Waveshare +#include "cmdhftexkom.h" // Texkom #include "cmdtrace.h" // trace list #include "ui.h" #include "proxgui.h" @@ -435,6 +436,7 @@ static command_t CommandTable[] = { {"st25ta", CmdHFST25TA, AlwaysAvailable, "{ ST25TA RFIDs... }"}, {"thinfilm", CmdHFThinfilm, AlwaysAvailable, "{ Thinfilm RFIDs... }"}, {"topaz", CmdHFTopaz, AlwaysAvailable, "{ TOPAZ (NFC Type 1) RFIDs... }"}, + {"texkom", CmdHFTexkom, AlwaysAvailable, "{ Texkom RFIDs... }"}, {"waveshare", CmdHFWaveshare, AlwaysAvailable, "{ Waveshare NFC ePaper... }"}, {"-----------", CmdHelp, AlwaysAvailable, "--------------------- " _CYAN_("General") " ---------------------"}, {"help", CmdHelp, AlwaysAvailable, "This help"}, diff --git a/client/src/cmdhftexkom.c b/client/src/cmdhftexkom.c new file mode 100644 index 000000000..54a1e47c7 --- /dev/null +++ b/client/src/cmdhftexkom.c @@ -0,0 +1,69 @@ +//----------------------------------------------------------------------------- +// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// 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. See the +// GNU General Public License for more details. +// +// See LICENSE.txt for the text of the license. +//----------------------------------------------------------------------------- +// High frequency proximity cards from TEXCOM commands +//----------------------------------------------------------------------------- + +#include "cmdhftexkom.h" + +#include +#include +#include +#include "cliparser.h" +#include "cmdparser.h" // command_t +#include "comms.h" +#include "ui.h" +#include "cmdhf14a.h" + +static int CmdHFTexkomReader(const char *Cmd) { + CLIParserContext *ctx; + CLIParserInit(&ctx, "hf texkom reader", + "Read a texkom tag", + "hf texkom reader"); + + void *argtable[] = { + arg_param_begin, + arg_param_end + }; + CLIExecWithReturn(ctx, Cmd, argtable, true); + CLIParserFree(ctx); + +// uint8_t param = 0; +// SendCommandNG(CMD_HF_TEXKOM_READER, (uint8_t *)¶m, sizeof(uint8_t)); + + return PM3_SUCCESS; +} + + +static int CmdHelp(const char *Cmd); + +static command_t CommandTable[] = { + {"help", CmdHelp, AlwaysAvailable, "This help"}, + {"reader", CmdHFTexkomReader, IfPm3Iso14443a, "Act like a Texkom reader"}, + //{"sim", CmdHFTexkomSim, IfPm3Iso14443a, "Simulate a Texkom tag"}, + //{"write", CmdHFTexkomWrite, IfPm3Iso14443a, "Write a Texkom tag"}, + {NULL, NULL, 0, NULL} +}; + +static int CmdHelp(const char *Cmd) { + (void)Cmd; // Cmd is not used so far + CmdsHelp(CommandTable); + return PM3_SUCCESS; +} + +int CmdHFTexkom(const char *Cmd) { + clearCommandBuffer(); + return CmdsParse(CommandTable, Cmd); +} diff --git a/client/src/cmdhftexkom.h b/client/src/cmdhftexkom.h new file mode 100644 index 000000000..9f4a3b32f --- /dev/null +++ b/client/src/cmdhftexkom.h @@ -0,0 +1,27 @@ +//----------------------------------------------------------------------------- +// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// 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. See the +// GNU General Public License for more details. +// +// See LICENSE.txt for the text of the license. +//----------------------------------------------------------------------------- +// High frequency proximity cards from TEXCOM commands +//----------------------------------------------------------------------------- + +#ifndef CMDHFTEXCOM_H__ +#define CMDHFTEXCOM_H__ + +#include "common.h" +#include "pm3_cmd.h" + +int CmdHFTexkom(const char *Cmd); + +#endif \ No newline at end of file