This commit is contained in:
iceman1001 2024-04-22 09:34:46 +02:00
commit 12e38cdfff
3 changed files with 12 additions and 23 deletions

View file

@ -2791,7 +2791,7 @@ static int CmdAsn1Decoder(const char *Cmd) {
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
arg_str0("d", NULL, "<hex>", "ASN1 encoded byte array"), arg_str0("d", NULL, "<hex>", "ASN1 encoded byte array"),
arg_lit0("t", "test", "perform selftest"), arg_lit0("t", "test", "perform self test"),
arg_param_end arg_param_end
}; };
CLIExecWithReturn(ctx, Cmd, argtable, false); CLIExecWithReturn(ctx, Cmd, argtable, false);
@ -2820,17 +2820,14 @@ static int CmdDiff(const char *Cmd) {
"data diff -w 4 -a hf-mfu-01020304.bin -b hf-mfu-04030201.bin\n" "data diff -w 4 -a hf-mfu-01020304.bin -b hf-mfu-04030201.bin\n"
"data diff -a fileA -b fileB\n" "data diff -a fileA -b fileB\n"
"data diff -a fileA --eb\n" "data diff -a fileA --eb\n"
// "data diff -a fileA --cb\n"
"data diff --fa fileA -b fileB\n" "data diff --fa fileA -b fileB\n"
"data diff --fa fileA --fb fileB\n" "data diff --fa fileA --fb fileB\n"
// "data diff --ea --cb\n"
); );
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
arg_str0("a", NULL, "<fn>", "input file name A"), arg_str0("a", NULL, "<fn>", "input file name A"),
arg_str0("b", NULL, "<fn>", "input file name B"), arg_str0("b", NULL, "<fn>", "input file name B"),
// arg_lit0(NULL, "cb", "magic gen1 <hf mf csave>"),
arg_lit0(NULL, "eb", "emulator memory <hf mf esave>"), arg_lit0(NULL, "eb", "emulator memory <hf mf esave>"),
arg_str0(NULL, "fa", "<fn>", "input spiffs file A"), arg_str0(NULL, "fa", "<fn>", "input spiffs file A"),
arg_str0(NULL, "fb", "<fn>", "input spiffs file B"), arg_str0(NULL, "fb", "<fn>", "input spiffs file B"),
@ -2847,7 +2844,6 @@ static int CmdDiff(const char *Cmd) {
char filenameB[FILE_PATH_SIZE] = {0}; char filenameB[FILE_PATH_SIZE] = {0};
CLIParamStrToBuf(arg_get_str(ctx, 2), (uint8_t *)filenameB, FILE_PATH_SIZE, &fnlenB); CLIParamStrToBuf(arg_get_str(ctx, 2), (uint8_t *)filenameB, FILE_PATH_SIZE, &fnlenB);
// bool use_c = arg_get_lit(ctx, 3);
bool use_e = arg_get_lit(ctx, 3); bool use_e = arg_get_lit(ctx, 3);
// SPIFFS filename A // SPIFFS filename A
@ -2952,14 +2948,6 @@ static int CmdDiff(const char *Cmd) {
} }
} }
// dump magic card memory
/*
if (use_c) {
PrintAndLogEx(INFO, " To be implemented, feel free to contribute!");
return PM3_ENOTIMPL;
}
*/
size_t biggest = (datalenA > datalenB) ? datalenA : datalenB; size_t biggest = (datalenA > datalenB) ? datalenA : datalenB;
PrintAndLogEx(DEBUG, "data len: %zu A %zu B %zu", biggest, datalenA, datalenB); PrintAndLogEx(DEBUG, "data len: %zu A %zu B %zu", biggest, datalenA, datalenB);
@ -2971,7 +2959,6 @@ static int CmdDiff(const char *Cmd) {
PrintAndLogEx(INFO, "inB null"); PrintAndLogEx(INFO, "inB null");
} }
char hdr0[400] = {0}; char hdr0[400] = {0};
int hdr_sln = (width * 4) + 2; int hdr_sln = (width * 4) + 2;
@ -3417,7 +3404,7 @@ static int CmdAtrLookup(const char *Cmd) {
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
arg_str0("d", NULL, "<hex>", "ASN1 encoded byte array"), arg_str0("d", NULL, "<hex>", "ASN1 encoded byte array"),
// arg_lit0("t", "test", "perform selftest"), // arg_lit0("t", "test", "perform self test"),
arg_param_end arg_param_end
}; };
CLIExecWithReturn(ctx, Cmd, argtable, false); CLIExecWithReturn(ctx, Cmd, argtable, false);

View file

@ -2147,8 +2147,9 @@ static int CmdHFiClassDump(const char *Cmd) {
write_dump: write_dump:
if (have_credit_key && pagemap != 0x01 && aa2_success == false) if (have_credit_key && pagemap != 0x01 && aa2_success == false) {
PrintAndLogEx(INFO, "Reading AA2 failed. dumping AA1 data to file"); PrintAndLogEx(INFO, "Reading AA2 failed. dumping AA1 data to file");
}
// print the dump // print the dump
printIclassDumpContents(tag_data, 1, (bytes_got / 8), bytes_got, dense_output); printIclassDumpContents(tag_data, 1, (bytes_got / 8), bytes_got, dense_output);
@ -2852,8 +2853,8 @@ static int CmdHFiClass_loclass(const char *Cmd) {
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
arg_str0("f", "file", "<fn>", "filename with nr/mac data from `hf iclass sim -t 2` "), arg_str0("f", "file", "<fn>", "filename with nr/mac data from `hf iclass sim -t 2` "),
arg_lit0(NULL, "test", "Perform self-test"), arg_lit0(NULL, "test", "Perform self test"),
arg_lit0(NULL, "long", "Perform self-test, including long ones"), arg_lit0(NULL, "long", "Perform self test, including long ones"),
arg_param_end arg_param_end
}; };
CLIExecWithReturn(ctx, Cmd, argtable, false); CLIExecWithReturn(ctx, Cmd, argtable, false);
@ -3776,9 +3777,10 @@ out:
static int CmdHFiClassLookUp(const char *Cmd) { static int CmdHFiClassLookUp(const char *Cmd) {
CLIParserContext *ctx; CLIParserContext *ctx;
CLIParserInit(&ctx, "hf iclass lookup", CLIParserInit(&ctx, "hf iclass lookup",
"Lookup keys takes some sniffed trace data and tries to verify what key was used against a dictionary file", "This command take sniffed trace data and try to recovery a iCLASS Standard or iCLASS Elite key.",
"hf iclass lookup --csn 9655a400f8ff12e0 --epurse f0ffffffffffffff --macs 0000000089cb984b -f iclass_default_keys.dic\n" "hf iclass lookup --csn 9655a400f8ff12e0 --epurse f0ffffffffffffff --macs 0000000089cb984b -f iclass_default_keys.dic\n"
"hf iclass lookup --csn 9655a400f8ff12e0 --epurse f0ffffffffffffff --macs 0000000089cb984b -f iclass_default_keys.dic --elite"); "hf iclass lookup --csn 9655a400f8ff12e0 --epurse f0ffffffffffffff --macs 0000000089cb984b -f iclass_default_keys.dic --elite"
);
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
@ -4628,9 +4630,9 @@ static int CmdHFiClassSAM(const char *Cmd) {
} }
static command_t CommandTable[] = { static command_t CommandTable[] = {
{"-----------", CmdHelp, AlwaysAvailable, "--------------------- " _CYAN_("General") " ---------------------"},
{"help", CmdHelp, AlwaysAvailable, "This help"}, {"help", CmdHelp, AlwaysAvailable, "This help"},
{"list", CmdHFiClassList, AlwaysAvailable, "List iclass history"}, {"list", CmdHFiClassList, AlwaysAvailable, "List iclass history"},
// {"-----------", CmdHelp, AlwaysAvailable, "--------------------- " _CYAN_("General") " ---------------------"},
{"-----------", CmdHelp, IfPm3Iclass, "------------------- " _CYAN_("Operations") " -------------------"}, {"-----------", CmdHelp, IfPm3Iclass, "------------------- " _CYAN_("Operations") " -------------------"},
// {"clone", CmdHFiClassClone, IfPm3Iclass, "Create a HID credential to Picopass / iCLASS tag"}, // {"clone", CmdHFiClassClone, IfPm3Iclass, "Create a HID credential to Picopass / iCLASS tag"},
{"dump", CmdHFiClassDump, IfPm3Iclass, "Dump Picopass / iCLASS tag to file"}, {"dump", CmdHFiClassDump, IfPm3Iclass, "Dump Picopass / iCLASS tag to file"},

View file

@ -238,7 +238,7 @@ static void jooki_print(uint8_t *b64, uint8_t *result, bool verbose) {
static int jooki_selftest(void) { static int jooki_selftest(void) {
PrintAndLogEx(INFO, "======== " _CYAN_("selftest") " ==========================================="); PrintAndLogEx(INFO, "======== " _CYAN_("self test") " ===========================================");
for (int i = 0; i < ARRAYLEN(jooks); i++) { for (int i = 0; i < ARRAYLEN(jooks); i++) {
if (strlen(jooks[i].b64) == 0) if (strlen(jooks[i].b64) == 0)
continue; continue;
@ -296,7 +296,7 @@ static int CmdHF14AJookiEncode(const char *Cmd) {
arg_param_begin, arg_param_begin,
arg_str0("u", "uid", "<hex>", "uid bytes"), arg_str0("u", "uid", "<hex>", "uid bytes"),
arg_lit0("r", NULL, "read uid from tag instead"), arg_lit0("r", NULL, "read uid from tag instead"),
arg_lit0("t", NULL, "selftest"), arg_lit0("t", NULL, "self test"),
arg_lit0("v", "verbose", "verbose output"), arg_lit0("v", "verbose", "verbose output"),
arg_lit0(NULL, "dragon", "figurine type"), arg_lit0(NULL, "dragon", "figurine type"),
arg_lit0(NULL, "fox", "figurine type"), arg_lit0(NULL, "fox", "figurine type"),