mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
textual, cppchecker
This commit is contained in:
parent
3cd282ce87
commit
b6965425bc
1 changed files with 16 additions and 5 deletions
|
@ -967,6 +967,7 @@ static int CmdHF14AMfDump(const char *Cmd) {
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "Reading sector access bits...");
|
PrintAndLogEx(INFO, "Reading sector access bits...");
|
||||||
|
PrintAndLogEx(INFO, "." NOLF);
|
||||||
|
|
||||||
uint8_t tries;
|
uint8_t tries;
|
||||||
mf_readblock_t payload;
|
mf_readblock_t payload;
|
||||||
|
@ -2297,6 +2298,7 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
|
||||||
if (verbose) PrintAndLogEx(INFO, "======================= " _YELLOW_("START DICTIONARY ATTACK") " =======================");
|
if (verbose) PrintAndLogEx(INFO, "======================= " _YELLOW_("START DICTIONARY ATTACK") " =======================");
|
||||||
|
|
||||||
if (legacy_mfchk) {
|
if (legacy_mfchk) {
|
||||||
|
PrintAndLogEx(INFO, "." NOLF);
|
||||||
// Check all the sectors
|
// Check all the sectors
|
||||||
for (int i = 0; i < sectors_cnt; i++) {
|
for (int i = 0; i < sectors_cnt; i++) {
|
||||||
for (int j = 0; j < 2; j++) {
|
for (int j = 0; j < 2; j++) {
|
||||||
|
@ -3266,8 +3268,8 @@ static int CmdHF14AMfChk(const char *Cmd) {
|
||||||
uint8_t trgKeyType = 0;
|
uint8_t trgKeyType = 0;
|
||||||
uint16_t max_keys = keycnt > KEYS_IN_BLOCK ? KEYS_IN_BLOCK : keycnt;
|
uint16_t max_keys = keycnt > KEYS_IN_BLOCK ? KEYS_IN_BLOCK : keycnt;
|
||||||
|
|
||||||
// time
|
PrintAndLogEx(INFO, "Start check for keys...");
|
||||||
uint64_t t1 = msclock();
|
PrintAndLogEx(INFO, "." NOLF);
|
||||||
|
|
||||||
// fast push mode
|
// fast push mode
|
||||||
conn.block_after_ACK = true;
|
conn.block_after_ACK = true;
|
||||||
|
@ -3275,6 +3277,9 @@ static int CmdHF14AMfChk(const char *Cmd) {
|
||||||
// clear trace log by first check keys call only
|
// clear trace log by first check keys call only
|
||||||
bool clearLog = true;
|
bool clearLog = true;
|
||||||
|
|
||||||
|
// time
|
||||||
|
uint64_t t1 = msclock();
|
||||||
|
|
||||||
// check keys.
|
// check keys.
|
||||||
for (trgKeyType = (keyType == 2) ? 0 : keyType; trgKeyType < 2; (keyType == 2) ? (++trgKeyType) : (trgKeyType = 2)) {
|
for (trgKeyType = (keyType == 2) ? 0 : keyType; trgKeyType < 2; (keyType == 2) ? (++trgKeyType) : (trgKeyType = 2)) {
|
||||||
|
|
||||||
|
@ -3896,12 +3901,11 @@ int CmdHF14AMfELoad(const char *Cmd) {
|
||||||
printMFUdumpEx(mfu_dump, mfu_dump->pages + 1, 0);
|
printMFUdumpEx(mfu_dump, mfu_dump->pages + 1, 0);
|
||||||
|
|
||||||
// update expected blocks to match converted data.
|
// update expected blocks to match converted data.
|
||||||
if (numBlocks != datalen / 4) {
|
numBlocks = datalen / 4;
|
||||||
numBlocks = datalen / 4;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "Uploading to emulator memory");
|
PrintAndLogEx(INFO, "Uploading to emulator memory");
|
||||||
|
PrintAndLogEx(INFO, "." NOLF);
|
||||||
|
|
||||||
// fast push mode
|
// fast push mode
|
||||||
conn.block_after_ACK = true;
|
conn.block_after_ACK = true;
|
||||||
|
@ -4326,6 +4330,10 @@ static int CmdHF14AMfCLoad(const char *Cmd) {
|
||||||
|
|
||||||
|
|
||||||
if (fillFromEmulator) {
|
if (fillFromEmulator) {
|
||||||
|
|
||||||
|
PrintAndLogEx(INFO, "Start upload to emulator memory");
|
||||||
|
PrintAndLogEx(INFO, "." NOLF);
|
||||||
|
|
||||||
for (int blockNum = 0; blockNum < 16 * 4; blockNum += 1) {
|
for (int blockNum = 0; blockNum < 16 * 4; blockNum += 1) {
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
uint8_t buf8[16] = {0x00};
|
uint8_t buf8[16] = {0x00};
|
||||||
|
@ -4381,6 +4389,7 @@ static int CmdHF14AMfCLoad(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "Copying to magic card");
|
PrintAndLogEx(INFO, "Copying to magic card");
|
||||||
|
PrintAndLogEx(INFO, "." NOLF);
|
||||||
|
|
||||||
int blockNum = 0;
|
int blockNum = 0;
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
@ -4594,6 +4603,7 @@ static int CmdHF14AMfCSave(const char *Cmd) {
|
||||||
|
|
||||||
if (fillEmulator) {
|
if (fillEmulator) {
|
||||||
PrintAndLogEx(INFO, "uploading to emulator memory");
|
PrintAndLogEx(INFO, "uploading to emulator memory");
|
||||||
|
PrintAndLogEx(INFO, "." NOLF);
|
||||||
// fast push mode
|
// fast push mode
|
||||||
conn.block_after_ACK = true;
|
conn.block_after_ACK = true;
|
||||||
for (i = 0; i < numblocks; i += 5) {
|
for (i = 0; i < numblocks; i += 5) {
|
||||||
|
@ -4650,6 +4660,7 @@ static int CmdHF14AMfCView(const char *Cmd) {
|
||||||
if (errors) return usage_hf14_cview();
|
if (errors) return usage_hf14_cview();
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "View magic MIFARE " _GREEN_("%cK"), ctmp);
|
PrintAndLogEx(SUCCESS, "View magic MIFARE " _GREEN_("%cK"), ctmp);
|
||||||
|
PrintAndLogEx(INFO, "." NOLF);
|
||||||
|
|
||||||
uint8_t *dump = calloc(bytes, sizeof(uint8_t));
|
uint8_t *dump = calloc(bytes, sizeof(uint8_t));
|
||||||
if (!dump) {
|
if (!dump) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue