mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
format
This commit is contained in:
parent
8014aa0361
commit
e94921c1af
1 changed files with 34 additions and 34 deletions
|
@ -1786,7 +1786,7 @@ static int CmdHFFelicaDumpServiceArea(const char *Cmd) {
|
|||
data[1] = 0x0A; /* CMD = 0x0A */
|
||||
uint16_t datalen = 12; /* LEN + CMD + IDm + cursor */
|
||||
|
||||
if(!check_last_idm(data, datalen))
|
||||
if (!check_last_idm(data, datalen))
|
||||
return PM3_EINVARG;
|
||||
|
||||
PrintAndLogEx(HINT, "Area and service code are printed in big endian.");
|
||||
|
@ -1802,19 +1802,19 @@ static int CmdHFFelicaDumpServiceArea(const char *Cmd) {
|
|||
|
||||
felica_service_dump_response_t resp;
|
||||
|
||||
while(true){
|
||||
while (true) {
|
||||
|
||||
/* insert cursor LE */
|
||||
data[10] = cursor & 0xFF;
|
||||
data[11] = cursor >> 8;
|
||||
AddCrc(data, datalen);
|
||||
|
||||
if(send_dump_sv_plain(flags, datalen + 2, data, 0,
|
||||
&resp, false) != PM3_SUCCESS){
|
||||
if (send_dump_sv_plain(flags, datalen + 2, data, 0,
|
||||
&resp, false) != PM3_SUCCESS) {
|
||||
PrintAndLogEx(FAILED, "No response at cursor 0x%04X", cursor);
|
||||
return PM3_ERFTRANS;
|
||||
}
|
||||
if(resp.frame_response.cmd_code[0] != 0x0B){
|
||||
if (resp.frame_response.cmd_code[0] != 0x0B) {
|
||||
PrintAndLogEx(FAILED, "Bad response cmd 0x%02X @ 0x%04X.",
|
||||
resp.frame_response.cmd_code[0], cursor);
|
||||
PrintAndLogEx(INFO, "This is a normal signal issue. Please try again.");
|
||||
|
@ -1825,10 +1825,10 @@ static int CmdHFFelicaDumpServiceArea(const char *Cmd) {
|
|||
uint8_t len = resp.frame_response.length[0];
|
||||
uint16_t node_code = resp.payload[0] | (resp.payload[1] << 8);
|
||||
|
||||
if(node_code == 0xFFFF) break; /* end-marker */
|
||||
if (node_code == 0xFFFF) break; /* end-marker */
|
||||
|
||||
/* pop finished areas */
|
||||
while(depth && node_code > area_end_stack[depth]) depth--;
|
||||
while (depth && node_code > area_end_stack[depth]) depth--;
|
||||
|
||||
|
||||
/* ----- compose nice prefix ------------------------------------ */
|
||||
|
@ -1851,13 +1851,13 @@ static int CmdHFFelicaDumpServiceArea(const char *Cmd) {
|
|||
}
|
||||
} else if (len == 0x0C) { /* SERVICE */
|
||||
PrintAndLogEx(INFO, "%ssvc_%04X", prefix, node_code);
|
||||
} else{
|
||||
} else {
|
||||
PrintAndLogEx(FAILED, "Unexpected length 0x%02X @ 0x%04X",
|
||||
len, cursor);
|
||||
return PM3_ERFTRANS;
|
||||
}
|
||||
cursor++;
|
||||
if(cursor == 0) break; /* overflow safety */
|
||||
if (cursor == 0) break; /* overflow safety */
|
||||
}
|
||||
|
||||
/* draw closing bar └─┴─... based on final depth */
|
||||
|
@ -1868,7 +1868,7 @@ static int CmdHFFelicaDumpServiceArea(const char *Cmd) {
|
|||
pos += snprintf(bar + pos, sizeof(bar) - pos, "└");
|
||||
|
||||
/* one segment per level-1 */
|
||||
for(int i = 0; i < depth - 1 && pos < sizeof(bar); i++)
|
||||
for (int i = 0; i < depth - 1 && pos < sizeof(bar); i++)
|
||||
pos += snprintf(bar + pos, sizeof(bar) - pos, "───┴");
|
||||
|
||||
/* tail */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue