mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
chg: hitag dump should be in its own command
This commit is contained in:
parent
e0cd9c38da
commit
3fe4582e28
1 changed files with 29 additions and 29 deletions
|
@ -563,25 +563,11 @@ static int CmdLFHitagReader(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t id = bytes_to_num(resp.data.asBytes, 4);
|
uint32_t id = bytes_to_num(resp.data.asBytes, 4);
|
||||||
|
uint8_t *data = NULL;
|
||||||
PrintAndLogEx(SUCCESS, " UID: " _YELLOW_("%08x"), id);
|
PrintAndLogEx(SUCCESS, " UID: " _YELLOW_("%08x"), id);
|
||||||
|
|
||||||
if (htf != RHT2F_UID_ONLY) {
|
if (htf != RHT2F_UID_ONLY) {
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "Dumping tag memory...");
|
|
||||||
uint8_t *data = resp.data.asBytes;
|
|
||||||
|
|
||||||
char filename[FILE_PATH_SIZE];
|
|
||||||
char *fnameptr = filename;
|
|
||||||
fnameptr += sprintf(fnameptr, "lf-hitag-");
|
|
||||||
FillFileNameByUID(fnameptr, data, "-dump", 4);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
saveFile(filename, ".bin", data, 48);
|
|
||||||
saveFileEML(filename, data, 48, 4);
|
|
||||||
saveFileJSON(filename, jsfHitag, data, 48);
|
|
||||||
|
|
||||||
// block3, 1 byte
|
// block3, 1 byte
|
||||||
printHitagConfiguration(data[4 * 3]);
|
printHitagConfiguration(data[4 * 3]);
|
||||||
}
|
}
|
||||||
|
@ -688,16 +674,29 @@ static int CmdLFHitagWriter(const char *Cmd) {
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
static int CmdLFHitag2Dump(const char *Cmd) {
|
||||||
static int CmdLFHitagDump(const char *Cmd) {
|
|
||||||
PrintAndLogEx(INFO, "Dumping of tag memory");
|
PrintAndLogEx(INFO, "Dumping of tag memory");
|
||||||
PrintAndLogEx(INFO, "To be done!");
|
|
||||||
|
|
||||||
char ctmp = tolower(param_getchar(Cmd, 0));
|
char ctmp = tolower(param_getchar(Cmd, 0));
|
||||||
if (ctmp == 'h') return usage_hitag_dump();
|
if (ctmp == 'h') return 0; // usage_hitag_dump();
|
||||||
|
|
||||||
|
PacketResponseNG resp;
|
||||||
|
|
||||||
|
PrintAndLogEx(SUCCESS, "Dumping tag memory...");
|
||||||
|
uint8_t *data = resp.data.asBytes;
|
||||||
|
|
||||||
|
char filename[FILE_PATH_SIZE];
|
||||||
|
char *fnameptr = filename;
|
||||||
|
fnameptr += sprintf(fnameptr, "lf-hitag-");
|
||||||
|
FillFileNameByUID(fnameptr, data, "-dump", 4);
|
||||||
|
|
||||||
|
saveFile(filename, ".bin", data, 48);
|
||||||
|
saveFileEML(filename, data, 48, 4);
|
||||||
|
saveFileJSON(filename, jsfHitag, data, 48);
|
||||||
|
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// Annotate HITAG protocol
|
// Annotate HITAG protocol
|
||||||
void annotateHitag1(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
|
void annotateHitag1(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
|
||||||
|
@ -747,6 +746,7 @@ static command_t CommandTable[] = {
|
||||||
{"sim", CmdLFHitagSim, IfPm3Hitag, "Simulate Hitag transponder" },
|
{"sim", CmdLFHitagSim, IfPm3Hitag, "Simulate Hitag transponder" },
|
||||||
{"sniff", CmdLFHitagSniff, IfPm3Hitag, "Eavesdrop Hitag communication" },
|
{"sniff", CmdLFHitagSniff, IfPm3Hitag, "Eavesdrop Hitag communication" },
|
||||||
{"writer", CmdLFHitagWriter, IfPm3Hitag, "Act like a Hitag Writer" },
|
{"writer", CmdLFHitagWriter, IfPm3Hitag, "Act like a Hitag Writer" },
|
||||||
|
{"dump", CmdLFHitag2Dump, IfPm3Hitag, "Dump Hitag2 tag" },
|
||||||
{"cc", CmdLFHitagCheckChallenges, IfPm3Hitag, "Test all challenges" },
|
{"cc", CmdLFHitagCheckChallenges, IfPm3Hitag, "Test all challenges" },
|
||||||
{ NULL, NULL, 0, NULL }
|
{ NULL, NULL, 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue