mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
style
This commit is contained in:
parent
21e54ba9b1
commit
238572c337
14 changed files with 81 additions and 82 deletions
|
@ -1734,7 +1734,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
case CMD_HF_MIFARE_CIDENT: {
|
||||
|
||||
|
||||
struct p {
|
||||
struct p {
|
||||
uint8_t is_mfc;
|
||||
uint8_t keytype;
|
||||
uint8_t key[6];
|
||||
|
|
|
@ -3516,7 +3516,7 @@ void ReaderMifare(bool first_try, uint8_t block, uint8_t keytype) {
|
|||
*/
|
||||
void DetectNACKbug(void) {
|
||||
uint8_t mf_auth[4] = { MIFARE_AUTH_KEYA, 0x00, 0xF5, 0x7B };
|
||||
uint8_t mf_nr_ar[8]= { 0x00 };
|
||||
uint8_t mf_nr_ar[8] = { 0x00 };
|
||||
uint8_t uid[10] = { 0x00 };
|
||||
uint8_t receivedAnswer[MAX_MIFARE_FRAME_SIZE] = { 0x00 };
|
||||
uint8_t receivedAnswerPar[MAX_MIFARE_PARITY_SIZE] = { 0x00 };
|
||||
|
|
|
@ -2477,7 +2477,7 @@ void MifareCIdent(bool is_mfc, uint8_t keytype, uint8_t *key) {
|
|||
}
|
||||
|
||||
// reset card
|
||||
mf_reset_card();
|
||||
mf_reset_card();
|
||||
|
||||
res = iso14443a_select_card(uid, NULL, &cuid, true, 0, false);
|
||||
if (res) {
|
||||
|
|
|
@ -3416,7 +3416,7 @@ static int CmdNumCon(const char *Cmd) {
|
|||
continue;
|
||||
}
|
||||
|
||||
switch(i) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
// MBEDTLS_MPI_CHK(mbedtls_mpi_inv_mod(&N, &N, &base));
|
||||
break;
|
||||
|
|
|
@ -1285,7 +1285,7 @@ static void emrtd_print_issuance(char *data, bool ascii) {
|
|||
}
|
||||
|
||||
static void emrtd_print_personalization_timestamp(uint8_t *data, size_t datalen) {
|
||||
if (datalen < 7 ) {
|
||||
if (datalen < 7) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1294,13 +1294,13 @@ static void emrtd_print_personalization_timestamp(uint8_t *data, size_t datalen)
|
|||
|
||||
char final_date[20] = { 0x00 };
|
||||
snprintf(final_date, sizeof(final_date), "%.4s-%.2s-%.2s %.2s:%.2s:%.2s"
|
||||
, str_date
|
||||
, str_date + 4
|
||||
, str_date + 6
|
||||
, str_date + 8
|
||||
, str_date + 10
|
||||
, str_date + 12
|
||||
);
|
||||
, str_date
|
||||
, str_date + 4
|
||||
, str_date + 6
|
||||
, str_date + 8
|
||||
, str_date + 10
|
||||
, str_date + 12
|
||||
);
|
||||
|
||||
PrintAndLogEx(SUCCESS, "Personalization at....: " _YELLOW_("%s"), final_date);
|
||||
}
|
||||
|
@ -1311,13 +1311,13 @@ static void emrtd_print_unknown_timestamp_5f85(uint8_t *data, size_t datalen) {
|
|||
}
|
||||
char final_date[20] = { 0x00 };
|
||||
snprintf(final_date, sizeof(final_date), "%.4s-%.2s-%.2s %.2s:%.2s:%.2s"
|
||||
, data
|
||||
, data + 4
|
||||
, data + 6
|
||||
, data + 8
|
||||
, data + 10
|
||||
, data + 12
|
||||
);
|
||||
, data
|
||||
, data + 4
|
||||
, data + 6
|
||||
, data + 8
|
||||
, data + 10
|
||||
, data + 12
|
||||
);
|
||||
|
||||
PrintAndLogEx(SUCCESS, "Unknown timestamp 5F85: " _YELLOW_("%s"), final_date);
|
||||
PrintAndLogEx(HINT, "This is very likely the personalization timestamp, but it is using an undocumented tag.");
|
||||
|
|
|
@ -1682,46 +1682,46 @@ static int CmdHFMFPDump(const char *Cmd) {
|
|||
PrintAndLogEx(INFO, " To be implemented, feel free to contribute!");
|
||||
return PM3_ENOTIMPL;
|
||||
|
||||
/*
|
||||
mfpSetVerboseMode(verbose);
|
||||
/*
|
||||
mfpSetVerboseMode(verbose);
|
||||
|
||||
// read card
|
||||
uint8_t *mem = calloc(MIFARE_4K_MAXBLOCK * MFBLOCK_SIZE, sizeof(uint8_t));
|
||||
if (mem == NULL) {
|
||||
PrintAndLogEx(ERR, "failed to allocate memory");
|
||||
return PM3_EMALLOC;
|
||||
}
|
||||
// read card
|
||||
uint8_t *mem = calloc(MIFARE_4K_MAXBLOCK * MFBLOCK_SIZE, sizeof(uint8_t));
|
||||
if (mem == NULL) {
|
||||
PrintAndLogEx(ERR, "failed to allocate memory");
|
||||
return PM3_EMALLOC;
|
||||
}
|
||||
|
||||
|
||||
// iso14a_card_select_t card ;
|
||||
// int res = mfp_read_tag(&card, mem, key_fn);
|
||||
// if (res != PM3_SUCCESS) {
|
||||
// free(mem);
|
||||
// return res;
|
||||
// }
|
||||
// iso14a_card_select_t card ;
|
||||
// int res = mfp_read_tag(&card, mem, key_fn);
|
||||
// if (res != PM3_SUCCESS) {
|
||||
// free(mem);
|
||||
// return res;
|
||||
// }
|
||||
|
||||
|
||||
// Skip saving card data to file
|
||||
if (nosave) {
|
||||
PrintAndLogEx(INFO, "Called with no save option");
|
||||
// Skip saving card data to file
|
||||
if (nosave) {
|
||||
PrintAndLogEx(INFO, "Called with no save option");
|
||||
free(mem);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
// Save to file
|
||||
// if (strlen(data_fn) < 1) {
|
||||
// char *fptr = calloc(sizeof(char) * (strlen("hf-mfp-") + strlen("-dump")) + card.uidlen * 2 + 1, sizeof(uint8_t));
|
||||
// strcpy(fptr, "hf-mfp-");
|
||||
// FillFileNameByUID(fptr, card.uid, "-dump", card.uidlen);
|
||||
// strcpy(data_fn, fptr);
|
||||
// free(fptr);
|
||||
// }
|
||||
|
||||
// pm3_save_mf_dump(filename, dump, MIFARE_4K_MAX_BYTES, jsfCardMemory);
|
||||
|
||||
free(mem);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
// Save to file
|
||||
// if (strlen(data_fn) < 1) {
|
||||
// char *fptr = calloc(sizeof(char) * (strlen("hf-mfp-") + strlen("-dump")) + card.uidlen * 2 + 1, sizeof(uint8_t));
|
||||
// strcpy(fptr, "hf-mfp-");
|
||||
// FillFileNameByUID(fptr, card.uid, "-dump", card.uidlen);
|
||||
// strcpy(data_fn, fptr);
|
||||
// free(fptr);
|
||||
// }
|
||||
|
||||
// pm3_save_mf_dump(filename, dump, MIFARE_4K_MAX_BYTES, jsfCardMemory);
|
||||
|
||||
free(mem);
|
||||
return PM3_SUCCESS;
|
||||
*/
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1916,13 +1916,13 @@ int CmdLFfind(const char *Cmd) {
|
|||
PrintAndLogEx(INFO, _CYAN_("Checking for unknown tags...") "\n");
|
||||
|
||||
uint8_t ones[] = {
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
};
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
};
|
||||
|
||||
// FSK
|
||||
PrintAndLogEx(INFO, "FSK clock.......... " NOLF);
|
||||
|
|
|
@ -168,8 +168,8 @@ static int usart_bt_testcomm(uint32_t baudrate, uint8_t parity) {
|
|||
if (ret == PM3_SUCCESS) {
|
||||
PrintAndLogEx(SUCCESS, "RX (%3zu):%.*s", len, (int)len, data);
|
||||
if (str_startswith((char *)data, "hc01.comV2.0") ||
|
||||
str_startswith((char *)data, "www.hc01.com") ||
|
||||
str_startswith((char *)data, "BT SPP V4.0")) {
|
||||
str_startswith((char *)data, "www.hc01.com") ||
|
||||
str_startswith((char *)data, "BT SPP V4.0")) {
|
||||
|
||||
PrintAndLogEx(SUCCESS, "Add-on " _GREEN_("found!"));
|
||||
|
||||
|
@ -378,7 +378,7 @@ static int CmdUsartBtFactory(const char *Cmd) {
|
|||
} else {
|
||||
|
||||
memset(data, 0, sizeof(data));
|
||||
len=0;
|
||||
len = 0;
|
||||
string = "AT+BAUD=115200,N";
|
||||
PrintAndLogEx(SUCCESS, "TX (%3zu):%.*s", strlen(string), (int)strlen(string), string);
|
||||
|
||||
|
|
|
@ -108,8 +108,7 @@ serial_port uart_open(const char *pcPortName, uint32_t speed, bool slient) {
|
|||
bool isUDP = false;
|
||||
bool isBluetooth = false;
|
||||
bool isUnixSocket = false;
|
||||
if (strlen(prefix) > 4)
|
||||
{
|
||||
if (strlen(prefix) > 4) {
|
||||
isTCP = (memcmp(prefix, "tcp:", 4) == 0);
|
||||
isUDP = (memcmp(prefix, "udp:", 4) == 0);
|
||||
}
|
||||
|
|
|
@ -4709,7 +4709,7 @@
|
|||
},
|
||||
"hf mf info": {
|
||||
"command": "hf mf info",
|
||||
"description": "Information and check vulnerabilities in a MIFARE Classic card Some cards in order to extract information you need to specify key and/or specific keys in the copmmand line",
|
||||
"description": "Information and check vulnerabilities in a MIFARE Classic card Some cards in order to extract information you need to specify key and/or specific keys in the command line",
|
||||
"notes": [
|
||||
"hf mf info",
|
||||
"hf mf info -k FFFFFFFFFFFF -n -v"
|
||||
|
@ -7257,7 +7257,7 @@
|
|||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-1 Use data from Graphbuffer",
|
||||
"-1 Use data from Graphbuffer (offline mode)",
|
||||
"-v, --verbose Verbose scan and output",
|
||||
"-@ optional - continuous reader mode"
|
||||
],
|
||||
|
@ -10105,16 +10105,16 @@
|
|||
"description": "Read and search for valid known tag. For offline mode, you can `data load` first then search.",
|
||||
"notes": [
|
||||
"lf search -> try reading data from tag & search for known tag",
|
||||
"lf search -1 -> use data from the GraphBuffer & search for known tag",
|
||||
"lf search -u -> try reading data from tag & search for known and unknown tag",
|
||||
"lf search -1u -> use data from the GraphBuffer & search for known and unknown tag"
|
||||
"lf search -1 -> use data from the GraphBuffer & search for known tag",
|
||||
"lf search -1uc -> use data from the GraphBuffer & search for known and unknown tag"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-1 Use data from Graphbuffer to search",
|
||||
"-c Continue searching even after a first hit",
|
||||
"-u Search for unknown tags. If not set, reads only known tags"
|
||||
"-1 Use data from Graphbuffer to search (offline mode)",
|
||||
"-c Continue searching after successful match",
|
||||
"-u Search for unknown tags"
|
||||
],
|
||||
"usage": "lf search [-h1cu]"
|
||||
},
|
||||
|
@ -12160,6 +12160,6 @@
|
|||
"metadata": {
|
||||
"commands_extracted": 703,
|
||||
"extracted_by": "PM3Help2JSON v1.00",
|
||||
"extracted_on": "2023-12-18T09:05:00"
|
||||
"extracted_on": "2024-01-01T20:49:58"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue