mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
text and style
This commit is contained in:
parent
35493f5b2c
commit
79400d0779
10 changed files with 25 additions and 36 deletions
|
@ -957,14 +957,17 @@ int CmdHF14ASim(const char *Cmd) {
|
|||
bool keypress = kbd_enter_pressed();
|
||||
while (keypress == false) {
|
||||
|
||||
if (WaitForResponseTimeout(CMD_HF_MIFARE_SIMULATE, &resp, 1500) == false)
|
||||
if (WaitForResponseTimeout(CMD_HF_MIFARE_SIMULATE, &resp, 1500) == false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (resp.status != PM3_SUCCESS)
|
||||
if (resp.status != PM3_SUCCESS) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((flags & FLAG_NR_AR_ATTACK) != FLAG_NR_AR_ATTACK)
|
||||
if ((flags & FLAG_NR_AR_ATTACK) != FLAG_NR_AR_ATTACK) {
|
||||
break;
|
||||
}
|
||||
|
||||
const nonces_t *data = (nonces_t *)resp.data.asBytes;
|
||||
readerAttack(k_sector, k_sectors_cnt, data[0], setEmulatorMem, verbose);
|
||||
|
|
|
@ -2130,8 +2130,9 @@ static int CmdHFiClassDump(const char *Cmd) {
|
|||
return PM3_EOPABORTED;
|
||||
}
|
||||
|
||||
if (WaitForResponseTimeout(CMD_HF_ICLASS_DUMP, &resp, 2000))
|
||||
if (WaitForResponseTimeout(CMD_HF_ICLASS_DUMP, &resp, 2000)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
|
|
|
@ -3939,7 +3939,9 @@ static int CmdHF14AMfChk_fast(const char *Cmd) {
|
|||
PrintAndLogEx(NORMAL, "");
|
||||
firstChunk = true;
|
||||
lastChunk = false;
|
||||
if (blockn != -1) break;
|
||||
if (blockn != -1) {
|
||||
break;
|
||||
}
|
||||
} // end strategy
|
||||
}
|
||||
out:
|
||||
|
@ -5247,7 +5249,7 @@ int CmdHF14AMfELoad(const char *Cmd) {
|
|||
|
||||
// update expected blocks to match converted data.
|
||||
block_cnt = bytes_read / MFU_BLOCK_SIZE;
|
||||
PrintAndLogEx(INFO, "MIFARE Ultralight override, will use %d blocks ( %u bytes )", block_cnt, block_cnt * block_width);
|
||||
PrintAndLogEx(INFO, "MIFARE Ultralight override, will use " _YELLOW_("%d") " blocks ( " _YELLOW_("%u") " bytes )", block_cnt, block_cnt * block_width);
|
||||
}
|
||||
|
||||
PrintAndLogEx(INFO, "Uploading to emulator memory");
|
||||
|
|
|
@ -315,7 +315,7 @@ static int mfp_load_keys(uint8_t **pkeyBlock, uint32_t *pkeycnt, uint8_t *userke
|
|||
|
||||
int len = hex_to_bytes(g_mifare_plus_default_keys[cnt], (uint8_t *)(*pkeyBlock + (*pkeycnt + cnt) * AES_KEY_LEN), AES_KEY_LEN);
|
||||
|
||||
PrintAndLogEx(DEBUG, _YELLOW_("%2d") " - %s", *pkeycnt + cnt, sprint_hex_inrow(*pkeyBlock + (*pkeycnt + cnt) * AES_KEY_LEN, AES_KEY_LEN));
|
||||
PrintAndLogEx(DEBUG, _YELLOW_("%2u") " - %s", *pkeycnt + cnt, sprint_hex_inrow(*pkeyBlock + (*pkeycnt + cnt) * AES_KEY_LEN, AES_KEY_LEN));
|
||||
if (len != AES_KEY_LEN) {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -287,8 +287,9 @@ int CmdsParse(const command_t Commands[], const char *Cmd) {
|
|||
}
|
||||
|
||||
// Comment
|
||||
if (cmd_name[0] == '#')
|
||||
if (cmd_name[0] == '#') {
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
// find args, check for -h / --help
|
||||
int tmplen = len;
|
||||
|
|
|
@ -55,13 +55,15 @@ void des_decrypt(void *out, const void *in, const void *key) {
|
|||
}
|
||||
|
||||
void des_encrypt_ecb(void *out, const void *in, const int length, const void *key) {
|
||||
for (int i = 0; i < length; i += 8)
|
||||
for (int i = 0; i < length; i += 8) {
|
||||
des_encrypt((uint8_t *)out + i, (uint8_t *)in + i, key);
|
||||
}
|
||||
}
|
||||
|
||||
void des_decrypt_ecb(void *out, const void *in, const int length, const void *key) {
|
||||
for (int i = 0; i < length; i += 8)
|
||||
for (int i = 0; i < length; i += 8) {
|
||||
des_decrypt((uint8_t *)out + i, (uint8_t *)in + i, key);
|
||||
}
|
||||
}
|
||||
|
||||
void des_encrypt_cbc(void *out, const void *in, const int length, const void *key, uint8_t *iv) {
|
||||
|
|
|
@ -72,9 +72,7 @@ DumpFileType_t get_filetype(const char *filename) {
|
|||
size_t len = strlen(filename);
|
||||
if (len > 4) {
|
||||
// check if valid file extension and attempt to load data
|
||||
char s[FILE_PATH_SIZE];
|
||||
memset(s, 0, sizeof(s));
|
||||
memcpy(s, filename, len);
|
||||
char *s = str_dup(filename);
|
||||
str_lower(s);
|
||||
|
||||
if (str_endswith(s, "bin")) {
|
||||
|
@ -97,6 +95,8 @@ DumpFileType_t get_filetype(const char *filename) {
|
|||
// log is text
|
||||
// .pm3 is text values of signal data
|
||||
}
|
||||
|
||||
free(s);
|
||||
}
|
||||
return o;
|
||||
}
|
||||
|
@ -2577,7 +2577,7 @@ int detect_nfc_dump_format(const char *preferredName, nfc_df_e *dump_type, bool
|
|||
}
|
||||
|
||||
FILE *f = fopen(path, "r");
|
||||
if (!f) {
|
||||
if (f == NULL) {
|
||||
PrintAndLogEx(WARNING, "file not found or locked `" _YELLOW_("%s") "`", path);
|
||||
free(path);
|
||||
return PM3_EFILE;
|
||||
|
|
|
@ -317,7 +317,6 @@ static int MADInfoByteDecode(const uint8_t *sector, bool swapmad, int mad_ver, b
|
|||
void MADPrintHeader(void) {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(INFO, "--- " _CYAN_("MIFARE App Directory Information") " ----------------");
|
||||
PrintAndLogEx(INFO, "-----------------------------------------------------");
|
||||
}
|
||||
|
||||
int MAD1DecodeAndPrint(uint8_t *sector, bool swapmad, bool verbose, bool *haveMAD2) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue