mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
whitespace
This commit is contained in:
parent
adee34083e
commit
107b474b8a
4 changed files with 36 additions and 33 deletions
|
@ -218,15 +218,15 @@ static int lto_rdbl(uint8_t blk, uint8_t *block_responce, uint8_t *block_cnt_res
|
||||||
|
|
||||||
uint16_t resp_len = 18;
|
uint16_t resp_len = 18;
|
||||||
uint8_t rdbl_cmd[] = {0x30, blk};
|
uint8_t rdbl_cmd[] = {0x30, blk};
|
||||||
uint8_t rdbl_cnt_cmd[] ={0x80};
|
uint8_t rdbl_cnt_cmd[] = {0x80};
|
||||||
|
|
||||||
int status = lto_send_cmd_raw(rdbl_cmd, sizeof(rdbl_cmd), block_responce, &resp_len, true, false, verbose);
|
int status = lto_send_cmd_raw(rdbl_cmd, sizeof(rdbl_cmd), block_responce, &resp_len, true, false, verbose);
|
||||||
if (status == PM3_ETIMEOUT || status == PM3_ESOFT ) {
|
if (status == PM3_ETIMEOUT || status == PM3_ESOFT) {
|
||||||
return PM3_EWRONGANSVER; // READ BLOCK failed
|
return PM3_EWRONGANSVER; // READ BLOCK failed
|
||||||
}
|
}
|
||||||
|
|
||||||
status = lto_send_cmd_raw(rdbl_cnt_cmd, sizeof(rdbl_cnt_cmd), block_cnt_responce, &resp_len, false, false, verbose);
|
status = lto_send_cmd_raw(rdbl_cnt_cmd, sizeof(rdbl_cnt_cmd), block_cnt_responce, &resp_len, false, false, verbose);
|
||||||
if (status == PM3_ETIMEOUT || status == PM3_ESOFT ) {
|
if (status == PM3_ETIMEOUT || status == PM3_ESOFT) {
|
||||||
return PM3_EWRONGANSVER; // READ BLOCK CONTINUE failed
|
return PM3_EWRONGANSVER; // READ BLOCK CONTINUE failed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ int rdblLTO(uint8_t st_blk, uint8_t end_blk, bool verbose) {
|
||||||
uint8_t block_data_d16_d31[18];
|
uint8_t block_data_d16_d31[18];
|
||||||
uint8_t block_data[32];
|
uint8_t block_data[32];
|
||||||
|
|
||||||
for(uint8_t i = st_blk; i < end_blk + 1; i++) {
|
for (uint8_t i = st_blk; i < end_blk + 1; i++) {
|
||||||
|
|
||||||
ret_val = lto_rdbl(i, block_data_d00_d15, block_data_d16_d31, verbose);
|
ret_val = lto_rdbl(i, block_data_d00_d15, block_data_d16_d31, verbose);
|
||||||
|
|
||||||
|
@ -286,8 +286,8 @@ static int CmdHfLTOReadBlock(const char *Cmd) {
|
||||||
case 'h':
|
case 'h':
|
||||||
return usage_lto_rdbl();
|
return usage_lto_rdbl();
|
||||||
case 's':
|
case 's':
|
||||||
st_blk = param_get8(Cmd, cmdp+1);
|
st_blk = param_get8(Cmd, cmdp + 1);
|
||||||
if ( end_blk < st_blk ) {
|
if (end_blk < st_blk) {
|
||||||
errors = true;
|
errors = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -295,10 +295,11 @@ static int CmdHfLTOReadBlock(const char *Cmd) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'e':
|
case 'e':
|
||||||
end_blk = param_get8(Cmd, cmdp+1);
|
end_blk = param_get8(Cmd, cmdp + 1);
|
||||||
if ( end_blk < st_blk ) {
|
if (end_blk < st_blk) {
|
||||||
errors = true;
|
errors = true;
|
||||||
break; }
|
break;
|
||||||
|
}
|
||||||
cmdp += 2;
|
cmdp += 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -328,7 +329,7 @@ static int lto_wrbl(uint8_t blk, uint8_t *data, bool verbose) {
|
||||||
|
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
wrbl_d00_d15[i] = data[i];
|
wrbl_d00_d15[i] = data[i];
|
||||||
wrbl_d16_d31[i] = data[i+16];
|
wrbl_d16_d31[i] = data[i + 16];
|
||||||
}
|
}
|
||||||
|
|
||||||
int status = lto_send_cmd_raw(wrbl_cmd, sizeof(wrbl_cmd), resp, &resp_len, true, false, verbose);
|
int status = lto_send_cmd_raw(wrbl_cmd, sizeof(wrbl_cmd), resp, &resp_len, true, false, verbose);
|
||||||
|
@ -390,12 +391,12 @@ static int CmdHfLTOWriteBlock(const char *Cmd) {
|
||||||
case 'h':
|
case 'h':
|
||||||
return usage_lto_wrbl();
|
return usage_lto_wrbl();
|
||||||
case 'b':
|
case 'b':
|
||||||
blk = param_get8(Cmd, cmdp+1);
|
blk = param_get8(Cmd, cmdp + 1);
|
||||||
b_opt_selected = true;
|
b_opt_selected = true;
|
||||||
cmdp += 2;
|
cmdp += 2;
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
if (param_gethex(Cmd, cmdp+1, blkData, 64)) {
|
if (param_gethex(Cmd, cmdp + 1, blkData, 64)) {
|
||||||
PrintAndLogEx(WARNING, "block data must include 64 HEX symbols");
|
PrintAndLogEx(WARNING, "block data must include 64 HEX symbols");
|
||||||
errors = true;
|
errors = true;
|
||||||
break;
|
break;
|
||||||
|
@ -440,7 +441,7 @@ int dumpLTO(uint8_t *dump, bool verbose) {
|
||||||
uint8_t block_data_d00_d15[18];
|
uint8_t block_data_d00_d15[18];
|
||||||
uint8_t block_data_d16_d31[18];
|
uint8_t block_data_d16_d31[18];
|
||||||
|
|
||||||
for(uint8_t i = 0; i < 255; i++) {
|
for (uint8_t i = 0; i < 255; i++) {
|
||||||
|
|
||||||
ret_val = lto_rdbl(i, block_data_d00_d15, block_data_d16_d31, verbose);
|
ret_val = lto_rdbl(i, block_data_d00_d15, block_data_d16_d31, verbose);
|
||||||
|
|
||||||
|
@ -541,7 +542,7 @@ int restoreLTO(uint8_t *dump_data, bool verbose) {
|
||||||
uint8_t blkData[32] = {0};
|
uint8_t blkData[32] = {0};
|
||||||
|
|
||||||
//Block address 0 and 1 are read-only
|
//Block address 0 and 1 are read-only
|
||||||
for(uint8_t blk = 2; blk < 255; blk++) {
|
for (uint8_t blk = 2; blk < 255; blk++) {
|
||||||
|
|
||||||
for (int i = 0; i < 32; i++) {
|
for (int i = 0; i < 32; i++) {
|
||||||
blkData[i] = dump_data[i + blk * 32];
|
blkData[i] = dump_data[i + blk * 32];
|
||||||
|
|
|
@ -450,7 +450,7 @@ static int CmdHIDBrute(const char *Cmd) {
|
||||||
PrintAndLogEx(INFO, "ISSUE#........... %u", cn_hi.IssueLevel);
|
PrintAndLogEx(INFO, "ISSUE#........... %u", cn_hi.IssueLevel);
|
||||||
PrintAndLogEx(INFO, "Facility#........ %u", cn_hi.FacilityCode);
|
PrintAndLogEx(INFO, "Facility#........ %u", cn_hi.FacilityCode);
|
||||||
PrintAndLogEx(INFO, "Card#............ %" PRIu64, cn_hi.CardNumber);
|
PrintAndLogEx(INFO, "Card#............ %" PRIu64, cn_hi.CardNumber);
|
||||||
switch( direction) {
|
switch (direction) {
|
||||||
case 0:
|
case 0:
|
||||||
PrintAndLogEx(INFO, "Brute-forcing direction: " _YELLOW_("BOTH"));
|
PrintAndLogEx(INFO, "Brute-forcing direction: " _YELLOW_("BOTH"));
|
||||||
break;
|
break;
|
||||||
|
@ -460,7 +460,8 @@ static int CmdHIDBrute(const char *Cmd) {
|
||||||
case 2:
|
case 2:
|
||||||
PrintAndLogEx(INFO, "Brute-forcing direction: " _YELLOW_("DOWN"));
|
PrintAndLogEx(INFO, "Brute-forcing direction: " _YELLOW_("DOWN"));
|
||||||
break;
|
break;
|
||||||
default: break;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PrintAndLogEx(INFO, "Brute-forcing HID reader");
|
PrintAndLogEx(INFO, "Brute-forcing HID reader");
|
||||||
|
@ -518,7 +519,8 @@ static int CmdHIDBrute(const char *Cmd) {
|
||||||
case 2:
|
case 2:
|
||||||
exitloop = fin_low;
|
exitloop = fin_low;
|
||||||
break;
|
break;
|
||||||
default: break;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (exitloop == false);
|
} while (exitloop == false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue