add 'lf hid watch' , 'lf awid watch', 'lf io watch'

This commit is contained in:
iceman1001 2019-09-22 13:04:28 +02:00
commit 9cdc26207f
3 changed files with 27 additions and 39 deletions

View file

@ -29,23 +29,18 @@
#include "cmdlft55xx.h" // verifywrite #include "cmdlft55xx.h" // verifywrite
static int CmdHelp(const char *Cmd); static int CmdHelp(const char *Cmd);
/*
static int usage_lf_awid_read(void) { static int usage_lf_awid_watch(void) {
PrintAndLogEx(NORMAL, "Enables AWID compatible reader mode printing details of scanned AWID26 or AWID50 tags."); PrintAndLogEx(NORMAL, "Enables AWID compatible reader mode printing details of scanned AWID26 or AWID50 tags.");
PrintAndLogEx(NORMAL, "By default, values are printed and logged until the button is pressed or another USB command is issued."); PrintAndLogEx(NORMAL, "By default, values are printed and logged until the button is pressed or another USB command is issued.");
PrintAndLogEx(NORMAL, "If the [1] option is provided, reader mode is exited after reading a single AWID card.");
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
PrintAndLogEx(NORMAL, "Usage: lf awid read [h] [1]"); PrintAndLogEx(NORMAL, "Usage: lf awid watch");
PrintAndLogEx(NORMAL, "Options:");
PrintAndLogEx(NORMAL, " h : This help");
PrintAndLogEx(NORMAL, " 1 : (optional) stop after reading a single card");
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
PrintAndLogEx(NORMAL, "Examples:"); PrintAndLogEx(NORMAL, "Examples:");
PrintAndLogEx(NORMAL, " lf awid read"); PrintAndLogEx(NORMAL, " lf awid watch");
PrintAndLogEx(NORMAL, " lf awid read 1");
return PM3_SUCCESS; return PM3_SUCCESS;
} }
*/
static int usage_lf_awid_sim(void) { static int usage_lf_awid_sim(void) {
PrintAndLogEx(NORMAL, "Enables simulation of AWID card with specified facility-code and card number."); PrintAndLogEx(NORMAL, "Enables simulation of AWID card with specified facility-code and card number.");
PrintAndLogEx(NORMAL, "Simulation runs until the button is pressed or another USB command is issued."); PrintAndLogEx(NORMAL, "Simulation runs until the button is pressed or another USB command is issued.");
@ -180,18 +175,17 @@ static void verify_values(uint8_t *fmtlen, uint32_t *fc, uint32_t *cn) {
break; break;
} }
} }
/*
// this read loops on device side. // this read loops on device side.
// uses the demod in lfops.c // uses the demod in lfops.c
static int CmdAWIDRead_device(const char *Cmd) { static int CmdAWIDWatch(const char *Cmd) {
uint8_t ctmp = tolower(param_getchar(Cmd, 0));
if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_awid_read(); if (ctmp == 'h') return usage_lf_awid_watch();
uint8_t findone = (Cmd[0] == '1') ? 1 : 0;
clearCommandBuffer(); clearCommandBuffer();
SendCommandMIX(CMD_LF_AWID_DEMOD, findone, 0, 0, NULL, 0); SendCommandNG(CMD_LF_AWID_DEMOD, NULL, 0);
return PM3_SUCCESS; return PM3_SUCCESS;
} }
*/
//by marshmellow //by marshmellow
//AWID Prox demod - FSK2a RF/50 with preamble of 00000001 (always a 96 bit data stream) //AWID Prox demod - FSK2a RF/50 with preamble of 00000001 (always a 96 bit data stream)
//print full AWID Prox ID and some bit format details if found //print full AWID Prox ID and some bit format details if found
@ -557,6 +551,7 @@ static command_t CommandTable[] = {
{"clone", CmdAWIDClone, IfPm3Lf, "clone AWID to T55x7"}, {"clone", CmdAWIDClone, IfPm3Lf, "clone AWID to T55x7"},
{"sim", CmdAWIDSim, IfPm3Lf, "simulate AWID tag"}, {"sim", CmdAWIDSim, IfPm3Lf, "simulate AWID tag"},
{"brute", CmdAWIDBrute, IfPm3Lf, "Bruteforce card number against reader"}, {"brute", CmdAWIDBrute, IfPm3Lf, "Bruteforce card number against reader"},
{"watch", CmdAWIDWatch, IfPm3Lf, "continuously watch for cards. Reader mode"},
{NULL, NULL, NULL, NULL} {NULL, NULL, NULL, NULL}
}; };

View file

@ -47,9 +47,7 @@ static int usage_lf_hid_watch(void) {
PrintAndLogEx(NORMAL, "Enables HID compatible reader mode printing details."); PrintAndLogEx(NORMAL, "Enables HID compatible reader mode printing details.");
PrintAndLogEx(NORMAL, "By default, values are printed and logged until the button is pressed or another USB command is issued."); PrintAndLogEx(NORMAL, "By default, values are printed and logged until the button is pressed or another USB command is issued.");
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
PrintAndLogEx(NORMAL, "Usage: lf hid watch [h]"); PrintAndLogEx(NORMAL, "Usage: lf hid watch");
PrintAndLogEx(NORMAL, "Options:");
PrintAndLogEx(NORMAL, " h : This help");
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
PrintAndLogEx(NORMAL, "Examples:"); PrintAndLogEx(NORMAL, "Examples:");
PrintAndLogEx(NORMAL, " lf hid watch"); PrintAndLogEx(NORMAL, " lf hid watch");
@ -264,11 +262,10 @@ static int CmdHIDRead(const char *Cmd) {
// this read loops on device side. // this read loops on device side.
// uses the demod in lfops.c // uses the demod in lfops.c
static int CmdHIDWatch(const char *Cmd) { static int CmdHIDWatch(const char *Cmd) {
uint8_t ctmp = tolower(param_getchar(Cmd, 0)); uint8_t ctmp = tolower(param_getchar(Cmd, 0));
if ( strlen(Cmd) == 0 || ctmp == 'h') return usage_lf_hid_watch(); if (ctmp == 'h') return usage_lf_hid_watch();
clearCommandBuffer(); clearCommandBuffer();
SendCommandMIX(CMD_LF_HID_DEMOD, 0, 0, 0, NULL, 0); SendCommandNG(CMD_LF_HID_DEMOD, NULL, 0);
return PM3_SUCCESS; return PM3_SUCCESS;
} }

View file

@ -27,23 +27,18 @@
#include "cmdlft55xx.h" // verifywrite #include "cmdlft55xx.h" // verifywrite
static int CmdHelp(const char *Cmd); static int CmdHelp(const char *Cmd);
/*
static int usage_lf_io_read(void) { static int usage_lf_io_watch(void) {
PrintAndLogEx(NORMAL, "Enables IOProx compatible reader mode printing details of scanned tags."); PrintAndLogEx(NORMAL, "Enables IOProx compatible reader mode printing details of scanned tags.");
PrintAndLogEx(NORMAL, "By default, values are printed and logged until the button is pressed or another USB command is issued."); PrintAndLogEx(NORMAL, "By default, values are printed and logged until the button is pressed or another USB command is issued.");
PrintAndLogEx(NORMAL, "If the [1] option is provided, reader mode is exited after reading a single card.");
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
PrintAndLogEx(NORMAL, "Usage: lf io read [h] [1]"); PrintAndLogEx(NORMAL, "Usage: lf io watch");
PrintAndLogEx(NORMAL, "Options:");
PrintAndLogEx(NORMAL, " h : This help");
PrintAndLogEx(NORMAL, " 1 : (optional) stop after reading a single card");
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
PrintAndLogEx(NORMAL, "Examples:"); PrintAndLogEx(NORMAL, "Examples:");
PrintAndLogEx(NORMAL, " lf io read"); PrintAndLogEx(NORMAL, " lf io watch");
PrintAndLogEx(NORMAL, " lf io read 1");
return PM3_SUCCESS; return PM3_SUCCESS;
} }
*/
static int usage_lf_io_sim(void) { static int usage_lf_io_sim(void) {
PrintAndLogEx(NORMAL, "Enables simulation of IOProx card with specified facility-code and card number."); PrintAndLogEx(NORMAL, "Enables simulation of IOProx card with specified facility-code and card number.");
PrintAndLogEx(NORMAL, "Simulation runs until the button is pressed or another USB command is issued."); PrintAndLogEx(NORMAL, "Simulation runs until the button is pressed or another USB command is issued.");
@ -76,17 +71,17 @@ static int usage_lf_io_clone(void) {
PrintAndLogEx(NORMAL, " lf io clone 26 101 1337"); PrintAndLogEx(NORMAL, " lf io clone 26 101 1337");
return PM3_SUCCESS; return PM3_SUCCESS;
} }
/*
// this read loops on device side. // this read loops on device side.
// uses the demod in lfops.c // uses the demod in lfops.c
static int CmdIOProxRead_device(const char *Cmd) { static int CmdIOProxWatch(const char *Cmd) {
if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_io_read(); uint8_t ctmp = tolower(param_getchar(Cmd, 0));
int findone = (Cmd[0] == '1') ? 1 : 0; if (ctmp == 'h') return usage_lf_io_watch();
clearCommandBuffer(); clearCommandBuffer();
SendCommandMIX(CMD_LF_IO_DEMOD, findone, 0, 0, NULL, 0); SendCommandNG(CMD_LF_IO_DEMOD, NULL, 0);
return PM3_SUCCESS; return PM3_SUCCESS;
} }
*/
//by marshmellow //by marshmellow
//IO-Prox demod - FSK RF/64 with preamble of 000000001 //IO-Prox demod - FSK RF/64 with preamble of 000000001
//print ioprox ID and some format details //print ioprox ID and some format details
@ -324,6 +319,7 @@ static command_t CommandTable[] = {
{"read", CmdIOProxRead, IfPm3Lf, "attempt to read and extract tag data"}, {"read", CmdIOProxRead, IfPm3Lf, "attempt to read and extract tag data"},
{"clone", CmdIOProxClone, IfPm3Lf, "clone IOProx to T55x7"}, {"clone", CmdIOProxClone, IfPm3Lf, "clone IOProx to T55x7"},
{"sim", CmdIOProxSim, IfPm3Lf, "simulate IOProx tag"}, {"sim", CmdIOProxSim, IfPm3Lf, "simulate IOProx tag"},
{"watch", CmdIOProxWatch, IfPm3Lf, "continuously watch for cards. Reader mode"},
{NULL, NULL, NULL, NULL} {NULL, NULL, NULL, NULL}
}; };