mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 18:57:12 +08:00
fix: 'lf visa' - use defines instead
This commit is contained in:
parent
ae719c3b05
commit
1cf3e1b581
1 changed files with 13 additions and 15 deletions
|
@ -96,8 +96,7 @@ int detectVisa2k(uint8_t *dest, size_t *size) {
|
||||||
//see ASKDemod for what args are accepted
|
//see ASKDemod for what args are accepted
|
||||||
int CmdVisa2kDemod(const char *Cmd) {
|
int CmdVisa2kDemod(const char *Cmd) {
|
||||||
|
|
||||||
// save GraphBuffer - to restore it later
|
save_restoreGB(GRAPH_SAVE);
|
||||||
save_restoreGB(1);
|
|
||||||
|
|
||||||
//sCmdAskEdgeDetect("");
|
//sCmdAskEdgeDetect("");
|
||||||
|
|
||||||
|
@ -105,7 +104,7 @@ int CmdVisa2kDemod(const char *Cmd) {
|
||||||
bool st = true;
|
bool st = true;
|
||||||
if (!ASKDemod_ext("64 0 0", false, false, 1, &st)) {
|
if (!ASKDemod_ext("64 0 0", false, false, 1, &st)) {
|
||||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Visa2k: ASK/Manchester Demod failed");
|
PrintAndLogEx(DEBUG, "DEBUG: Error - Visa2k: ASK/Manchester Demod failed");
|
||||||
save_restoreGB(0);
|
save_restoreGB(GRAPH_RESTORE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
size_t size = DemodBufferLen;
|
size_t size = DemodBufferLen;
|
||||||
|
@ -120,7 +119,7 @@ int CmdVisa2kDemod(const char *Cmd) {
|
||||||
else
|
else
|
||||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Visa2k: ans: %d", ans);
|
PrintAndLogEx(DEBUG, "DEBUG: Error - Visa2k: ans: %d", ans);
|
||||||
|
|
||||||
save_restoreGB(0);
|
save_restoreGB(GRAPH_RESTORE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
setDemodBuf(DemodBuffer, 96, ans);
|
setDemodBuf(DemodBuffer, 96, ans);
|
||||||
|
@ -138,7 +137,7 @@ int CmdVisa2kDemod(const char *Cmd) {
|
||||||
// test checksums
|
// test checksums
|
||||||
if ( chk != calc ) {
|
if ( chk != calc ) {
|
||||||
PrintAndLogEx(DEBUG, "DEBUG: error: Visa2000 checksum failed %x - %x\n", chk, calc);
|
PrintAndLogEx(DEBUG, "DEBUG: error: Visa2000 checksum failed %x - %x\n", chk, calc);
|
||||||
save_restoreGB(0);
|
save_restoreGB(GRAPH_RESTORE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// parity
|
// parity
|
||||||
|
@ -146,17 +145,16 @@ int CmdVisa2kDemod(const char *Cmd) {
|
||||||
uint8_t chk_par = (raw3 & 0xFF0) >> 4;
|
uint8_t chk_par = (raw3 & 0xFF0) >> 4;
|
||||||
if ( calc_par != chk_par) {
|
if ( calc_par != chk_par) {
|
||||||
PrintAndLogEx(DEBUG, "DEBUG: error: Visa2000 parity failed %x - %x\n", chk_par, calc_par);
|
PrintAndLogEx(DEBUG, "DEBUG: error: Visa2000 parity failed %x - %x\n", chk_par, calc_par);
|
||||||
save_restoreGB(0);
|
save_restoreGB(GRAPH_RESTORE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
PrintAndLogEx(SUCCESS, "Visa2000 Tag Found: Card ID %u, Raw: %08X%08X%08X", raw2, raw1 ,raw2, raw3);
|
PrintAndLogEx(SUCCESS, "Visa2000 Tag Found: Card ID %u, Raw: %08X%08X%08X", raw2, raw1 ,raw2, raw3);
|
||||||
save_restoreGB(0);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 64*96*2=12288 samples just in case we just missed the first preamble we can still catch 2 of them
|
// 64*96*2=12288 samples just in case we just missed the first preamble we can still catch 2 of them
|
||||||
int CmdVisa2kRead(const char *Cmd) {
|
int CmdVisa2kRead(const char *Cmd) {
|
||||||
lf_read(true, 12500);
|
lf_read(true, 14000);
|
||||||
return CmdVisa2kDemod(Cmd);
|
return CmdVisa2kDemod(Cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,21 +223,21 @@ int CmdVisa2kSim(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static command_t CommandTable[] = {
|
static command_t CommandTable[] = {
|
||||||
{"help", CmdHelp, 1, "This help"},
|
{"help", CmdHelp, 1, "This help"},
|
||||||
{"demod", CmdVisa2kDemod, 1, "demodulate an VISA2000 tag from the GraphBuffer"},
|
{"demod", CmdVisa2kDemod, 1, "demodulate an VISA2000 tag from the GraphBuffer"},
|
||||||
{"read", CmdVisa2kRead, 0, "attempt to read and extract tag data from the antenna"},
|
{"read", CmdVisa2kRead, 0, "attempt to read and extract tag data from the antenna"},
|
||||||
{"clone", CmdVisa2kClone, 0, "clone Visa2000 to t55x7"},
|
{"clone", CmdVisa2kClone, 0, "clone Visa2000 to t55x7"},
|
||||||
{"sim", CmdVisa2kSim, 0, "simulate Visa2000 tag"},
|
{"sim", CmdVisa2kSim, 0, "simulate Visa2000 tag"},
|
||||||
{NULL, NULL, 0, NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
int CmdLFVisa2k(const char *Cmd) {
|
int CmdLFVisa2k(const char *Cmd) {
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
CmdsParse(CommandTable, Cmd);
|
CmdsParse(CommandTable, Cmd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CmdHelp(const char *Cmd) {
|
int CmdHelp(const char *Cmd) {
|
||||||
CmdsHelp(CommandTable);
|
CmdsHelp(CommandTable);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue