mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
make style
This commit is contained in:
parent
e04b094cd2
commit
3ae9070dd8
15 changed files with 126 additions and 121 deletions
|
@ -9,10 +9,10 @@
|
||||||
#define lconfig_h
|
#define lconfig_h
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
#include "TargetConditionals.h"
|
#include "TargetConditionals.h"
|
||||||
#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV
|
#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV
|
||||||
#define system(s) ((s)==NULL ? 0 : -1)
|
#define system(s) ((s)==NULL ? 0 : -1)
|
||||||
#endif // end iOS
|
#endif // end iOS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
|
@ -1064,7 +1064,7 @@ static int CmdHF14AMfRestore(const char *Cmd) {
|
||||||
memcpy(bldata, dump, MFBLOCK_SIZE);
|
memcpy(bldata, dump, MFBLOCK_SIZE);
|
||||||
|
|
||||||
// if sector trailer
|
// if sector trailer
|
||||||
if (mfNumBlocksPerSector(s)-1 == b) {
|
if (mfNumBlocksPerSector(s) - 1 == b) {
|
||||||
if (use_keyfile_for_auth == false) {
|
if (use_keyfile_for_auth == false) {
|
||||||
// replace KEY A
|
// replace KEY A
|
||||||
bldata[0] = (keyA[s][0]);
|
bldata[0] = (keyA[s][0]);
|
||||||
|
|
|
@ -3404,7 +3404,7 @@ static int DesfireCreateFileParameters(
|
||||||
uint8_t pfileid, uint8_t pisofileid,
|
uint8_t pfileid, uint8_t pisofileid,
|
||||||
uint8_t amodeid, uint8_t frightsid,
|
uint8_t amodeid, uint8_t frightsid,
|
||||||
uint8_t r_modeid, uint8_t w_modeid, uint8_t rw_modeid, uint8_t ch_modeid,
|
uint8_t r_modeid, uint8_t w_modeid, uint8_t rw_modeid, uint8_t ch_modeid,
|
||||||
uint8_t *data, size_t *datalen ) {
|
uint8_t *data, size_t *datalen) {
|
||||||
|
|
||||||
*datalen = 0;
|
*datalen = 0;
|
||||||
|
|
||||||
|
@ -4475,10 +4475,10 @@ static int CmdHF14ADesClearRecordFile(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int DesfileReadISOFileAndPrint(DesfireContext_t *dctx,
|
static int DesfileReadISOFileAndPrint(DesfireContext_t *dctx,
|
||||||
bool select_current_file, uint8_t fnum,
|
bool select_current_file, uint8_t fnum,
|
||||||
uint16_t fisoid, int filetype,
|
uint16_t fisoid, int filetype,
|
||||||
uint32_t offset, uint32_t length,
|
uint32_t offset, uint32_t length,
|
||||||
bool noauth, bool verbose) {
|
bool noauth, bool verbose) {
|
||||||
|
|
||||||
if (filetype == RFTAuto) {
|
if (filetype == RFTAuto) {
|
||||||
PrintAndLogEx(ERR, "ISO mode needs to specify file type");
|
PrintAndLogEx(ERR, "ISO mode needs to specify file type");
|
||||||
|
@ -4573,9 +4573,9 @@ static int DesfileReadISOFileAndPrint(DesfireContext_t *dctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int DesfileReadFileAndPrint(DesfireContext_t *dctx,
|
static int DesfileReadFileAndPrint(DesfireContext_t *dctx,
|
||||||
uint8_t fnum, int filetype,
|
uint8_t fnum, int filetype,
|
||||||
uint32_t offset, uint32_t length,
|
uint32_t offset, uint32_t length,
|
||||||
uint32_t maxdatafilelength, bool noauth, bool verbose) {
|
uint32_t maxdatafilelength, bool noauth, bool verbose) {
|
||||||
|
|
||||||
int res;
|
int res;
|
||||||
// length of record for record file
|
// length of record for record file
|
||||||
|
@ -4889,10 +4889,10 @@ static int CmdHF14ADesReadData(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int DesfileWriteISOFile(DesfireContext_t *dctx,
|
static int DesfileWriteISOFile(DesfireContext_t *dctx,
|
||||||
bool select_current_file, uint8_t fnum,
|
bool select_current_file, uint8_t fnum,
|
||||||
uint16_t fisoid, int filetype,
|
uint16_t fisoid, int filetype,
|
||||||
uint32_t offset, uint8_t *data,
|
uint32_t offset, uint8_t *data,
|
||||||
uint32_t datalen, bool verbose) {
|
uint32_t datalen, bool verbose) {
|
||||||
|
|
||||||
if (filetype == RFTAuto) {
|
if (filetype == RFTAuto) {
|
||||||
PrintAndLogEx(ERR, "ISO mode needs to specify file type");
|
PrintAndLogEx(ERR, "ISO mode needs to specify file type");
|
||||||
|
|
|
@ -266,9 +266,9 @@ static int CmdGallagherClone(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "Preparing to clone Gallagher to " _YELLOW_("%s") " from %s.",
|
PrintAndLogEx(INFO, "Preparing to clone Gallagher to " _YELLOW_("%s") " from %s.",
|
||||||
cardtype,
|
cardtype,
|
||||||
use_raw ? "raw hex" : "specified data"
|
use_raw ? "raw hex" : "specified data"
|
||||||
);
|
);
|
||||||
print_blocks(blocks, ARRAYLEN(blocks));
|
print_blocks(blocks, ARRAYLEN(blocks));
|
||||||
|
|
||||||
if (em) {
|
if (em) {
|
||||||
|
|
|
@ -332,9 +332,9 @@ static int CmdPyramidClone(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "Preparing to clone Farpointe/Pyramid to " _YELLOW_("%s") " from %s.",
|
PrintAndLogEx(INFO, "Preparing to clone Farpointe/Pyramid to " _YELLOW_("%s") " from %s.",
|
||||||
cardtype,
|
cardtype,
|
||||||
use_raw ? "raw hex" : "specified data"
|
use_raw ? "raw hex" : "specified data"
|
||||||
);
|
);
|
||||||
print_blocks(blocks, ARRAYLEN(blocks));
|
print_blocks(blocks, ARRAYLEN(blocks));
|
||||||
|
|
||||||
if (em) {
|
if (em) {
|
||||||
|
|
|
@ -79,7 +79,7 @@ static bool merge_topaz_reader_frames(uint32_t timestamp, uint32_t *duration, ui
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
static uint8_t calc_pos(uint8_t *d){
|
static uint8_t calc_pos(uint8_t *d) {
|
||||||
// PCB [CID] [NAD] [INF] CRC CRC
|
// PCB [CID] [NAD] [INF] CRC CRC
|
||||||
uint8_t pos = 1;
|
uint8_t pos = 1;
|
||||||
if ((d[0] & 0x08) == 0x08) // cid byte following
|
if ((d[0] & 0x08) == 0x08) // cid byte following
|
||||||
|
@ -111,9 +111,9 @@ static uint16_t extractChallenges(uint16_t tracepos, uint16_t traceLen, uint8_t
|
||||||
// sanity check tracking position is less then available trace size
|
// sanity check tracking position is less then available trace size
|
||||||
if (tracepos + TRACELOG_HDR_LEN + data_len + TRACELOG_PARITY_LEN(hdr) > traceLen) {
|
if (tracepos + TRACELOG_HDR_LEN + data_len + TRACELOG_PARITY_LEN(hdr) > traceLen) {
|
||||||
PrintAndLogEx(DEBUG, "trace pos offset %"PRIu64 " larger than reported tracelen %u",
|
PrintAndLogEx(DEBUG, "trace pos offset %"PRIu64 " larger than reported tracelen %u",
|
||||||
tracepos + TRACELOG_HDR_LEN + data_len + TRACELOG_PARITY_LEN(hdr),
|
tracepos + TRACELOG_HDR_LEN + data_len + TRACELOG_PARITY_LEN(hdr),
|
||||||
traceLen
|
traceLen
|
||||||
);
|
);
|
||||||
return traceLen;
|
return traceLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ static uint16_t extractChallenges(uint16_t tracepos, uint16_t traceLen, uint8_t
|
||||||
if (extract_uidlen == 8) {
|
if (extract_uidlen == 8) {
|
||||||
PrintAndLogEx(INFO, "hf iclass lookup --csn %s " NOLF, sprint_hex_inrow(extract_uid, extract_uidlen));
|
PrintAndLogEx(INFO, "hf iclass lookup --csn %s " NOLF, sprint_hex_inrow(extract_uid, extract_uidlen));
|
||||||
PrintAndLogEx(NORMAL, "--epurse %s " NOLF, sprint_hex_inrow(extract_epurse, 8));
|
PrintAndLogEx(NORMAL, "--epurse %s " NOLF, sprint_hex_inrow(extract_epurse, 8));
|
||||||
PrintAndLogEx(NORMAL, "--macs %s " NOLF, sprint_hex_inrow(frame + 1, 8) );
|
PrintAndLogEx(NORMAL, "--macs %s " NOLF, sprint_hex_inrow(frame + 1, 8));
|
||||||
PrintAndLogEx(NORMAL, "-f iclass_default_keys.dic");
|
PrintAndLogEx(NORMAL, "-f iclass_default_keys.dic");
|
||||||
return tracepos;
|
return tracepos;
|
||||||
}
|
}
|
||||||
|
@ -326,7 +326,7 @@ static uint16_t extractChallenges(uint16_t tracepos, uint16_t traceLen, uint8_t
|
||||||
tracepos += TRACELOG_HDR_LEN + next_hdr->data_len + TRACELOG_PARITY_LEN(next_hdr);
|
tracepos += TRACELOG_HDR_LEN + next_hdr->data_len + TRACELOG_PARITY_LEN(next_hdr);
|
||||||
|
|
||||||
if (next_hdr->frame[pos] == MFDES_ADDITIONAL_FRAME) {
|
if (next_hdr->frame[pos] == MFDES_ADDITIONAL_FRAME) {
|
||||||
PrintAndLogEx(NORMAL, "%s", sprint_hex_inrow(next_hdr->frame + pos + long_jmp, (tdea<<1)));
|
PrintAndLogEx(NORMAL, "%s", sprint_hex_inrow(next_hdr->frame + pos + long_jmp, (tdea << 1)));
|
||||||
}
|
}
|
||||||
return tracepos;
|
return tracepos;
|
||||||
}
|
}
|
||||||
|
@ -455,9 +455,9 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
|
||||||
|
|
||||||
if (tracepos + TRACELOG_HDR_LEN + data_len + TRACELOG_PARITY_LEN(hdr) > traceLen) {
|
if (tracepos + TRACELOG_HDR_LEN + data_len + TRACELOG_PARITY_LEN(hdr) > traceLen) {
|
||||||
PrintAndLogEx(DEBUG, "trace pos offset %"PRIu64 " larger than reported tracelen %u",
|
PrintAndLogEx(DEBUG, "trace pos offset %"PRIu64 " larger than reported tracelen %u",
|
||||||
tracepos + TRACELOG_HDR_LEN + data_len + TRACELOG_PARITY_LEN(hdr),
|
tracepos + TRACELOG_HDR_LEN + data_len + TRACELOG_PARITY_LEN(hdr),
|
||||||
traceLen
|
traceLen
|
||||||
);
|
);
|
||||||
return traceLen;
|
return traceLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -806,7 +806,7 @@ static void DesfireSplitBytesToBlock(uint8_t *blockdata, size_t *blockdatacount,
|
||||||
}
|
}
|
||||||
|
|
||||||
int DesfireExchangeEx(bool activate_field, DesfireContext_t *ctx, uint8_t cmd, uint8_t *data, size_t datalen, uint8_t *respcode,
|
int DesfireExchangeEx(bool activate_field, DesfireContext_t *ctx, uint8_t cmd, uint8_t *data, size_t datalen, uint8_t *respcode,
|
||||||
uint8_t *resp, size_t *resplen, bool enable_chaining, size_t splitbysize) {
|
uint8_t *resp, size_t *resplen, bool enable_chaining, size_t splitbysize) {
|
||||||
int res = PM3_SUCCESS;
|
int res = PM3_SUCCESS;
|
||||||
|
|
||||||
if (!PrintChannelModeWarning(cmd, ctx->secureChannel, ctx->cmdSet, ctx->commMode))
|
if (!PrintChannelModeWarning(cmd, ctx->secureChannel, ctx->cmdSet, ctx->commMode))
|
||||||
|
|
|
@ -87,17 +87,17 @@ static void ln_command_completion(const char *text, linenoiseCompletions *lc) {
|
||||||
// When no pm3 device present
|
// When no pm3 device present
|
||||||
// and the command is not available offline,
|
// and the command is not available offline,
|
||||||
// we skip it.
|
// we skip it.
|
||||||
if ((g_session.pm3_present == false) && (vocabulory[index].offline == false )) {
|
if ((g_session.pm3_present == false) && (vocabulory[index].offline == false)) {
|
||||||
index++;
|
index++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
if (strncmp (command, text, len) == 0) {
|
if (strncmp(command, text, len) == 0) {
|
||||||
const char *space = strstr(command + len, " ");
|
const char *space = strstr(command + len, " ");
|
||||||
if (space != NULL) {
|
if (space != NULL) {
|
||||||
if ((prev_match_len == 0) || (strncmp (prev_match, command, prev_match_len < space - command ? prev_match_len : space - command) != 0)) {
|
if ((prev_match_len == 0) || (strncmp(prev_match, command, prev_match_len < space - command ? prev_match_len : space - command) != 0)) {
|
||||||
linenoiseAddCompletion(lc, str_ndup(command, space - command + 1));
|
linenoiseAddCompletion(lc, str_ndup(command, space - command + 1));
|
||||||
prev_match = command;
|
prev_match = command;
|
||||||
prev_match_len = space - command + 1;
|
prev_match_len = space - command + 1;
|
||||||
|
|
|
@ -176,10 +176,14 @@ const static vocabulory_t vocabulory[] = {
|
||||||
{ 0, "hf 15 csetuid" },
|
{ 0, "hf 15 csetuid" },
|
||||||
{ 1, "hf cipurse help" },
|
{ 1, "hf cipurse help" },
|
||||||
{ 0, "hf cipurse info" },
|
{ 0, "hf cipurse info" },
|
||||||
|
{ 0, "hf cipurse select" },
|
||||||
{ 0, "hf cipurse auth" },
|
{ 0, "hf cipurse auth" },
|
||||||
{ 0, "hf cipurse read" },
|
{ 0, "hf cipurse read" },
|
||||||
{ 0, "hf cipurse write" },
|
{ 0, "hf cipurse write" },
|
||||||
{ 0, "hf cipurse aread" },
|
{ 0, "hf cipurse aread" },
|
||||||
|
{ 0, "hf cipurse awrite" },
|
||||||
|
{ 0, "hf cipurse formatall" },
|
||||||
|
{ 0, "hf cipurse create" },
|
||||||
{ 0, "hf cipurse delete" },
|
{ 0, "hf cipurse delete" },
|
||||||
{ 0, "hf cipurse default" },
|
{ 0, "hf cipurse default" },
|
||||||
{ 1, "hf cipurse test" },
|
{ 1, "hf cipurse test" },
|
||||||
|
@ -694,6 +698,7 @@ const static vocabulory_t vocabulory[] = {
|
||||||
{ 1, "script list" },
|
{ 1, "script list" },
|
||||||
{ 1, "script run" },
|
{ 1, "script run" },
|
||||||
{ 1, "trace help" },
|
{ 1, "trace help" },
|
||||||
|
{ 1, "trace extract" },
|
||||||
{ 1, "trace list" },
|
{ 1, "trace list" },
|
||||||
{ 1, "trace load" },
|
{ 1, "trace load" },
|
||||||
{ 1, "trace save" },
|
{ 1, "trace save" },
|
||||||
|
|
|
@ -4083,7 +4083,7 @@
|
||||||
},
|
},
|
||||||
"hf mf restore": {
|
"hf mf restore": {
|
||||||
"command": "hf mf restore",
|
"command": "hf mf restore",
|
||||||
"description": "restore mifare classic binary file to tag. the key file and data file will program the card sector trailers. by default we authenticate to card with key b 0xffffffffffff. `--uid` param is used for filename templates `hf-mf-<uid>-dump.bin` and `hf-mf-<uid>-key.bin. if not specified, it will read the card uid instead. `--ka` param you can indicate that the key file should be used for authentication instead. if so we also try both b/a keys",
|
"description": "restore mifare classic dump file to tag. the key file and dump file will program the card sector trailers. by default we authenticate to card with key b 0xffffffffffff. if access rights in dump file is all zeros, it will be replaced with default values `--uid` param is used for filename templates `hf-mf-<uid>-dump.bin` and `hf-mf-<uid>-key.bin. if not specified, it will read the card uid instead. `--ka` param you can indicate that the key file should be used for authentication instead. if so we also try both b/a keys",
|
||||||
"notes": [
|
"notes": [
|
||||||
"hf mf restore",
|
"hf mf restore",
|
||||||
"hf mf restore --1k --uid 04010203",
|
"hf mf restore --1k --uid 04010203",
|
||||||
|
@ -4098,7 +4098,7 @@
|
||||||
"--2k mifare classic/plus 2k",
|
"--2k mifare classic/plus 2k",
|
||||||
"--4k mifare classic 4k / s70",
|
"--4k mifare classic 4k / s70",
|
||||||
"-u, --uid <hex> uid, 6 hex bytes",
|
"-u, --uid <hex> uid, 6 hex bytes",
|
||||||
"-f, --file <fn> data filename",
|
"-f, --file <fn> specify dump filename (bin/eml/json)",
|
||||||
"-k, --kfn <fn> key filename",
|
"-k, --kfn <fn> key filename",
|
||||||
"--ka use specified keyfile to authenticate"
|
"--ka use specified keyfile to authenticate"
|
||||||
],
|
],
|
||||||
|
@ -4152,24 +4152,24 @@
|
||||||
},
|
},
|
||||||
"hf mf staticnested": {
|
"hf mf staticnested": {
|
||||||
"command": "hf mf staticnested",
|
"command": "hf mf staticnested",
|
||||||
"description": "execute nested attack against mifare classic card with static nonce for key recovery",
|
"description": "execute nested attack against mifare classic card with static nonce for key recovery. supply a known key from one block to recover all keys",
|
||||||
"notes": [
|
"notes": [
|
||||||
"hf mf staticnested --mini --blk 0 -a -k ffffffffffff -> key recovery against mifare mini",
|
"hf mf staticnested --mini --blk 0 -a -k ffffffffffff",
|
||||||
"hf mf staticnested --1k --blk 0 -a -k ffffffffffff -> key recovery against mifare classic 1k",
|
"hf mf staticnested --1k --blk 0 -a -k ffffffffffff",
|
||||||
"hf mf staticnested --2k --blk 0 -a -k ffffffffffff -> key recovery against mifare 2k",
|
"hf mf staticnested --2k --blk 0 -a -k ffffffffffff",
|
||||||
"hf mf staticnested --4k --blk 0 -a -k ffffffffffff -> key recovery against mifare 4k"
|
"hf mf staticnested --4k --blk 0 -a -k ffffffffffff"
|
||||||
],
|
],
|
||||||
"offline": false,
|
"offline": false,
|
||||||
"options": [
|
"options": [
|
||||||
"-h, --help this help",
|
"-h, --help this help",
|
||||||
"-k, --key <hex> key specified as 12 hex symbols",
|
"-k, --key <hex> known key (12 hex symbols)",
|
||||||
"--mini mifare classic mini / s20",
|
"--mini mifare classic mini / s20",
|
||||||
"--1k mifare classic 1k / s50",
|
"--1k mifare classic 1k / s50",
|
||||||
"--2k mifare classic/plus 2k",
|
"--2k mifare classic/plus 2k",
|
||||||
"--4k mifare classic 4k / s70",
|
"--4k mifare classic 4k / s70",
|
||||||
"--blk <dec> input block number",
|
"--blk <dec> input block number",
|
||||||
"-a input key specified is a key (default)",
|
"-a input key specified is keya (def)",
|
||||||
"-b input key specified is b key",
|
"-b input key specified is keyb",
|
||||||
"-e, --emukeys fill simulator keys from found keys",
|
"-e, --emukeys fill simulator keys from found keys",
|
||||||
"--dumpkeys dump found keys to file"
|
"--dumpkeys dump found keys to file"
|
||||||
],
|
],
|
||||||
|
@ -10345,6 +10345,6 @@
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"commands_extracted": 603,
|
"commands_extracted": 603,
|
||||||
"extracted_by": "PM3Help2JSON v1.00",
|
"extracted_by": "PM3Help2JSON v1.00",
|
||||||
"extracted_on": "2022-02-04T13:37:03"
|
"extracted_on": "2022-02-05T11:30:03"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -63,19 +63,19 @@ static int decrypt(uint8_t ciphertext[], int ciphertext_len, uint8_t key[], uint
|
||||||
int len;
|
int len;
|
||||||
int plaintext_len;
|
int plaintext_len;
|
||||||
|
|
||||||
if(!(ctx = EVP_CIPHER_CTX_new()))
|
if (!(ctx = EVP_CIPHER_CTX_new()))
|
||||||
handleErrors();
|
handleErrors();
|
||||||
|
|
||||||
if(1 != EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv))
|
if (1 != EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv))
|
||||||
handleErrors();
|
handleErrors();
|
||||||
|
|
||||||
EVP_CIPHER_CTX_set_padding(ctx, 0);
|
EVP_CIPHER_CTX_set_padding(ctx, 0);
|
||||||
|
|
||||||
if(1 != EVP_DecryptUpdate(ctx, plaintext, &len, ciphertext, ciphertext_len))
|
if (1 != EVP_DecryptUpdate(ctx, plaintext, &len, ciphertext, ciphertext_len))
|
||||||
handleErrors();
|
handleErrors();
|
||||||
plaintext_len = len;
|
plaintext_len = len;
|
||||||
|
|
||||||
if(1 != EVP_DecryptFinal_ex(ctx, plaintext + len, &len))
|
if (1 != EVP_DecryptFinal_ex(ctx, plaintext + len, &len))
|
||||||
handleErrors();
|
handleErrors();
|
||||||
plaintext_len += len;
|
plaintext_len += len;
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ static int hexstr_to_byte_array(char hexstr[], uint8_t bytes[], size_t byte_len)
|
||||||
if (hexstr_len % 16) {
|
if (hexstr_len % 16) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (byte_len < hexstr_len/2) {
|
if (byte_len < hexstr_len / 2) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
char *pos = &hexstr[0];
|
char *pos = &hexstr[0];
|
||||||
|
@ -100,7 +100,7 @@ static int hexstr_to_byte_array(char hexstr[], uint8_t bytes[], size_t byte_len)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main (int argc, char* argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
uint8_t iv[16] = {0x00};
|
uint8_t iv[16] = {0x00};
|
||||||
uint8_t key[16] = {0x00};
|
uint8_t key[16] = {0x00};
|
||||||
|
@ -116,10 +116,10 @@ int main (int argc, char* argv[]) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hexstr_to_byte_array(argv[2], tag_challenge, sizeof(tag_challenge)))
|
if (hexstr_to_byte_array(argv[2], tag_challenge, sizeof(tag_challenge)))
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
if(hexstr_to_byte_array(argv[3], lock_challenge, sizeof(lock_challenge)))
|
if (hexstr_to_byte_array(argv[3], lock_challenge, sizeof(lock_challenge)))
|
||||||
return 3;
|
return 3;
|
||||||
|
|
||||||
uint64_t start_time = time(NULL);
|
uint64_t start_time = time(NULL);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#define __STDC_FORMAT_MACROS
|
#define __STDC_FORMAT_MACROS
|
||||||
|
|
||||||
#if !defined(_WIN32) && !defined(__APPLE__)
|
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||||
#define _POSIX_C_SOURCE 200112L // need localtime_r()
|
#define _POSIX_C_SOURCE 200112L // need localtime_r()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -134,9 +134,9 @@ static void print_time(uint64_t at) {
|
||||||
struct tm lt;
|
struct tm lt;
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
(void)localtime_s(<, &t);
|
(void)localtime_s(<, &t);
|
||||||
#else
|
#else
|
||||||
(void)localtime_r(&t, <);
|
(void)localtime_r(&t, <);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char res[32];
|
char res[32];
|
||||||
|
@ -213,7 +213,7 @@ static void *brute_thread(void *arguments) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int usage(const char* s) {
|
static int usage(const char *s) {
|
||||||
printf(_YELLOW_("syntax:") "\n");
|
printf(_YELLOW_("syntax:") "\n");
|
||||||
printf(" %s <unix timestamp> <16 byte tag challenge> <32 byte reader response challenge>\n", s);
|
printf(" %s <unix timestamp> <16 byte tag challenge> <32 byte reader response challenge>\n", s);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
@ -223,7 +223,7 @@ static int usage(const char* s) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main (int argc, char* argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf(_CYAN_("Telenot access MIFARE DESFire AES key recovery tool") "\n");
|
printf(_CYAN_("Telenot access MIFARE DESFire AES key recovery tool") "\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue