Merge pull request #2529 from douniwan5788/move_to_hts

Move to hts
This commit is contained in:
Iceman authored and GitHub committed 2024-09-22 10:32:13 +03:00
commit 0331b66e78
2 files changed
+51 -112

No files matched your search

+26
View File
@@ -340,6 +340,7 @@ static int CmdLFHitagSWrite(const char *Cmd) {
return PM3_EINVARG;
} else if (auth_methods == 0) {
use_plain = true;
PrintAndLogEx(INFO, "Write to " _YELLOW_("Hitag S") " in Plain mode");
}
lf_hitag_data_t packet;
@@ -351,6 +352,7 @@ static int CmdLFHitagSWrite(const char *Cmd) {
if (use_nrar) {
packet.cmd = WHTSF_CHALLENGE;
memcpy(packet.NrAr, nrar, sizeof(packet.NrAr));
PrintAndLogEx(INFO, "Authenticating to " _YELLOW_("Hitag S") " in Challenge mode");
}
if (use_82xx) {
@@ -361,6 +363,7 @@ static int CmdLFHitagSWrite(const char *Cmd) {
if (use_crypto) {
packet.cmd = WHTSF_KEY;
memcpy(packet.key, key, sizeof(packet.key));
PrintAndLogEx(INFO, "Authenticating to " _YELLOW_("Hitag S") " in Crypto mode");
}
clearCommandBuffer();
@@ -418,6 +421,28 @@ static int CmdLFHitagSReader(const char *Cmd) {
return PM3_SUCCESS;
}
static int CmdLFHitagSSim(const char *Cmd) {
CLIParserContext *ctx;
CLIParserInit(&ctx, "lf hitag hts sim",
"Simulate Hitag S transponder\n"
"You need to `lf hitag hts eload` first",
"lf hitag hts sim\n"
"lf hitag hts sim --82xx");
void *argtable[] = {
arg_param_begin,
arg_lit0("8", "82xx", "simulate 8268/8310"),
arg_param_end};
CLIExecWithReturn(ctx, Cmd, argtable, true);
// bool use_82xx = arg_get_lit(ctx, 1); // not implemented yet
CLIParserFree(ctx);
clearCommandBuffer();
SendCommandNG(CMD_LF_HITAGS_SIMULATE, NULL, 0);
return PM3_SUCCESS;
}
static int CmdLFHitagSList(const char *Cmd) {
return CmdTraceListAlias(Cmd, "lf hitag hts", "hitags");
}
@@ -470,6 +495,7 @@ static command_t CommandTable[] = {
{"reader", CmdLFHitagSReader, IfPm3Hitag, "Act like a Hitag S reader"},
{"rdbl", CmdLFHitagSRead, IfPm3Hitag, "Read Hitag S memory"},
{"wrbl", CmdLFHitagSWrite, IfPm3Hitag, "Write Hitag S page"},
{"sim", CmdLFHitagSSim, IfPm3Hitag, "Simulate Hitag transponder"},
{NULL, NULL, 0, NULL}
};