mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 22:33:48 -07:00
refactoring fix
This commit is contained in:
parent
40227edd7e
commit
4444fb4533
2 changed files with 13 additions and 15 deletions
|
@ -6216,7 +6216,7 @@ static int CmdHF14ADesCreateFile(const char *Cmd) {
|
|||
if (useraw && sdatalen > 0) {
|
||||
filetype = rawftype;
|
||||
memcpy(&data[1], sdata, sdatalen);
|
||||
datalen += sdatalen;
|
||||
datalen = 1 + sdatalen;
|
||||
} else {
|
||||
useraw = false;
|
||||
}
|
||||
|
@ -6394,21 +6394,17 @@ static int CmdHF14ADesCreateValueFile(const char *Cmd) {
|
|||
|
||||
if (verbose)
|
||||
PrintAndLogEx(INFO, "App: %06x. File num: 0x%02x type: 0x%02x data[%d]: %s", appid, data[0], filetype, datalen, sprint_hex(data, datalen));
|
||||
DesfirePrintCreateFileSettings(filetype, data, datalen);
|
||||
|
||||
|
||||
res = DesfireCreateFile(&dctx, filetype, data, datalen, true);
|
||||
if (res != PM3_SUCCESS) {
|
||||
PrintAndLogEx(ERR, "Desfire CreateFile command " _RED_("error") ". Result: %d", res);
|
||||
DropField();
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PrintAndLogEx(SUCCESS, "Value file %02x in the app %06x created " _GREEN_("successfully"), data[0], appid);
|
||||
|
||||
DropField();
|
||||
return PM3_SUCCESS;
|
||||
|
|
|
@ -1371,7 +1371,7 @@ void DesfirePrintCreateFileSettings(uint8_t filetype, uint8_t *data, size_t len)
|
|||
return;
|
||||
}
|
||||
|
||||
bool isoidpresent = ftyperec->mayHaveISOfid; // TODO!!!
|
||||
bool isoidpresent = ftyperec->mayHaveISOfid && (len == ftyperec->len + 2 + 1);
|
||||
|
||||
PrintAndLogEx(INFO, "---- " _CYAN_("Create file settings") " ----");
|
||||
PrintAndLogEx(SUCCESS, "File type : %s", ftyperec->text);
|
||||
|
@ -1380,6 +1380,8 @@ void DesfirePrintCreateFileSettings(uint8_t filetype, uint8_t *data, size_t len)
|
|||
if (isoidpresent) {
|
||||
PrintAndLogEx(SUCCESS, "File ISO number : 0x%02x%02x", data[xlen], data[xlen + 1]);
|
||||
xlen += 2;
|
||||
} else {
|
||||
PrintAndLogEx(SUCCESS, "File ISO number : n/a");
|
||||
}
|
||||
|
||||
PrintAndLogEx(SUCCESS, "File comm mode : %s", GetDesfireCommunicationMode(data[xlen] & 0x03));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue