mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 14:23:50 -07:00
added no-authenticate option to read file
This commit is contained in:
parent
737ff2d465
commit
e5fe614a4f
1 changed files with 16 additions and 6 deletions
|
@ -184,6 +184,7 @@ static int CmdHFCipurseReadFile(const char *Cmd) {
|
||||||
arg_str0("k", "key", "<hex>", "key for authenticate"),
|
arg_str0("k", "key", "<hex>", "key for authenticate"),
|
||||||
arg_str0("f", "file", "<hex>", "file ID"),
|
arg_str0("f", "file", "<hex>", "file ID"),
|
||||||
arg_int0("o", "offset", "<dec>", "offset for reading data from file"),
|
arg_int0("o", "offset", "<dec>", "offset for reading data from file"),
|
||||||
|
arg_lit0(NULL, "noauth", "read file without authentication"),
|
||||||
arg_param_end
|
arg_param_end
|
||||||
};
|
};
|
||||||
CLIExecWithReturn(ctx, Cmd, argtable, true);
|
CLIExecWithReturn(ctx, Cmd, argtable, true);
|
||||||
|
@ -217,6 +218,13 @@ static int CmdHFCipurseReadFile(const char *Cmd) {
|
||||||
|
|
||||||
size_t offset = arg_get_int_def(ctx, 6, 0);
|
size_t offset = arg_get_int_def(ctx, 6, 0);
|
||||||
|
|
||||||
|
bool noAuth = arg_get_lit(ctx, 7);
|
||||||
|
|
||||||
|
//CipurseCChannelSetSecurityLevels(&cpc, CPSEncrypted, CPSEncrypted);
|
||||||
|
//CipurseCChannelSetSecurityLevels(&cpc, CPSMACed, CPSMACed);
|
||||||
|
//CipurseCChannelSetSecurityLevels(&cpc, CPSPlain, CPSPlain);
|
||||||
|
|
||||||
|
|
||||||
SetAPDULogging(APDULogging);
|
SetAPDULogging(APDULogging);
|
||||||
|
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
|
@ -231,6 +239,7 @@ static int CmdHFCipurseReadFile(const char *Cmd) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
PrintAndLogEx(INFO, "File id: %x offset %d key id: %d key: %s", fileId, offset, keyId, sprint_hex(key, CIPURSE_AES_KEY_LENGTH));
|
PrintAndLogEx(INFO, "File id: %x offset %d key id: %d key: %s", fileId, offset, keyId, sprint_hex(key, CIPURSE_AES_KEY_LENGTH));
|
||||||
|
|
||||||
|
if (noAuth == false) {
|
||||||
bool bres = CIPURSEChannelAuthenticate(keyId, key, verbose);
|
bool bres = CIPURSEChannelAuthenticate(keyId, key, verbose);
|
||||||
if (bres == false) {
|
if (bres == false) {
|
||||||
if (verbose == false)
|
if (verbose == false)
|
||||||
|
@ -238,6 +247,7 @@ static int CmdHFCipurseReadFile(const char *Cmd) {
|
||||||
DropField();
|
DropField();
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
res = CIPURSESelectFile(fileId, buf, sizeof(buf), &len, &sw);
|
res = CIPURSESelectFile(fileId, buf, sizeof(buf), &len, &sw);
|
||||||
if (res != 0 || sw != 0x9000) {
|
if (res != 0 || sw != 0x9000) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue