mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
style
This commit is contained in:
parent
4762f5f33b
commit
3f6ea0f0fc
20 changed files with 4407 additions and 4498 deletions
|
@ -1138,7 +1138,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
}
|
||||
case CMD_LF_HITAG_SIMULATE: { // Simulate Hitag tag, args = memory content
|
||||
SimulateHitag2(true);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
case CMD_LF_HITAG2_CRACK: {
|
||||
lf_hitag_data_t *payload = (lf_hitag_data_t *) packet->data.asBytes;
|
||||
|
@ -1391,7 +1391,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
struct p *payload = (struct p *) packet->data.asBytes;
|
||||
SetTag15693Uid_v2(payload->uid);
|
||||
break;
|
||||
}
|
||||
}
|
||||
case CMD_HF_ISO15693_SLIX_DISABLE_EAS: {
|
||||
struct p {
|
||||
uint8_t pwd[4];
|
||||
|
|
|
@ -850,7 +850,7 @@ static bool hitag2_crypto(uint8_t *rx, const size_t rxlen, uint8_t *tx, size_t *
|
|||
}
|
||||
|
||||
} else { // stage 2+, got data block
|
||||
|
||||
|
||||
// Store the received block
|
||||
memcpy(tag.sectors[blocknr], rx, 4);
|
||||
blocknr++;
|
||||
|
@ -901,7 +901,7 @@ static bool hitag2_authenticate(uint8_t *rx, const size_t rxlen, uint8_t *tx, si
|
|||
if (bAuthenticating) {
|
||||
DBG DbpString("Authentication - failed!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
DBG DbpString("Authenticating - send 0xC0");
|
||||
*txlen = 5;
|
||||
|
@ -933,7 +933,7 @@ static bool hitag2_authenticate(uint8_t *rx, const size_t rxlen, uint8_t *tx, si
|
|||
}
|
||||
|
||||
} else { // stage 2+, got data block
|
||||
|
||||
|
||||
// Store the received block
|
||||
memcpy(tag.sectors[blocknr], rx, 4);
|
||||
blocknr++;
|
||||
|
@ -2405,9 +2405,9 @@ out:
|
|||
|
||||
|
||||
static void ht2_send(bool turn_on, uint32_t *cmd_start
|
||||
, uint32_t *cmd_duration, uint32_t *resp_start
|
||||
, uint8_t *tx, size_t txlen, bool send_bits) {
|
||||
|
||||
, uint32_t *cmd_duration, uint32_t *resp_start
|
||||
, uint8_t *tx, size_t txlen, bool send_bits) {
|
||||
|
||||
// Tag specific configuration settings (sof, timings, etc.) HITAG2 Settings
|
||||
#define T_WAIT_1_GUARD 8
|
||||
|
||||
|
@ -2419,7 +2419,7 @@ static void ht2_send(bool turn_on, uint32_t *cmd_start
|
|||
// Wait with field on to be in "Wait for START_AUTH" timeframe
|
||||
lf_wait_periods(HITAG_T_WAIT_POWERUP + HITAG_T_WAIT_START_AUTH_MAX / 4);
|
||||
*cmd_start += HITAG_T_WAIT_POWERUP + HITAG_T_WAIT_START_AUTH_MAX / 4;
|
||||
|
||||
|
||||
} else {
|
||||
// Wait for t_wait_2 carrier periods after the last tag bit before transmitting,
|
||||
lf_wait_periods(HITAG_T_WAIT_2_MIN + HITAG_T_WAIT_2_MIN);
|
||||
|
@ -2611,13 +2611,13 @@ int ht2_read_uid(uint8_t *uid, bool ledcontrol, bool send_answer, bool keep_fiel
|
|||
|
||||
while (attempt_count && BUTTON_PRESS() == false) {
|
||||
|
||||
attempt_count--;
|
||||
attempt_count--;
|
||||
|
||||
WDT_HIT();
|
||||
|
||||
uint32_t command_start = 0, command_duration = 0;
|
||||
uint32_t response_start = 0, response_duration = 0;
|
||||
|
||||
|
||||
// start AUTH command
|
||||
size_t txlen = 5;
|
||||
uint8_t tx[1] = {0xC0};
|
||||
|
@ -2647,7 +2647,7 @@ int ht2_read_uid(uint8_t *uid, bool ledcontrol, bool send_answer, bool keep_fiel
|
|||
if (ht2_packbits(nrz_samples, nrzs, rx, &rxlen) == false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// log Receive data
|
||||
LogTraceBits(rx, rxlen, response_start, response_start + response_duration, false);
|
||||
|
||||
|
@ -2661,7 +2661,7 @@ int ht2_read_uid(uint8_t *uid, bool ledcontrol, bool send_answer, bool keep_fiel
|
|||
memcpy(uid, rx, 4);
|
||||
}
|
||||
res = PM3_SUCCESS;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
if (keep_field_up == false) {
|
||||
|
@ -2704,7 +2704,7 @@ int ht2_tx_rx(uint8_t *tx, size_t txlen, uint8_t *rx, size_t *rxlen, bool ledcon
|
|||
}
|
||||
|
||||
// decode raw samples from Manchester Encoded to bits
|
||||
if ( manrawdecode(samples, &nrzs, true, 0) ) {
|
||||
if (manrawdecode(samples, &nrzs, true, 0)) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -2712,7 +2712,7 @@ int ht2_tx_rx(uint8_t *tx, size_t txlen, uint8_t *rx, size_t *rxlen, bool ledcon
|
|||
if (ht2_packbits(samples, nrzs, rx, rxlen) == false) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
// log Receive data
|
||||
LogTraceBits(rx, *rxlen, response_start, response_start + response_duration, false);
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// See LICENSE.txt for the text of the license.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// This coode has been converted from RFIDler source code to work with Proxmark3.
|
||||
// This coode has been converted from RFIDler source code to work with Proxmark3.
|
||||
// https://github.com/AdamLaurie/RFIDler/blob/master/firmware/Pic32/RFIDler.X/src/hitag2crack.c
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
|||
const static uint8_t ERROR_RESPONSE[] = { 0xF4, 0x02, 0x88, 0x9C };
|
||||
|
||||
// #define READP0CMD "1100000111"
|
||||
const static uint8_t read_p0_cmd[] = {1,1,0,0,0,0,0,1,1,1};
|
||||
const static uint8_t read_p0_cmd[] = {1, 1, 0, 0, 0, 0, 0, 1, 1, 1};
|
||||
|
||||
// hitag2crack_xor XORs the source with the pad to produce the target.
|
||||
// source, target and pad are binarrays of length len.
|
||||
|
@ -121,7 +121,7 @@ static bool hitag2crack_read_page(uint8_t *resp, uint8_t pagenum, uint8_t *nrar,
|
|||
uint8_t response[32];
|
||||
|
||||
// convert to binarray
|
||||
hex2binarray((char*)e_response, (char*)e_resp);
|
||||
hex2binarray((char *)e_response, (char *)e_resp);
|
||||
// decrypt response
|
||||
hitag2crack_xor(response, e_response, keybits + 10, 32);
|
||||
|
||||
|
@ -129,7 +129,7 @@ static bool hitag2crack_read_page(uint8_t *resp, uint8_t pagenum, uint8_t *nrar,
|
|||
binarray2hex(response, 32, resp);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -200,7 +200,7 @@ static bool hitag2crack_find_e_page0_cmd(uint8_t *keybits, uint8_t *e_firstcmd,
|
|||
// representing the inverted bit and the 3 page bits
|
||||
// in both the non-inverted and inverted parts of the
|
||||
// encrypted command.
|
||||
uint8_t guess[10];
|
||||
uint8_t guess[10];
|
||||
memcpy(guess, e_firstcmd, 10);
|
||||
if (a) {
|
||||
guess[5] = !guess[5];
|
||||
|
@ -231,7 +231,7 @@ static bool hitag2crack_find_e_page0_cmd(uint8_t *keybits, uint8_t *e_firstcmd,
|
|||
|
||||
// convert response to binarray
|
||||
uint8_t e_uid[32];
|
||||
hex2binarray((char*)e_uid, (char*)resp);
|
||||
hex2binarray((char *)e_uid, (char *)resp);
|
||||
|
||||
// test if the guess was 'read page 0' command
|
||||
if (hitag2crack_test_e_p0cmd(keybits, nrar, guess, uid, e_uid)) {
|
||||
|
@ -299,13 +299,13 @@ static bool hitag2crack_find_valid_e_cmd(uint8_t *e_cmd, uint8_t *nrar) {
|
|||
// hitag2_crack implements the first crack algorithm described in the paper,
|
||||
// Gone In 360 Seconds by Verdult, Garcia and Balasch.
|
||||
// response is a multi-line text response containing the 8 pages of the cracked tag
|
||||
// nrarhex is a string containing hex representations of the 32 bit nR and aR values
|
||||
// nrarhex is a string containing hex representations of the 32 bit nR and aR values
|
||||
void ht2_crack(uint8_t *nrar_hex) {
|
||||
|
||||
clear_trace();
|
||||
|
||||
lf_hitag_crack_response_t packet;
|
||||
memset((uint8_t*)&packet, 0x00, sizeof(lf_hitag_crack_response_t));
|
||||
memset((uint8_t *)&packet, 0x00, sizeof(lf_hitag_crack_response_t));
|
||||
|
||||
int res = PM3_SUCCESS;
|
||||
|
||||
|
@ -319,7 +319,7 @@ void ht2_crack(uint8_t *nrar_hex) {
|
|||
|
||||
// convert to binarray
|
||||
uint8_t nrar[64] = {0};
|
||||
hex2binarray_n((char*)nrar, (char*)nrar_hex, 8);
|
||||
hex2binarray_n((char *)nrar, (char *)nrar_hex, 8);
|
||||
|
||||
// find a valid encrypted command
|
||||
uint8_t e_firstcmd[10];
|
||||
|
@ -331,7 +331,7 @@ void ht2_crack(uint8_t *nrar_hex) {
|
|||
|
||||
// now we got a first encrypted command inside e_firstcmd
|
||||
uint8_t uid[32];
|
||||
hex2binarray_n((char*)uid, (char*)uid_hex, 4);
|
||||
hex2binarray_n((char *)uid, (char *)uid_hex, 4);
|
||||
|
||||
// find the 'read page 0' command and recover key stream
|
||||
uint8_t keybits[42];
|
||||
|
@ -352,5 +352,5 @@ void ht2_crack(uint8_t *nrar_hex) {
|
|||
packet.status = 1;
|
||||
|
||||
out:
|
||||
reply_ng(CMD_LF_HITAG2_CRACK, res, (uint8_t*)&packet, sizeof(lf_hitag_crack_response_t));
|
||||
reply_ng(CMD_LF_HITAG2_CRACK, res, (uint8_t *)&packet, sizeof(lf_hitag_crack_response_t));
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ int hex2binarray_n(char *target, char *source, int sourcelen) {
|
|||
|
||||
// process 4 bits (1 hex digit) at a time
|
||||
while (sourcelen--) {
|
||||
|
||||
|
||||
char x = *(source++);
|
||||
|
||||
*(target++) = (x >> 7) & 1;
|
||||
|
@ -102,7 +102,7 @@ int hex2binarray_n(char *target, char *source, int sourcelen) {
|
|||
*(target++) = (x >> 2) & 1;
|
||||
*(target++) = (x >> 1) & 1;
|
||||
*(target++) = (x & 1);
|
||||
|
||||
|
||||
count += 8;
|
||||
}
|
||||
return count;
|
||||
|
@ -122,9 +122,9 @@ int binarray2hex(const uint8_t *bs, int bs_len, uint8_t *hex) {
|
|||
if (bs[i] == 1) {
|
||||
hex[byte_index] |= (1 << (7 - (count % 8)));
|
||||
}
|
||||
|
||||
|
||||
count++;
|
||||
|
||||
|
||||
// Move to the next byte if 8 bits have been filled
|
||||
if (count % 8 == 0) {
|
||||
byte_index++;
|
||||
|
|
|
@ -125,4 +125,4 @@ local function main(args)
|
|||
end
|
||||
end
|
||||
|
||||
main(args)
|
||||
main(args)
|
||||
|
|
|
@ -1743,12 +1743,12 @@ static int CmdSetGraphMarkers(const char *Cmd) {
|
|||
g_MarkerC.pos = arg_get_u32_def(ctx, 4, (keep ? g_MarkerC.pos : 0));
|
||||
g_MarkerD.pos = arg_get_u32_def(ctx, 5, (keep ? g_MarkerD.pos : 0));
|
||||
CLIParserFree(ctx);
|
||||
PrintAndLogEx(INFO, "Setting markers " _BRIGHT_YELLOW_("A") "=%u, "_BRIGHT_MAGENTA_("B") "=%u, "_RED_("C") "=%u, "_BLUE_("D") "=%u",
|
||||
g_MarkerA.pos,
|
||||
g_MarkerB.pos,
|
||||
g_MarkerC.pos,
|
||||
g_MarkerD.pos
|
||||
);
|
||||
PrintAndLogEx(INFO, "Setting markers " _BRIGHT_YELLOW_("A") "=%u, "_BRIGHT_MAGENTA_("B") "=%u, "_RED_("C") "=%u, "_BLUE_("D") "=%u",
|
||||
g_MarkerA.pos,
|
||||
g_MarkerB.pos,
|
||||
g_MarkerC.pos,
|
||||
g_MarkerD.pos
|
||||
);
|
||||
RepaintGraphWindow();
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
@ -3701,7 +3701,7 @@ static command_t CommandTable[] = {
|
|||
{"save", CmdSave, AlwaysAvailable, "Save signal trace data"},
|
||||
{"setdebugmode", CmdSetDebugMode, AlwaysAvailable, "Set Debugging Level on client side"},
|
||||
{"xor", CmdXor, AlwaysAvailable, "Xor a input string"},
|
||||
|
||||
|
||||
{"-----------", CmdHelp, AlwaysAvailable, "------------------------- " _CYAN_("Modulation") "-------------------------"},
|
||||
{"biphaserawdecode", CmdBiphaseDecodeRaw, AlwaysAvailable, "Biphase decode bin stream in DemodBuffer"},
|
||||
{"detectclock", CmdDetectClockRate, AlwaysAvailable, "Detect ASK, FSK, NRZ, PSK clock rate of wave in GraphBuffer"},
|
||||
|
|
|
@ -2737,7 +2737,7 @@ static int CmdHF15CSetUID(const char *Cmd) {
|
|||
"Set UID for magic Chinese card (only works with such cards)\n",
|
||||
"hf 15 csetuid -u E011223344556677 -> use gen1 command\n"
|
||||
"hf 15 csetuid -u E011223344556677 --v2 -> use gen2 command"
|
||||
);
|
||||
);
|
||||
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
|
|
|
@ -355,7 +355,7 @@ static int CmdHFMFPInfo(const char *Cmd) {
|
|||
if (supportVersion) {
|
||||
|
||||
int cardtype = getCardType(version[1], version[3], version[4]);
|
||||
switch(cardtype) {
|
||||
switch (cardtype) {
|
||||
case PLUS_EV1: {
|
||||
if (supportSignature) {
|
||||
PrintAndLogEx(INFO, "Tech..... " _GREEN_("MIFARE Plus EV1"));
|
||||
|
|
|
@ -474,7 +474,7 @@ static bool ht2_check_cryptokeys(const uint64_t *keys, const uint32_t keycount,
|
|||
}
|
||||
|
||||
static int ht2_check_dictionary(uint32_t key_count, uint8_t *keys, uint8_t keylen, uint32_t *found_idx) {
|
||||
|
||||
|
||||
lf_hitag_data_t packet;
|
||||
memset(&packet, 0, sizeof(packet));
|
||||
|
||||
|
@ -735,10 +735,10 @@ void annotateHitag2(char *exp, size_t size, const uint8_t *cmd, uint8_t cmdsize,
|
|||
if (ht2_check_cryptokeys(keys, keycount, cmd)) {
|
||||
|
||||
_ht2state.cipher_state = ht2_hitag2_init(
|
||||
_ht2state.key,
|
||||
_ht2state.uid,
|
||||
REV32((cmd[3] << 24) + (cmd[2] << 16) + (cmd[1] << 8) + cmd[0])
|
||||
);
|
||||
_ht2state.key,
|
||||
_ht2state.uid,
|
||||
REV32((cmd[3] << 24) + (cmd[2] << 16) + (cmd[1] << 8) + cmd[0])
|
||||
);
|
||||
ht2_hitag2_cipher_transcrypt(&_ht2state.cipher_state, _ht2state.plain + 4, 4, 0);
|
||||
|
||||
uint64_t key = REV64(_ht2state.key);
|
||||
|
@ -1001,7 +1001,7 @@ static int CmdLFHitagReader(const char *Cmd) {
|
|||
}
|
||||
|
||||
if (use_nrar) {
|
||||
return PM3_SUCCESS;
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
uint8_t *data = resp.data.asBytes;
|
||||
|
@ -1312,15 +1312,15 @@ static int CmdLFHitag2Dump(const char *Cmd) {
|
|||
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "lf hitag dump",
|
||||
"Read all Hitag 2 card memory and save to file\n"
|
||||
"Crypto mode key format: ISK high + ISK low, 4F4E4D494B52 (ONMIKR)\n"
|
||||
"Password mode, default key 4D494B52 (MIKR)\n",
|
||||
"lf hitag dump --pwd -> use def pwd\n"
|
||||
"lf hitag dump -k 4D494B52 -> pwd mode\n"
|
||||
"lf hitag dump --crypto -> use def crypto\n"
|
||||
"lf hitag dump -k 4F4E4D494B52 -> crypto mode\n"
|
||||
"lf hitag dump --nrar 0102030411223344\n"
|
||||
);
|
||||
"Read all Hitag 2 card memory and save to file\n"
|
||||
"Crypto mode key format: ISK high + ISK low, 4F4E4D494B52 (ONMIKR)\n"
|
||||
"Password mode, default key 4D494B52 (MIKR)\n",
|
||||
"lf hitag dump --pwd -> use def pwd\n"
|
||||
"lf hitag dump -k 4D494B52 -> pwd mode\n"
|
||||
"lf hitag dump --crypto -> use def crypto\n"
|
||||
"lf hitag dump -k 4F4E4D494B52 -> crypto mode\n"
|
||||
"lf hitag dump --nrar 0102030411223344\n"
|
||||
);
|
||||
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
|
@ -1376,10 +1376,10 @@ static int CmdLFHitag2Dump(const char *Cmd) {
|
|||
return PM3_EINVARG;
|
||||
}
|
||||
|
||||
if (keylen != 0 &&
|
||||
keylen != HITAG_PASSWORD_SIZE &&
|
||||
keylen != HITAG_CRYPTOKEY_SIZE &&
|
||||
keylen != HITAG_NRAR_SIZE) {
|
||||
if (keylen != 0 &&
|
||||
keylen != HITAG_PASSWORD_SIZE &&
|
||||
keylen != HITAG_CRYPTOKEY_SIZE &&
|
||||
keylen != HITAG_NRAR_SIZE) {
|
||||
PrintAndLogEx(WARNING, "Wrong KEY len expected (0,4,6,8) got %d", keylen);
|
||||
return PM3_EINVARG;
|
||||
}
|
||||
|
@ -1450,9 +1450,9 @@ static int CmdLFHitag2Dump(const char *Cmd) {
|
|||
|
||||
} else if (use_ht2 && use_nrar) {
|
||||
|
||||
|
||||
|
||||
memcpy(packet.NrAr, nrar, sizeof(packet.NrAr));
|
||||
|
||||
|
||||
PrintAndLogEx(INFO, _YELLOW_("Hitag 2") " - Challenge mode (NrAR)");
|
||||
|
||||
uint64_t t1 = msclock();
|
||||
|
@ -1464,7 +1464,7 @@ static int CmdLFHitag2Dump(const char *Cmd) {
|
|||
uint8_t attempt = 30;
|
||||
do {
|
||||
|
||||
PrintAndLogEx(INPLACE, "Attack 1 running..." );
|
||||
PrintAndLogEx(INPLACE, "Attack 1 running...");
|
||||
fflush(stdout);
|
||||
|
||||
if (WaitForResponseTimeout(CMD_LF_HITAG2_CRACK, &resp, 1000) == false) {
|
||||
|
@ -1472,7 +1472,7 @@ static int CmdLFHitag2Dump(const char *Cmd) {
|
|||
continue;
|
||||
}
|
||||
|
||||
lf_hitag_crack_response_t *payload = (lf_hitag_crack_response_t*)resp.data.asBytes;
|
||||
lf_hitag_crack_response_t *payload = (lf_hitag_crack_response_t *)resp.data.asBytes;
|
||||
|
||||
if (resp.status == PM3_SUCCESS) {
|
||||
PrintAndLogEx(NORMAL, " ( %s )", _GREEN_("ok"));
|
||||
|
@ -1498,7 +1498,7 @@ static int CmdLFHitag2Dump(const char *Cmd) {
|
|||
case -3: {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(FAILED, "Cannot find encrypted 'read page0' command!");
|
||||
return PM3_ESOFT;
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
case -4: {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
|
@ -1508,7 +1508,7 @@ static int CmdLFHitag2Dump(const char *Cmd) {
|
|||
}
|
||||
|
||||
} while (attempt);
|
||||
|
||||
|
||||
if (attempt == 0) {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(WARNING, "timeout while waiting for reply.");
|
||||
|
@ -1539,12 +1539,12 @@ static int CmdLFHitag2Dump(const char *Cmd) {
|
|||
|
||||
data = resp.data.asBytes;
|
||||
|
||||
out:
|
||||
out:
|
||||
|
||||
|
||||
// block3, 1 byte
|
||||
uid = bytes_to_num(data, HITAG_UID_SIZE);
|
||||
|
||||
|
||||
if (use_ht2) {
|
||||
print_hitag2_configuration(uid, data[HITAG_BLOCK_SIZE * 3]);
|
||||
print_hitag2_blocks(data, HITAG2_MAX_BYTE_SIZE);
|
||||
|
@ -1915,7 +1915,7 @@ static int CmdLFHitag2Chk(const char *Cmd) {
|
|||
|
||||
uint64_t t1 = msclock();
|
||||
|
||||
// just loop twice at max. Starting with 4 or 6.
|
||||
// just loop twice at max. Starting with 4 or 6.
|
||||
for (; keylen < 7; keylen += 2) {
|
||||
// load keys
|
||||
uint8_t *keys = NULL;
|
||||
|
@ -1934,7 +1934,7 @@ static int CmdLFHitag2Chk(const char *Cmd) {
|
|||
int status = ht2_check_dictionary(key_count, keys, keylen, &found_idx);
|
||||
|
||||
if (status == PM3_SUCCESS) {
|
||||
|
||||
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
if (keylen == 6) {
|
||||
PrintAndLogEx(SUCCESS, "found valid key [ " _GREEN_("%s") " ]", sprint_hex_inrow(keys + (found_idx * keylen), keylen));
|
||||
|
@ -2037,17 +2037,17 @@ static int CmdLFHitag2Lookup(const char *Cmd) {
|
|||
// - crypto stream generated is in BE/MSB order in Pm3 code.
|
||||
// - crypto state is in ?
|
||||
// - lfsr state is in ?
|
||||
//
|
||||
//
|
||||
// Different implementations handles internally the state either in MSB or LSB.
|
||||
// Something to keep an eye for when looking at code.
|
||||
//
|
||||
//
|
||||
// Termology:
|
||||
// cs / hstate.shiftregister / crypto state = same
|
||||
// lsfr = some implementations mixes cs and lsfr into one and only use the state. Some differentiate between them.
|
||||
// usually the key recovery functions under /tools/hitag2crack
|
||||
// IV / Nonce Reader 1 / Nr1 = same (clear text), always 00 00 00 00 in PM3 code when acting as reader.
|
||||
// Answer Reader 1 / Ar1 = encrypted and BE/MSB, +32, the clear text is always FF FF FF FF.
|
||||
// Answer Tag 1 / At1 = encrypted and BE/MSB, +32,
|
||||
// IV / Nonce Reader 1 / Nr1 = same (clear text), always 00 00 00 00 in PM3 code when acting as reader.
|
||||
// Answer Reader 1 / Ar1 = encrypted and BE/MSB, +32, the clear text is always FF FF FF FF.
|
||||
// Answer Tag 1 / At1 = encrypted and BE/MSB, +32,
|
||||
|
||||
/*
|
||||
When initializer the crypto engine
|
||||
|
|
|
@ -736,9 +736,9 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
|
|||
|
||||
// mark short bytes (less than 8 Bit + Parity)
|
||||
if (protocol == ISO_14443A ||
|
||||
protocol == PROTO_MIFARE ||
|
||||
protocol == PROTO_MFPLUS ||
|
||||
protocol == THINFILM) {
|
||||
protocol == PROTO_MIFARE ||
|
||||
protocol == PROTO_MFPLUS ||
|
||||
protocol == THINFILM) {
|
||||
|
||||
// approximated with 128 * (9 * data_len);
|
||||
uint16_t bitime = 1056 + 32;
|
||||
|
@ -978,14 +978,14 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
|
|||
}
|
||||
}
|
||||
|
||||
if (protocol == PROTO_HITAG2) {
|
||||
if (protocol == PROTO_HITAG2) {
|
||||
|
||||
uint8_t ht2plain[9] = {0};
|
||||
uint8_t n = 0;
|
||||
if (hitag2_get_plain(ht2plain, &n)) {
|
||||
|
||||
memset(explanation, 0x00, sizeof(explanation));
|
||||
|
||||
|
||||
// handle partial bytes. The parity array[0] is used to store number of left over bits from NBYTES
|
||||
// This part prints the number of bits in the trace entry for hitag.
|
||||
uint8_t nbits = parityBytes[0];
|
||||
|
@ -1019,7 +1019,7 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
|
|||
|
||||
} else {
|
||||
snprintf(line[j / 18] + ((j % 18) * 4) + offset, 120, "%02X ", ht2plain[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
num_lines = MIN((n - 1) / TRACE_MAX_HEX_BYTES + 1, TRACE_MAX_HEX_BYTES);
|
||||
|
@ -1041,7 +1041,7 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
|
|||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (is_last_record(tracepos, traceLen)) {
|
||||
return traceLen;
|
||||
|
@ -1480,7 +1480,7 @@ int CmdTraceList(const char *Cmd) {
|
|||
if (diclen > 0) {
|
||||
uint8_t *keyBlock = NULL;
|
||||
int res = loadFileDICTIONARY_safe(dictionary, (void **) &keyBlock, 6, &dicKeysCount);
|
||||
if (res != PM3_SUCCESS || dicKeysCount == 0 || keyBlock == NULL) {
|
||||
if (res != PM3_SUCCESS || dicKeysCount == 0 || keyBlock == NULL) {
|
||||
PrintAndLogEx(FAILED, "An error occurred while loading the dictionary! (we will use the default keys now)");
|
||||
} else {
|
||||
dicKeys = calloc(dicKeysCount, sizeof(uint64_t));
|
||||
|
@ -1500,8 +1500,8 @@ int CmdTraceList(const char *Cmd) {
|
|||
}
|
||||
}
|
||||
|
||||
if ( protocol == PROTO_HITAG2) {
|
||||
|
||||
if (protocol == PROTO_HITAG2) {
|
||||
|
||||
if (strlen(dictionary) == 0) {
|
||||
snprintf(dictionary, sizeof(dictionary), HITAG_DICTIONARY);
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ size_t getFromGraphBufferEx(uint8_t *dest, size_t maxLen) {
|
|||
}
|
||||
|
||||
//TODO: In progress function to get chunks of data from the GB w/o modifying the GB
|
||||
//Currently seems like it doesn't work correctly?
|
||||
//Currently seems like it doesn't work correctly?
|
||||
size_t getGraphBufferChunk(uint8_t *dest, size_t start, size_t end) {
|
||||
if (dest == NULL) return 0;
|
||||
if (g_GraphTraceLen == 0) return 0;
|
||||
|
|
|
@ -742,7 +742,7 @@ static int DesfireExchangeISONative(bool activate_field, DesfireContext_t *ctx,
|
|||
pos += buflen;
|
||||
if (enable_chaining == false) {
|
||||
if (sw == DESFIRE_GET_ISO_STATUS(MFDES_S_OPERATION_OK) ||
|
||||
sw == DESFIRE_GET_ISO_STATUS(MFDES_ADDITIONAL_FRAME)) {
|
||||
sw == DESFIRE_GET_ISO_STATUS(MFDES_ADDITIONAL_FRAME)) {
|
||||
|
||||
if (resplen) {
|
||||
*resplen = pos;
|
||||
|
|
|
@ -626,13 +626,13 @@ static void DesfireSecureChannelDecodeEV1(DesfireContext_t *ctx, uint8_t *srcdat
|
|||
PrintAndLogEx(INFO, " calculated MAC: %s", sprint_hex(cmac, DesfireGetMACLength(ctx)));
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
if (GetAPDULogging()) {
|
||||
PrintAndLogEx(INFO, "Received MAC OK");
|
||||
}
|
||||
}
|
||||
|
||||
} else if (ctx->commMode == DCMEncrypted || ctx->commMode == DCMEncryptedWithPadding) {
|
||||
} else if (ctx->commMode == DCMEncrypted || ctx->commMode == DCMEncryptedWithPadding) {
|
||||
|
||||
if (srcdatalen < desfire_get_key_block_length(ctx->keyType)) {
|
||||
memcpy(dstdata, srcdata, srcdatalen);
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -75,6 +75,15 @@ const static vocabulary_t vocabulary[] = {
|
|||
{ 1, "analyse foo" },
|
||||
{ 1, "analyse units" },
|
||||
{ 1, "data help" },
|
||||
{ 1, "data clear" },
|
||||
{ 1, "data hide" },
|
||||
{ 1, "data load" },
|
||||
{ 1, "data num" },
|
||||
{ 1, "data plot" },
|
||||
{ 1, "data print" },
|
||||
{ 1, "data save" },
|
||||
{ 1, "data setdebugmode" },
|
||||
{ 1, "data xor" },
|
||||
{ 1, "data biphaserawdecode" },
|
||||
{ 1, "data detectclock" },
|
||||
{ 1, "data fsktonrz" },
|
||||
|
@ -83,43 +92,32 @@ const static vocabulary_t vocabulary[] = {
|
|||
{ 1, "data rawdemod" },
|
||||
{ 1, "data askedgedetect" },
|
||||
{ 1, "data autocorr" },
|
||||
{ 1, "data convertbitstream" },
|
||||
{ 1, "data cthreshold" },
|
||||
{ 1, "data dirthreshold" },
|
||||
{ 1, "data decimate" },
|
||||
{ 1, "data envelope" },
|
||||
{ 1, "data undecimate" },
|
||||
{ 1, "data hide" },
|
||||
{ 1, "data grid" },
|
||||
{ 1, "data getbitstream" },
|
||||
{ 1, "data hpf" },
|
||||
{ 1, "data iir" },
|
||||
{ 1, "data grid" },
|
||||
{ 1, "data ltrim" },
|
||||
{ 1, "data mtrim" },
|
||||
{ 1, "data norm" },
|
||||
{ 1, "data plot" },
|
||||
{ 1, "data cthreshold" },
|
||||
{ 1, "data rtrim" },
|
||||
{ 1, "data setgraphmarkers" },
|
||||
{ 1, "data shiftgraphzero" },
|
||||
{ 1, "data timescale" },
|
||||
{ 1, "data undecimate" },
|
||||
{ 1, "data zerocrossings" },
|
||||
{ 1, "data convertbitstream" },
|
||||
{ 1, "data getbitstream" },
|
||||
{ 1, "data asn1" },
|
||||
{ 1, "data atr" },
|
||||
{ 1, "data bin2hex" },
|
||||
{ 0, "data bitsamples" },
|
||||
{ 1, "data bmap" },
|
||||
{ 1, "data clear" },
|
||||
{ 1, "data crypto" },
|
||||
{ 1, "data diff" },
|
||||
{ 0, "data hexsamples" },
|
||||
{ 1, "data hex2bin" },
|
||||
{ 1, "data load" },
|
||||
{ 1, "data num" },
|
||||
{ 1, "data print" },
|
||||
{ 0, "data samples" },
|
||||
{ 1, "data save" },
|
||||
{ 1, "data setdebugmode" },
|
||||
{ 1, "data xor" },
|
||||
{ 1, "emv help" },
|
||||
{ 1, "emv list" },
|
||||
{ 1, "emv test" },
|
||||
|
@ -558,11 +556,11 @@ const static vocabulary_t vocabulary[] = {
|
|||
{ 0, "lf sniff" },
|
||||
{ 0, "lf tune" },
|
||||
{ 1, "lf awid help" },
|
||||
{ 0, "lf awid brute" },
|
||||
{ 0, "lf awid clone" },
|
||||
{ 1, "lf awid demod" },
|
||||
{ 0, "lf awid reader" },
|
||||
{ 0, "lf awid clone" },
|
||||
{ 0, "lf awid sim" },
|
||||
{ 0, "lf awid brute" },
|
||||
{ 0, "lf awid watch" },
|
||||
{ 1, "lf cotag help" },
|
||||
{ 1, "lf cotag demod" },
|
||||
|
@ -647,16 +645,19 @@ const static vocabulary_t vocabulary[] = {
|
|||
{ 1, "lf hitag help" },
|
||||
{ 1, "lf hitag list" },
|
||||
{ 0, "lf hitag info" },
|
||||
{ 1, "lf hitag selftest" },
|
||||
{ 0, "lf hitag dump" },
|
||||
{ 0, "lf hitag read" },
|
||||
{ 0, "lf hitag sniff" },
|
||||
{ 1, "lf hitag view" },
|
||||
{ 0, "lf hitag wrbl" },
|
||||
{ 0, "lf hitag sniff" },
|
||||
{ 0, "lf hitag cc" },
|
||||
{ 0, "lf hitag ta" },
|
||||
{ 0, "lf hitag eload" },
|
||||
{ 0, "lf hitag eview" },
|
||||
{ 0, "lf hitag sim" },
|
||||
{ 0, "lf hitag cc" },
|
||||
{ 0, "lf hitag chk" },
|
||||
{ 1, "lf hitag lookup" },
|
||||
{ 0, "lf hitag ta" },
|
||||
{ 1, "lf idteck help" },
|
||||
{ 1, "lf idteck demod" },
|
||||
{ 0, "lf idteck reader" },
|
||||
|
|
|
@ -138,12 +138,12 @@ extern "C" void InitGraphics(int argc, char **argv, char *script_cmds_file, char
|
|||
}
|
||||
|
||||
void add_temporary_marker(uint32_t position, const char *label) {
|
||||
if(g_TempMarkerSize == 0) { //Initialize the marker array
|
||||
g_TempMarkers = (marker_t*)calloc(1, sizeof(marker_t));
|
||||
if (g_TempMarkerSize == 0) { //Initialize the marker array
|
||||
g_TempMarkers = (marker_t *)calloc(1, sizeof(marker_t));
|
||||
} else { //add more space to the marker array using realloc()
|
||||
marker_t *temp = (marker_t*)realloc(g_TempMarkers, ((g_TempMarkerSize + 1) * sizeof(marker_t)));
|
||||
marker_t *temp = (marker_t *)realloc(g_TempMarkers, ((g_TempMarkerSize + 1) * sizeof(marker_t)));
|
||||
|
||||
if(temp == NULL) { //Unable to reallocate memory for a new marker
|
||||
if (temp == NULL) { //Unable to reallocate memory for a new marker
|
||||
PrintAndLogEx(FAILED, "Unable to allocate memory for a new temporary marker!");
|
||||
free(temp);
|
||||
return;
|
||||
|
@ -155,10 +155,10 @@ void add_temporary_marker(uint32_t position, const char *label) {
|
|||
|
||||
g_TempMarkers[g_TempMarkerSize].pos = position;
|
||||
|
||||
char *markerLabel = (char*)calloc(1, strlen(label) + 1);
|
||||
char *markerLabel = (char *)calloc(1, strlen(label) + 1);
|
||||
strcpy(markerLabel, label);
|
||||
|
||||
if(strlen(markerLabel) > 30) {
|
||||
if (strlen(markerLabel) > 30) {
|
||||
PrintAndLogEx(WARNING, "Label for temporary marker too long! Trunicating...");
|
||||
markerLabel[30] = '\0';
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ void add_temporary_marker(uint32_t position, const char *label) {
|
|||
}
|
||||
|
||||
void remove_temporary_markers(void) {
|
||||
if(g_TempMarkerSize == 0) return;
|
||||
if (g_TempMarkerSize == 0) return;
|
||||
|
||||
memset(g_TempMarkers, 0x00, (g_TempMarkerSize * sizeof(marker_t)));
|
||||
free(g_TempMarkers);
|
||||
|
|
|
@ -598,7 +598,7 @@ void Plot::setMaxAndStart(int *buffer, size_t len, QRect plotRect) {
|
|||
}
|
||||
|
||||
void Plot::appendMax(int *buffer, size_t len, QRect plotRect) {
|
||||
if(len == 0) {
|
||||
if (len == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -750,12 +750,12 @@ void Plot::PlotGraph(int *buffer, size_t len, QRect plotRect, QRect annotationRe
|
|||
painter->drawPath(penPath);
|
||||
char str[200];
|
||||
snprintf(str, sizeof(str), "max=%d min=%d mean=%" PRId64 " n=%u/%zu",
|
||||
vMax,
|
||||
vMin,
|
||||
vMean,
|
||||
g_GraphStop - g_GraphStart,
|
||||
len
|
||||
);
|
||||
vMax,
|
||||
vMin,
|
||||
vMean,
|
||||
g_GraphStop - g_GraphStart,
|
||||
len
|
||||
);
|
||||
|
||||
painter->drawText(20, annotationRect.bottom() - (48 - (12 * graphNum)), str);
|
||||
}
|
||||
|
@ -781,37 +781,37 @@ void Plot::drawAnnotations(QRect annotationRect, QPainter *painter) {
|
|||
|
||||
//Print the Graph Information
|
||||
char graphText[] = "@%u..%u dt=%i %s zoom=%2.3f";
|
||||
length = ((sizeof(graphText))+(sizeof(uint32_t)*3)+sizeof(scalestr)+sizeof(float_t));
|
||||
length = ((sizeof(graphText)) + (sizeof(uint32_t) * 3) + sizeof(scalestr) + sizeof(float_t));
|
||||
|
||||
annotation = (char*)calloc(1, length);
|
||||
annotation = (char *)calloc(1, length);
|
||||
|
||||
snprintf(annotation, length, graphText,
|
||||
g_GraphStart,
|
||||
g_GraphStop,
|
||||
g_MarkerB.pos - g_MarkerA.pos,
|
||||
scalestr,
|
||||
g_GraphPixelsPerPoint
|
||||
);
|
||||
g_GraphStart,
|
||||
g_GraphStop,
|
||||
g_MarkerB.pos - g_MarkerA.pos,
|
||||
scalestr,
|
||||
g_GraphPixelsPerPoint
|
||||
);
|
||||
|
||||
painter->setPen(GREEN);
|
||||
painter->drawText(82, annotationRect.bottom() - 62, annotation);
|
||||
|
||||
//Print Grid Information if the grid is enabled
|
||||
if(g_PlotGridX > 0) {
|
||||
if (g_PlotGridX > 0) {
|
||||
free(annotation);
|
||||
|
||||
const char *gridLocked = (g_GridLocked ? "Locked" : "Unlocked");
|
||||
char gridText[] = "GridX=%lf GridY=%lf (%s) GridXoffset=%lf";
|
||||
length = (sizeof(gridText) + (sizeof(double)*3) + sizeof(gridLocked));
|
||||
length = (sizeof(gridText) + (sizeof(double) * 3) + sizeof(gridLocked));
|
||||
|
||||
annotation = (char*)calloc(1, length);
|
||||
annotation = (char *)calloc(1, length);
|
||||
|
||||
snprintf(annotation, length, gridText,
|
||||
g_DefaultGridX,
|
||||
g_DefaultGridY,
|
||||
gridLocked,
|
||||
g_GridOffset
|
||||
);
|
||||
g_DefaultGridX,
|
||||
g_DefaultGridY,
|
||||
gridLocked,
|
||||
g_GridOffset
|
||||
);
|
||||
|
||||
painter->setPen(WHITE);
|
||||
painter->drawText(800, annotationRect.bottom() - 62, annotation);
|
||||
|
@ -822,21 +822,21 @@ void Plot::drawAnnotations(QRect annotationRect, QPainter *painter) {
|
|||
uint32_t pos = 0, loc = 375;
|
||||
painter->setPen(WHITE);
|
||||
|
||||
if(g_MarkerA.pos > 0) {
|
||||
if (g_MarkerA.pos > 0) {
|
||||
free(annotation);
|
||||
|
||||
length = (sizeof(markerText) + (sizeof(uint32_t)*3) + sizeof(" ") + 1);
|
||||
length = (sizeof(markerText) + (sizeof(uint32_t) * 3) + sizeof(" ") + 1);
|
||||
pos = g_MarkerA.pos;
|
||||
bool flag = false;
|
||||
size_t value;
|
||||
|
||||
annotation = (char*)calloc(1, length);
|
||||
char *textA = (char*)calloc(1, length);
|
||||
annotation = (char *)calloc(1, length);
|
||||
char *textA = (char *)calloc(1, length);
|
||||
|
||||
strcat(textA, markerText);
|
||||
strcat(textA, " (%s%u)");
|
||||
|
||||
if(g_GraphBuffer[pos] <= g_OperationBuffer[pos]) {
|
||||
if (g_GraphBuffer[pos] <= g_OperationBuffer[pos]) {
|
||||
flag = true;
|
||||
value = (g_OperationBuffer[pos] - g_GraphBuffer[pos]);
|
||||
} else {
|
||||
|
@ -844,65 +844,65 @@ void Plot::drawAnnotations(QRect annotationRect, QPainter *painter) {
|
|||
}
|
||||
|
||||
snprintf(annotation, length, textA,
|
||||
"A",
|
||||
pos,
|
||||
g_GraphBuffer[pos],
|
||||
flag ? "+" : "-",
|
||||
value
|
||||
);
|
||||
"A",
|
||||
pos,
|
||||
g_GraphBuffer[pos],
|
||||
flag ? "+" : "-",
|
||||
value
|
||||
);
|
||||
|
||||
painter->drawText(loc, annotationRect.bottom() - 48, annotation);
|
||||
|
||||
free(textA);
|
||||
}
|
||||
|
||||
if(g_MarkerB.pos > 0) {
|
||||
if (g_MarkerB.pos > 0) {
|
||||
free(annotation);
|
||||
|
||||
length = ((sizeof(markerText))+(sizeof(uint32_t)*2)+1);
|
||||
length = ((sizeof(markerText)) + (sizeof(uint32_t) * 2) + 1);
|
||||
pos = g_MarkerB.pos;
|
||||
|
||||
annotation = (char*)calloc(1, length);
|
||||
annotation = (char *)calloc(1, length);
|
||||
|
||||
snprintf(annotation, length, markerText,
|
||||
"B",
|
||||
pos,
|
||||
g_GraphBuffer[pos]
|
||||
);
|
||||
"B",
|
||||
pos,
|
||||
g_GraphBuffer[pos]
|
||||
);
|
||||
|
||||
painter->drawText(loc, annotationRect.bottom() - 36, annotation);
|
||||
}
|
||||
|
||||
if(g_MarkerC.pos > 0) {
|
||||
if (g_MarkerC.pos > 0) {
|
||||
free(annotation);
|
||||
|
||||
length = ((sizeof(markerText))+(sizeof(uint32_t)*2)+1);
|
||||
length = ((sizeof(markerText)) + (sizeof(uint32_t) * 2) + 1);
|
||||
pos = g_MarkerC.pos;
|
||||
|
||||
annotation = (char*)calloc(1, length);
|
||||
annotation = (char *)calloc(1, length);
|
||||
|
||||
snprintf(annotation, length, markerText,
|
||||
"C",
|
||||
pos,
|
||||
g_GraphBuffer[pos]
|
||||
);
|
||||
"C",
|
||||
pos,
|
||||
g_GraphBuffer[pos]
|
||||
);
|
||||
|
||||
painter->drawText(loc, annotationRect.bottom() - 24, annotation);
|
||||
}
|
||||
|
||||
if(g_MarkerD.pos > 0) {
|
||||
if (g_MarkerD.pos > 0) {
|
||||
free(annotation);
|
||||
|
||||
length = ((sizeof(markerText))+(sizeof(uint32_t)*2)+1);
|
||||
length = ((sizeof(markerText)) + (sizeof(uint32_t) * 2) + 1);
|
||||
pos = g_MarkerD.pos;
|
||||
|
||||
annotation = (char*)calloc(1, length);
|
||||
annotation = (char *)calloc(1, length);
|
||||
|
||||
snprintf(annotation, length, markerText,
|
||||
"D",
|
||||
pos,
|
||||
g_GraphBuffer[pos]
|
||||
);
|
||||
"D",
|
||||
pos,
|
||||
g_GraphBuffer[pos]
|
||||
);
|
||||
|
||||
painter->drawText(loc, annotationRect.bottom() - 12, annotation);
|
||||
}
|
||||
|
@ -951,7 +951,7 @@ void Plot::plotGridLines(QPainter *painter, QRect r) {
|
|||
}
|
||||
|
||||
void Plot::plotOperations(int *buffer, size_t len, QPainter *painter, QRect plotRect) {
|
||||
if(len == 0) {
|
||||
if (len == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -973,10 +973,10 @@ void Plot::plotOperations(int *buffer, size_t len, QPainter *painter, QRect plot
|
|||
y = yCoordOf(current, plotRect, gs_absVMax);
|
||||
|
||||
//We only want to graph changes between the Graph Buffer and the Operation Buffer
|
||||
if(current == g_GraphBuffer[pos]) {
|
||||
if (current == g_GraphBuffer[pos]) {
|
||||
//If this point is the same, but the last point is different, we want to plot that line
|
||||
//as well
|
||||
if((pos == 0) || (prev == g_GraphBuffer[pos - 1])) {
|
||||
if ((pos == 0) || (prev == g_GraphBuffer[pos - 1])) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
|
@ -1045,8 +1045,8 @@ void Plot::paintEvent(QPaintEvent *event) {
|
|||
// End graph drawing
|
||||
|
||||
//Draw the markers
|
||||
if(g_TempMarkerSize > 0) {
|
||||
for(int i = 0; i < g_TempMarkerSize; i++) {
|
||||
if (g_TempMarkerSize > 0) {
|
||||
for (int i = 0; i < g_TempMarkerSize; i++) {
|
||||
draw_marker(g_TempMarkers[i], plotRect, GRAY100, &painter);
|
||||
}
|
||||
}
|
||||
|
@ -1074,15 +1074,15 @@ void Plot::draw_marker(marker_t marker, QRect plotRect, QColor color, QPainter *
|
|||
painter->setPen(color);
|
||||
|
||||
//If the marker is outside the buffer length, reset
|
||||
if(marker.pos > g_GraphTraceLen) {
|
||||
if (marker.pos > g_GraphTraceLen) {
|
||||
marker.pos = 0;
|
||||
}
|
||||
|
||||
//Make sure the marker is inside the current plot view to render
|
||||
if(marker.pos > g_GraphStart && xCoordOf(marker.pos, plotRect) < plotRect.right()) {
|
||||
if (marker.pos > g_GraphStart && xCoordOf(marker.pos, plotRect) < plotRect.right()) {
|
||||
painter->drawLine(xCoordOf(marker.pos, plotRect), plotRect.top(), xCoordOf(marker.pos, plotRect), plotRect.bottom());
|
||||
|
||||
if(strlen(marker.label) > 0) {
|
||||
if (strlen(marker.label) > 0) {
|
||||
painter->drawText(xCoordOf(marker.pos, plotRect) + 1, plotRect.top() + 12, marker.label);
|
||||
}
|
||||
}
|
||||
|
@ -1295,7 +1295,7 @@ void Plot::keyPressEvent(QKeyEvent *event) {
|
|||
offset = 1;
|
||||
} else {
|
||||
offset = int(ZOOM_LIMIT / g_GraphPixelsPerPoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (event->key()) {
|
||||
|
@ -1393,9 +1393,9 @@ void Plot::keyPressEvent(QKeyEvent *event) {
|
|||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9 + 9, _RED_("[ ") "/" _RED_(" ]"), "Move yellow marker left/right by 1 sample");
|
||||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9 + 9, _RED_("{ ") "/" _RED_(" }"), "Move pink marker left/right by 1 sample");
|
||||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, " + " _RED_("Ctrl"), "... by 5 samples");
|
||||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9 +9, _RED_("= ") "/" _RED_(" -"), "Add/Subtract to the plot point (Operation Buffer) over the yellow marker by 1");
|
||||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9 + 9, _RED_("= ") "/" _RED_(" -"), "Add/Subtract to the plot point (Operation Buffer) over the yellow marker by 1");
|
||||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, " + " _RED_("Ctrl"), "... by 5");
|
||||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9 +9, _RED_("+ ") "/" _RED_(" _"), "Add/Subtract to the plot point (Graph Buffer) over the yellow marker by 1");
|
||||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9 + 9, _RED_("+ ") "/" _RED_(" _"), "Add/Subtract to the plot point (Graph Buffer) over the yellow marker by 1");
|
||||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, " + " _RED_("Ctrl"), "... by 5");
|
||||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _RED_("h"), "Show this help");
|
||||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _RED_("q"), "Close plot window");
|
||||
|
@ -1441,9 +1441,9 @@ void Plot::keyPressEvent(QKeyEvent *event) {
|
|||
if (g_GraphStart > startMax)
|
||||
g_GraphStart = startMax;
|
||||
break;
|
||||
|
||||
|
||||
case Qt::Key_Equal:
|
||||
if(event->modifiers() & Qt::ControlModifier) {
|
||||
if (event->modifiers() & Qt::ControlModifier) {
|
||||
g_OperationBuffer[g_MarkerA.pos] += 5;
|
||||
} else {
|
||||
g_OperationBuffer[g_MarkerA.pos] += 1;
|
||||
|
@ -1451,9 +1451,9 @@ void Plot::keyPressEvent(QKeyEvent *event) {
|
|||
|
||||
RepaintGraphWindow();
|
||||
break;
|
||||
|
||||
|
||||
case Qt::Key_Minus:
|
||||
if(event->modifiers() & Qt::ControlModifier) {
|
||||
if (event->modifiers() & Qt::ControlModifier) {
|
||||
g_OperationBuffer[g_MarkerA.pos] -= 5;
|
||||
} else {
|
||||
g_OperationBuffer[g_MarkerA.pos] -= 1;
|
||||
|
@ -1463,7 +1463,7 @@ void Plot::keyPressEvent(QKeyEvent *event) {
|
|||
break;
|
||||
|
||||
case Qt::Key_Plus:
|
||||
if(event->modifiers() & Qt::ControlModifier) {
|
||||
if (event->modifiers() & Qt::ControlModifier) {
|
||||
g_GraphBuffer[g_MarkerA.pos] += 5;
|
||||
} else {
|
||||
g_GraphBuffer[g_MarkerA.pos] += 1;
|
||||
|
@ -1471,9 +1471,9 @@ void Plot::keyPressEvent(QKeyEvent *event) {
|
|||
|
||||
RepaintGraphWindow();
|
||||
break;
|
||||
|
||||
|
||||
case Qt::Key_Underscore:
|
||||
if(event->modifiers() & Qt::ControlModifier) {
|
||||
if (event->modifiers() & Qt::ControlModifier) {
|
||||
g_GraphBuffer[g_MarkerA.pos] -= 5;
|
||||
} else {
|
||||
g_GraphBuffer[g_MarkerA.pos] -= 1;
|
||||
|
@ -1483,77 +1483,77 @@ void Plot::keyPressEvent(QKeyEvent *event) {
|
|||
break;
|
||||
|
||||
case Qt::Key_BracketLeft: {
|
||||
if(event->modifiers() & Qt::ControlModifier) {
|
||||
if (event->modifiers() & Qt::ControlModifier) {
|
||||
g_MarkerA.pos -= 5;
|
||||
} else {
|
||||
g_MarkerA.pos -= 1;
|
||||
}
|
||||
|
||||
if((g_MarkerA.pos >= g_GraphStop) || (g_MarkerA.pos <= g_GraphStart)) {
|
||||
if ((g_MarkerA.pos >= g_GraphStop) || (g_MarkerA.pos <= g_GraphStart)) {
|
||||
uint32_t halfway = PageWidth / 2;
|
||||
|
||||
if((g_MarkerA.pos - halfway) > g_GraphTraceLen) {
|
||||
if ((g_MarkerA.pos - halfway) > g_GraphTraceLen) {
|
||||
g_GraphStart = 0;
|
||||
} else {
|
||||
g_GraphStart = g_MarkerA.pos - halfway;
|
||||
}
|
||||
}
|
||||
|
||||
if(g_MarkerA.pos < g_GraphStart) {
|
||||
if (g_MarkerA.pos < g_GraphStart) {
|
||||
g_MarkerA.pos = g_GraphStart;
|
||||
}
|
||||
|
||||
RepaintGraphWindow();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case Qt::Key_BracketRight: {
|
||||
if(event->modifiers() & Qt::ControlModifier) {
|
||||
if (event->modifiers() & Qt::ControlModifier) {
|
||||
g_MarkerA.pos += 5;
|
||||
} else {
|
||||
g_MarkerA.pos += 1;
|
||||
}
|
||||
|
||||
if((g_MarkerA.pos >= g_GraphStop) || (g_MarkerA.pos <= g_GraphStart)) {
|
||||
if ((g_MarkerA.pos >= g_GraphStop) || (g_MarkerA.pos <= g_GraphStart)) {
|
||||
uint32_t halfway = PageWidth / 2;
|
||||
|
||||
if((g_MarkerA.pos + halfway) >= g_GraphTraceLen) {
|
||||
if ((g_MarkerA.pos + halfway) >= g_GraphTraceLen) {
|
||||
g_GraphStart = g_GraphTraceLen - halfway;
|
||||
} else {
|
||||
g_GraphStart = g_MarkerA.pos - halfway;
|
||||
}
|
||||
}
|
||||
|
||||
if(g_MarkerA.pos >= g_GraphTraceLen) {
|
||||
if (g_MarkerA.pos >= g_GraphTraceLen) {
|
||||
g_MarkerA.pos = g_GraphTraceLen;
|
||||
}
|
||||
|
||||
RepaintGraphWindow();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case Qt::Key_BraceLeft:
|
||||
if(event->modifiers() & Qt::ControlModifier) {
|
||||
if (event->modifiers() & Qt::ControlModifier) {
|
||||
g_MarkerB.pos -= 5;
|
||||
} else {
|
||||
g_MarkerB.pos -= 1;
|
||||
}
|
||||
|
||||
if(g_MarkerB.pos < g_GraphStart) {
|
||||
if (g_MarkerB.pos < g_GraphStart) {
|
||||
g_MarkerB.pos = g_GraphStart;
|
||||
}
|
||||
|
||||
|
||||
RepaintGraphWindow();
|
||||
break;
|
||||
|
||||
|
||||
case Qt::Key_BraceRight:
|
||||
if(event->modifiers() & Qt::ControlModifier) {
|
||||
if (event->modifiers() & Qt::ControlModifier) {
|
||||
g_MarkerB.pos += 5;
|
||||
} else {
|
||||
g_MarkerB.pos += 1;
|
||||
}
|
||||
|
||||
if(g_MarkerB.pos >= g_GraphTraceLen) {
|
||||
if (g_MarkerB.pos >= g_GraphTraceLen) {
|
||||
g_MarkerB.pos = g_GraphTraceLen;
|
||||
}
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@
|
|||
"options": [
|
||||
"-h, --help This help",
|
||||
"-d <hex> ASN1 encoded byte array",
|
||||
"-t, --test perform selftest"
|
||||
"-t, --test perform self test"
|
||||
],
|
||||
"usage": "data asn1 [-ht] [-d <hex>]"
|
||||
},
|
||||
|
@ -221,18 +221,21 @@
|
|||
],
|
||||
"usage": "data autocorr [-hg] [-w <dec>]"
|
||||
},
|
||||
"data bin2hex": {
|
||||
"command": "data bin2hex",
|
||||
"description": "This function converts binary to hexadecimal. It will ignore all characters not 1 or 0 but stop reading on whitespace",
|
||||
"data biphaserawdecode": {
|
||||
"command": "data biphaserawdecode",
|
||||
"description": "Biphase decode binary stream in DemodBuffer Converts 10 or 01 -> 1 and 11 or 00 -> 0 - must have binary sequence in DemodBuffer (run `data rawdemod --ar` before) - invert for Conditional Dephase Encoding (CDP) AKA Differential Manchester",
|
||||
"notes": [
|
||||
"data bin2hex -d 0101111001010"
|
||||
"data biphaserawdecode -> decode biphase bitstream from the DemodBuffer",
|
||||
"data biphaserawdecode -oi -> decode biphase bitstream from the DemodBuffer, adjust offset, and invert output"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-d, --data <bin> binary string to convert"
|
||||
"-o, --offset set to adjust decode start position",
|
||||
"-i, --inv invert output",
|
||||
"--err <dec> set max errors tolerated (def 20)"
|
||||
],
|
||||
"usage": "data bin2hex [-h] -d <bin>"
|
||||
"usage": "data biphaserawdecode [-hoi] [--err <dec>]"
|
||||
},
|
||||
"data bitsamples": {
|
||||
"command": "data bitsamples",
|
||||
|
@ -261,18 +264,6 @@
|
|||
],
|
||||
"usage": "data bmap [-h] [-d <hex>] [-m <str>]"
|
||||
},
|
||||
"data clear": {
|
||||
"command": "data clear",
|
||||
"description": "This function clears the bigbuff on deviceside and graph window",
|
||||
"notes": [
|
||||
"data clear"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help"
|
||||
],
|
||||
"usage": "data clear [-h]"
|
||||
},
|
||||
"data convertbitstream": {
|
||||
"command": "data convertbitstream",
|
||||
"description": "Convert GraphBuffer's 0|1 values to 127|-127",
|
||||
|
@ -444,32 +435,15 @@
|
|||
},
|
||||
"data help": {
|
||||
"command": "data help",
|
||||
"description": "----------- ------------------------- General------------------------- help This help ----------- ------------------------- Modulation------------------------- biphaserawdecode Biphase decode bin stream in DemodBuffer detectclock Detect ASK, FSK, NRZ, PSK clock rate of wave in GraphBuffer fsktonrz Convert fsk2 to nrz wave for alternate fsk demodulating (for weak fsk) manrawdecode Manchester decode binary stream in DemodBuffer modulation Identify LF signal for clock and modulation rawdemod Demodulate the data in the GraphBuffer and output binary ----------- ------------------------- Graph------------------------- askedgedetect Adjust Graph for manual ASK demod autocorr Autocorrelation over window dirthreshold Max rising higher up-thres/ Min falling lower down-thres decimate Decimate samples envelope Generate square envelope of samples undecimate Un-decimate samples hide Hide graph window hpf Remove DC offset from trace iir Apply IIR buttersworth filter on plot data grid overlay grid on graph window ltrim Trim samples from left of trace mtrim Trim out samples from the specified start to the specified stop norm Normalize max/min to +/-128 plot Show graph window cthreshold Average out all values between rtrim Trim samples from right of trace setgraphmarkers Set blue and orange marker in graph window shiftgraphzero Shift 0 for Graphed wave + or - shift value timescale Set cursor display timescale zerocrossings Count time between zero-crossings convertbitstream Convert GraphBuffer's 0/1 values to 127 / -127 getbitstream Convert GraphBuffer's >=1 values to 1 and <1 to 0 ----------- ------------------------- Operations------------------------- asn1 ASN1 decoder atr ATR lookup bin2hex Converts binary to hexadecimal bmap Convert hex value according a binary template clear Clears bigbuf on deviceside and graph window crypto Encrypt and decrypt data diff Diff of input files hex2bin Converts hexadecimal to binary load Load contents of file into graph window num Converts dec/hex/bin print Print the data in the DemodBuffer save Save signal trace data ( GraphBuffer ) setdebugmode Set Debugging Level on client side xor Xor a input string --------------------------------------------------------------------------------------- data biphaserawdecode available offline: yes Biphase decode binary stream in DemodBuffer Converts 10 or 01 -> 1 and 11 or 00 -> 0 - must have binary sequence in DemodBuffer (run `data rawdemod --ar` before) - invert for Conditional Dephase Encoding (CDP) AKA Differential Manchester",
|
||||
"description": "help This help ----------- ------------------------- General------------------------- clear Clears various buffers used by the graph window hide Hide the graph window load Load contents of file into graph window num Converts dec/hex/bin plot Show the graph window print Print the data in the DemodBuffer save Save signal trace data setdebugmode Set Debugging Level on client side xor Xor a input string ----------- ------------------------- Modulation------------------------- biphaserawdecode Biphase decode bin stream in DemodBuffer detectclock Detect ASK, FSK, NRZ, PSK clock rate of wave in GraphBuffer fsktonrz Convert fsk2 to nrz wave for alternate fsk demodulating (for weak fsk) manrawdecode Manchester decode binary stream in DemodBuffer modulation Identify LF signal for clock and modulation rawdemod Demodulate the data in the GraphBuffer and output binary ----------- ------------------------- Graph------------------------- askedgedetect Adjust Graph for manual ASK demod autocorr Autocorrelation over window convertbitstream Convert GraphBuffer's 0/1 values to 127 / -127 cthreshold Average out all values between dirthreshold Max rising higher up-thres/ Min falling lower down-thres decimate Decimate samples envelope Generate square envelope of samples grid overlay grid on graph window getbitstream Convert GraphBuffer's >=1 values to 1 and <1 to 0 hpf Remove DC offset from trace iir Apply IIR buttersworth filter on plot data ltrim Trim samples from left of trace mtrim Trim out samples from the specified start to the specified stop norm Normalize max/min to +/-128 rtrim Trim samples from right of trace setgraphmarkers Set the markers in the graph window shiftgraphzero Shift 0 for Graphed wave + or - shift value timescale Set cursor display timescale undecimate Un-decimate samples zerocrossings Count time between zero-crossings ----------- ------------------------- Operations------------------------- asn1 ASN1 decoder atr ATR lookup bmap Convert hex value according a binary template crypto Encrypt and decrypt data diff Diff of input files --------------------------------------------------------------------------------------- data clear available offline: yes This function clears the BigBuf on device side and graph window ( graphbuffer )",
|
||||
"notes": [
|
||||
"data biphaserawdecode -> decode biphase bitstream from the DemodBuffer",
|
||||
"data biphaserawdecode -oi -> decode biphase bitstream from the DemodBuffer, adjust offset, and invert output"
|
||||
"data clear"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-o, --offset set to adjust decode start position",
|
||||
"-i, --inv invert output",
|
||||
"--err <dec> set max errors tolerated (def 20)"
|
||||
"-h, --help This help"
|
||||
],
|
||||
"usage": "data biphaserawdecode [-hoi] [--err <dec>]"
|
||||
},
|
||||
"data hex2bin": {
|
||||
"command": "data hex2bin",
|
||||
"description": "This function converts hexadecimal to binary. It will ignore all non-hexadecimal characters but stop reading on whitespace",
|
||||
"notes": [
|
||||
"data hex2bin -d 01020304"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-d, --data <hex> bytes to convert"
|
||||
],
|
||||
"usage": "data hex2bin [-h] [-d <hex>]"
|
||||
"usage": "data clear [-h]"
|
||||
},
|
||||
"data hexsamples": {
|
||||
"command": "data hexsamples",
|
||||
|
@ -735,18 +709,22 @@
|
|||
},
|
||||
"data setgraphmarkers": {
|
||||
"command": "data setgraphmarkers",
|
||||
"description": "Set blue and orange marker in graph window",
|
||||
"description": "Set the locations of the markers in the graph window",
|
||||
"notes": [
|
||||
"data setgraphmarkers -> turn off",
|
||||
"data setgraphmarkers -a 64 -b 50"
|
||||
"data setgraphmarkers -> reset the markers",
|
||||
"data setgraphmarkers -a 64 -> set A, reset the rest",
|
||||
"data setgraphmarkers -d --keep -> set D, keep the rest"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-a <dec> orange marker",
|
||||
"-b <dec> blue marker"
|
||||
"--keep keep the current values of the markers",
|
||||
"-a <dec> yellow marker",
|
||||
"-b <dec> pink marker",
|
||||
"-c <dec> orange marker",
|
||||
"-d <dec> blue marker"
|
||||
],
|
||||
"usage": "data setgraphmarkers [-h] [-a <dec>] [-b <dec>]"
|
||||
"usage": "data setgraphmarkers [-h] [--keep] [-a <dec>] [-b <dec>] [-c <dec>] [-d <dec>]"
|
||||
},
|
||||
"data shiftgraphzero": {
|
||||
"command": "data shiftgraphzero",
|
||||
|
@ -1621,14 +1599,16 @@
|
|||
"command": "hf 15 csetuid",
|
||||
"description": "Set UID for magic Chinese card (only works with such cards)",
|
||||
"notes": [
|
||||
"hf 15 csetuid -u E011223344556677"
|
||||
"hf 15 csetuid -u E011223344556677 -> use gen1 command",
|
||||
"hf 15 csetuid -u E011223344556677 --v2 -> use gen2 command"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-u, --uid <hex> UID, 8 hex bytes"
|
||||
"-u, --uid <hex> UID, 8 hex bytes",
|
||||
"-2, --v2 Use gen2 magic command"
|
||||
],
|
||||
"usage": "hf 15 csetuid [-h] -u <hex>"
|
||||
"usage": "hf 15 csetuid [-h2] -u <hex>"
|
||||
},
|
||||
"hf 15 demod": {
|
||||
"command": "hf 15 demod",
|
||||
|
@ -3329,7 +3309,7 @@
|
|||
},
|
||||
"hf iclass help": {
|
||||
"command": "hf iclass help",
|
||||
"description": "----------- --------------------- General --------------------- help This help list List iclass history view Display content from tag dump file ----------- --------------------- Recovery -------------------- loclass Use loclass to perform bruteforce reader attack lookup Uses authentication trace to check for key in dictionary file ----------- ---------------------- Utils ---------------------- calcnewkey Calc diversified keys (blocks 3 & 4) to write new keys encode Encode binary wiegand to block 7 encrypt Encrypt given block data decrypt Decrypt given block data or tag dump file managekeys Manage keys to use with iclass commands permutekey Permute function from 'heart of darkness' paper --------------------------------------------------------------------------------------- hf iclass list available offline: yes Alias of `trace list -t iclass -c` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"description": "help This help list List iclass history view Display content from tag dump file ----------- --------------------- Recovery -------------------- loclass Use loclass to perform bruteforce reader attack lookup Uses authentication trace to check for key in dictionary file ----------- ---------------------- Utils ---------------------- calcnewkey Calc diversified keys (blocks 3 & 4) to write new keys encode Encode binary wiegand to block 7 encrypt Encrypt given block data decrypt Decrypt given block data or tag dump file managekeys Manage keys to use with iclass commands permutekey Permute function from 'heart of darkness' paper --------------------------------------------------------------------------------------- hf iclass list available offline: yes Alias of `trace list -t iclass -c` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"notes": [
|
||||
"hf iclass list --frame -> show frame delay times",
|
||||
"hf iclass list -1 -> use trace buffer"
|
||||
|
@ -3372,14 +3352,14 @@
|
|||
"options": [
|
||||
"-h, --help This help",
|
||||
"-f, --file <fn> filename with nr/mac data from `hf iclass sim -t 2`",
|
||||
"--test Perform self-test",
|
||||
"--long Perform self-test, including long ones"
|
||||
"--test Perform self test",
|
||||
"--long Perform self test, including long ones"
|
||||
],
|
||||
"usage": "hf iclass loclass [-h] [-f <fn>] [--test] [--long]"
|
||||
},
|
||||
"hf iclass lookup": {
|
||||
"command": "hf iclass lookup",
|
||||
"description": "Lookup keys takes some sniffed trace data and tries to verify what key was used against a dictionary file",
|
||||
"description": "This command take sniffed trace data and try to recovery a iCLASS Standard or iCLASS Elite key.",
|
||||
"notes": [
|
||||
"hf iclass lookup --csn 9655a400f8ff12e0 --epurse f0ffffffffffffff --macs 0000000089cb984b -f iclass_default_keys.dic",
|
||||
"hf iclass lookup --csn 9655a400f8ff12e0 --epurse f0ffffffffffffff --macs 0000000089cb984b -f iclass_default_keys.dic --elite"
|
||||
|
@ -3670,7 +3650,7 @@
|
|||
"-h, --help This help",
|
||||
"-u, --uid <hex> uid bytes",
|
||||
"-r read uid from tag instead",
|
||||
"-t selftest",
|
||||
"-t self test",
|
||||
"-v, --verbose verbose output",
|
||||
"--dragon figurine type",
|
||||
"--fox figurine type",
|
||||
|
@ -8219,11 +8199,12 @@
|
|||
],
|
||||
"usage": "lf awid clone [-h] --fmt <dec> --fc <dec> --cn <dec> [--q5] [--em]"
|
||||
},
|
||||
"lf awid help": {
|
||||
"command": "lf awid help",
|
||||
"description": "help this help demod demodulate an AWID FSK tag from the GraphBuffer --------------------------------------------------------------------------------------- lf awid demod available offline: yes Try to find AWID Prox preamble, if found decode / descramble data",
|
||||
"lf awid demod": {
|
||||
"command": "lf awid demod",
|
||||
"description": "Try to find AWID Prox preamble, if found decode / descramble data",
|
||||
"notes": [
|
||||
"lf awid demod"
|
||||
"lf awid demod",
|
||||
"lf awid demod --raw"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
|
@ -8231,6 +8212,25 @@
|
|||
],
|
||||
"usage": "lf awid demod [-h]"
|
||||
},
|
||||
"lf awid help": {
|
||||
"command": "lf awid help",
|
||||
"description": "help this help demod demodulate an AWID FSK tag from the GraphBuffer --------------------------------------------------------------------------------------- lf awid brute available offline: no Enables bruteforce of AWID reader with specified facility-code. This is a attack against reader. if cardnumber is given, it starts with it and goes up / down one step if cardnumber is not given, it starts with 1 and goes up to 65535",
|
||||
"notes": [
|
||||
"lf awid brute --fmt 26 --fc 224",
|
||||
"lf awid brute --fmt 50 --fc 2001 --delay 2000",
|
||||
"lf awid brute --fmt 50 --fc 2001 --cn 200 --delay 2000 -v"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"--fmt <dec> format length 26|50",
|
||||
"--fc <dec> 8|16bit value facility code",
|
||||
"--cn <dec> optional - card number to start with, max 65535",
|
||||
"--delay <dec> optional - delay betweens attempts in ms. Default 1000ms",
|
||||
"-v, --verbose verbose output"
|
||||
],
|
||||
"usage": "lf awid brute [-hv] --fmt <dec> --fc <dec> [--cn <dec>] [--delay <dec>]"
|
||||
},
|
||||
"lf awid reader": {
|
||||
"command": "lf awid reader",
|
||||
"description": "read a AWID Prox tag",
|
||||
|
@ -9426,20 +9426,32 @@
|
|||
],
|
||||
"usage": "lf hitag cc [-h] -f <fn>"
|
||||
},
|
||||
"lf hitag chk": {
|
||||
"command": "lf hitag chk",
|
||||
"description": "Run dictionary key or password recovery against Hitag card.",
|
||||
"notes": [
|
||||
"lf hitag chk",
|
||||
"-> checks for both pwd / crypto keyslf hitag chk --crypto -> use def dictionary",
|
||||
"lf hitag chk --pwd -f my.dic -> pwd mode, custom dictionary"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-f, --file <fn> specify dictionary filename",
|
||||
"--pwd password mode",
|
||||
"--crypto crypto mode"
|
||||
],
|
||||
"usage": "lf hitag chk [-h] [-f <fn>] [--pwd] [--crypto]"
|
||||
},
|
||||
"lf hitag dump": {
|
||||
"command": "lf hitag dump",
|
||||
"description": "Read all Hitag 2 card memory and save to file Crypto mode key format: ISK high + ISK low",
|
||||
"description": "Read all Hitag 2 card memory and save to file Crypto mode key format: ISK high + ISK low, 4F4E4D494B52 (ONMIKR) Password mode, default key 4D494B52 (MIKR)",
|
||||
"notes": [
|
||||
"Password mode => use default key 4D494B52 (MIKR)",
|
||||
"lf hitag dump --pwd",
|
||||
"Short key = password mode",
|
||||
"lf hitag dump -k 4D494B52",
|
||||
"Challenge mode",
|
||||
"lf hitag dump --nrar 0102030411223344",
|
||||
"Crypto mode => use default key 4F4E4D494B52 (ONMIKR)",
|
||||
"lf hitag dump --crypto",
|
||||
"Long key = crypto mode",
|
||||
"lf hitag dump -k 4F4E4D494B52"
|
||||
"lf hitag dump --pwd -> use def pwd",
|
||||
"lf hitag dump -k 4D494B52 -> pwd mode",
|
||||
"lf hitag dump --crypto -> use def crypto",
|
||||
"lf hitag dump -k 4F4E4D494B52 -> crypto mode",
|
||||
"lf hitag dump --nrar 0102030411223344"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
|
@ -9485,7 +9497,7 @@
|
|||
},
|
||||
"lf hitag help": {
|
||||
"command": "lf hitag help",
|
||||
"description": "help This help list List Hitag trace history view Display content from tag dump file --------------------------------------------------------------------------------------- lf hitag list available offline: yes Alias of `trace list -t hitag2` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"description": "help This help list List Hitag trace history selftest Perform self test view Display content from tag dump file lookup Uses authentication trace to check for key in dictionary file --------------------------------------------------------------------------------------- lf hitag list available offline: yes Alias of `trace list -t hitag2` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||
"notes": [
|
||||
"lf hitag list --frame -> show frame delay times",
|
||||
"lf hitag list -1 -> use trace buffer"
|
||||
|
@ -9516,29 +9528,41 @@
|
|||
],
|
||||
"usage": "lf hitag info [-h]"
|
||||
},
|
||||
"lf hitag lookup": {
|
||||
"command": "lf hitag lookup",
|
||||
"description": "This command take sniffed trace data and try to recovery a Hitag2 crypto key. You can either - verify that NR/AR matches a known crypto key - verify if NR/AR matches a known 6 byte crypto key in a dictionary",
|
||||
"notes": [
|
||||
"lf hitag lookup --uid 11223344 --nr 73AA5A62 --ar EAB8529C -k 010203040506 -> check key",
|
||||
"lf hitag lookup --uid 11223344 --nr 73AA5A62 --ar EAB8529C -> use def dictionary",
|
||||
"lf hitag lookup --uid 11223344 --nr 73AA5A62 --ar EAB8529C -f my.dic -> use custom dictionary",
|
||||
"lf hitag lookup --uid 11223344 --nrar 73AA5A62EAB8529C"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-f, --file <fn> specify dictionary filename",
|
||||
"-k, --key <hex> specify known cryptokey as 6 bytes",
|
||||
"-u, --uid <hex> specify UID as 4 hex bytes",
|
||||
"--nr <hex> specify nonce as 4 hex bytes",
|
||||
"--ar <hex> specify answer as 4 hex bytes",
|
||||
"--nrar <hex> specify nonce / answer as 8 hex bytes"
|
||||
],
|
||||
"usage": "lf hitag lookup [-h] [-f <fn>] [-k <hex>] -u <hex> [--nr <hex>] [--ar <hex>] [--nrar <hex>]"
|
||||
},
|
||||
"lf hitag read": {
|
||||
"command": "lf hitag read",
|
||||
"description": "Read Hitag memory Crypto mode key format: ISK high + ISK low",
|
||||
"description": "Read Hitag memory. It support HitagS and Hitag 2 Password mode: - default key 4D494B52 (MIKR) Crypto mode: - key format ISK high + ISK low - default key 4F4E4D494B52 (ONMIKR)",
|
||||
"notes": [
|
||||
"Hitag S, plain mode",
|
||||
"lf hitag read --hts",
|
||||
"Hitag S, challenge mode",
|
||||
"lf hitag read --hts --nrar 0102030411223344",
|
||||
"Hitag S, crypto mode => use default key 4F4E4D494B52 (ONMIKR)",
|
||||
"lf hitag read --hts --crypto",
|
||||
"Hitag S, long key = crypto mode",
|
||||
"lf hitag read --hts -k 4F4E4D494B52",
|
||||
"lf hitag read --hts -> HitagS, plain mode",
|
||||
"lf hitag read --hts --nrar 0102030411223344 -> HitagS, challenge mode",
|
||||
"lf hitag read --hts --crypto -> HitagS, crypto mode, def key",
|
||||
"lf hitag read --hts -k 4F4E4D494B52 -> HitagS, crypto mode",
|
||||
"",
|
||||
"Hitag 2, password mode => use default key 4D494B52 (MIKR)",
|
||||
"lf hitag read --ht2 --pwd",
|
||||
"Hitag 2, providing a short key = password mode",
|
||||
"lf hitag read --ht2 -k 4D494B52",
|
||||
"Hitag 2, challenge mode",
|
||||
"lf hitag read --ht2 --nrar 0102030411223344",
|
||||
"Hitag 2, crypto mode => use default key 4F4E4D494B52 (ONMIKR)",
|
||||
"lf hitag read --ht2 --crypto",
|
||||
"Hitag 2, providing a long key = crypto mode",
|
||||
"lf hitag read --ht2 -k 4F4E4D494B52"
|
||||
"lf hitag read --ht2 --pwd -> Hitag 2, pwd mode, def key",
|
||||
"lf hitag read --ht2 -k 4D494B52 -> Hitag 2, pwd mode",
|
||||
"lf hitag read --ht2 --nrar 0102030411223344 -> Hitag 2, challenge mode",
|
||||
"lf hitag read --ht2 --crypto -> Hitag 2, crypto mode, def key",
|
||||
"lf hitag read --ht2 -k 4F4E4D494B52 -> Hitag 2, crypto mode"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
|
@ -9552,6 +9576,18 @@
|
|||
],
|
||||
"usage": "lf hitag read [-hs2] [--pwd] [--nrar <hex>] [--crypto] [-k <hex>]"
|
||||
},
|
||||
"lf hitag selftest": {
|
||||
"command": "lf hitag selftest",
|
||||
"description": "Perform selftest of Hitag crypto engine",
|
||||
"notes": [
|
||||
"lf hitag selftest"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help"
|
||||
],
|
||||
"usage": "lf hitag selftest [-h]"
|
||||
},
|
||||
"lf hitag sim": {
|
||||
"command": "lf hitag sim",
|
||||
"description": "Simulate Hitag transponder You need to `lf hitag eload` first",
|
||||
|
@ -9595,27 +9631,18 @@
|
|||
},
|
||||
"lf hitag wrbl": {
|
||||
"command": "lf hitag wrbl",
|
||||
"description": "Write a page in Hitag memory Crypto mode key format: ISK high + ISK low",
|
||||
"description": "Write a page in Hitag memory. It support HitagS and Hitag 2 Password mode: - default key 4D494B52 (MIKR) Crypto mode: - key format ISK high + ISK low - default key 4F4E4D494B52 (ONMIKR)",
|
||||
"notes": [
|
||||
"Hitag S, plain mode",
|
||||
"lf hitag wrbl --hts -p 6 -d 01020304",
|
||||
"Hitag S, challenge mode",
|
||||
"lf hitag wrbl --hts --nrar 0102030411223344 -p 6 -d 01020304",
|
||||
"Hitag S, crypto mode => use default key 4F4E4D494B52 (ONMIKR)",
|
||||
"lf hitag wrbl --hts --crypto -p 6 -d 01020304",
|
||||
"Hitag S, long key = crypto mode",
|
||||
"lf hitag wrbl --hts -k 4F4E4D494B52 -p 6 -d 01020304",
|
||||
"lf hitag wrbl --hts -p 6 -d 01020304 -> HitagS, plain mode",
|
||||
"lf hitag wrbl --hts -p 6 -d 01020304 --nrar 0102030411223344 -> HitagS, challenge mode",
|
||||
"lf hitag wrbl --hts -p 6 -d 01020304 --crypto -> HitagS, crypto mode, def key",
|
||||
"lf hitag wrbl --hts -p 6 -d 01020304 -k 4F4E4D494B52 -> HitagS, crypto mode",
|
||||
"",
|
||||
"Hitag 2, password mode => use default key 4D494B52 (MIKR)",
|
||||
"lf hitag wrbl --ht2 --pwd -p 6 -d 01020304",
|
||||
"Hitag 2, providing a short key = password mode",
|
||||
"lf hitag wrbl --ht2 -k 4D494B52 -p 6 -d 01020304",
|
||||
"Hitag 2, challenge mode",
|
||||
"lf hitag wrbl --ht2 --nrar 0102030411223344 -p 6 -d 01020304",
|
||||
"Hitag 2, crypto mode => use default key 4F4E4D494B52 (ONMIKR)",
|
||||
"lf hitag wrbl --ht2 --crypto -p 6 -d 01020304",
|
||||
"Hitag 2, providing a long key = crypto mode",
|
||||
"lf hitag wrbl --ht2 -k 4F4E4D494B52 -p 6 -d 01020304"
|
||||
"lf hitag wrbl --ht2 -p 6 -d 01020304 --pwd -> Hitag 2, pwd mode, def key",
|
||||
"lf hitag wrbl --ht2 -p 6 -d 01020304 -k 4D494B52 -> Hitag 2, pwd mode",
|
||||
"lf hitag wrbl --ht2 -p 6 -d 01020304 --nrar 0102030411223344 -> Hitag 2, challenge mode",
|
||||
"lf hitag wrbl --ht2 -p 6 -d 01020304 --crypto -> Hitag 2, crypto mode, def key",
|
||||
"lf hitag wrbl --ht2 -p 6 -d 01020304 -k 4F4E4D494B52 -> Hitag 2, crypto mode"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
|
@ -12595,8 +12622,8 @@
|
|||
}
|
||||
},
|
||||
"metadata": {
|
||||
"commands_extracted": 727,
|
||||
"commands_extracted": 729,
|
||||
"extracted_by": "PM3Help2JSON v1.00",
|
||||
"extracted_on": "2024-04-07T09:37:51"
|
||||
"extracted_on": "2024-04-22T14:35:02"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,6 +94,15 @@ Check column "offline" for their availability.
|
|||
|command |offline |description
|
||||
|------- |------- |-----------
|
||||
|`data help `|Y |`This help`
|
||||
|`data clear `|Y |`Clears various buffers used by the graph window`
|
||||
|`data hide `|Y |`Hide the graph window`
|
||||
|`data load `|Y |`Load contents of file into graph window`
|
||||
|`data num `|Y |`Converts dec/hex/bin`
|
||||
|`data plot `|Y |`Show the graph window`
|
||||
|`data print `|Y |`Print the data in the DemodBuffer`
|
||||
|`data save `|Y |`Save signal trace data`
|
||||
|`data setdebugmode `|Y |`Set Debugging Level on client side`
|
||||
|`data xor `|Y |`Xor a input string`
|
||||
|`data biphaserawdecode `|Y |`Biphase decode bin stream in DemodBuffer`
|
||||
|`data detectclock `|Y |`Detect ASK, FSK, NRZ, PSK clock rate of wave in GraphBuffer`
|
||||
|`data fsktonrz `|Y |`Convert fsk2 to nrz wave for alternate fsk demodulating (for weak fsk)`
|
||||
|
@ -102,43 +111,32 @@ Check column "offline" for their availability.
|
|||
|`data rawdemod `|Y |`Demodulate the data in the GraphBuffer and output binary`
|
||||
|`data askedgedetect `|Y |`Adjust Graph for manual ASK demod`
|
||||
|`data autocorr `|Y |`Autocorrelation over window`
|
||||
|`data convertbitstream `|Y |`Convert GraphBuffer's 0/1 values to 127 / -127`
|
||||
|`data cthreshold `|Y |`Average out all values between`
|
||||
|`data dirthreshold `|Y |`Max rising higher up-thres/ Min falling lower down-thres`
|
||||
|`data decimate `|Y |`Decimate samples`
|
||||
|`data envelope `|Y |`Generate square envelope of samples`
|
||||
|`data undecimate `|Y |`Un-decimate samples`
|
||||
|`data hide `|Y |`Hide graph window`
|
||||
|`data grid `|Y |`overlay grid on graph window`
|
||||
|`data getbitstream `|Y |`Convert GraphBuffer's >=1 values to 1 and <1 to 0`
|
||||
|`data hpf `|Y |`Remove DC offset from trace`
|
||||
|`data iir `|Y |`Apply IIR buttersworth filter on plot data`
|
||||
|`data grid `|Y |`overlay grid on graph window`
|
||||
|`data ltrim `|Y |`Trim samples from left of trace`
|
||||
|`data mtrim `|Y |`Trim out samples from the specified start to the specified stop`
|
||||
|`data norm `|Y |`Normalize max/min to +/-128`
|
||||
|`data plot `|Y |`Show graph window`
|
||||
|`data cthreshold `|Y |`Average out all values between`
|
||||
|`data rtrim `|Y |`Trim samples from right of trace`
|
||||
|`data setgraphmarkers `|Y |`Set blue and orange marker in graph window`
|
||||
|`data setgraphmarkers `|Y |`Set the markers in the graph window`
|
||||
|`data shiftgraphzero `|Y |`Shift 0 for Graphed wave + or - shift value`
|
||||
|`data timescale `|Y |`Set cursor display timescale`
|
||||
|`data undecimate `|Y |`Un-decimate samples`
|
||||
|`data zerocrossings `|Y |`Count time between zero-crossings`
|
||||
|`data convertbitstream `|Y |`Convert GraphBuffer's 0/1 values to 127 / -127`
|
||||
|`data getbitstream `|Y |`Convert GraphBuffer's >=1 values to 1 and <1 to 0`
|
||||
|`data asn1 `|Y |`ASN1 decoder`
|
||||
|`data atr `|Y |`ATR lookup`
|
||||
|`data bin2hex `|Y |`Converts binary to hexadecimal`
|
||||
|`data bitsamples `|N |`Get raw samples as bitstring`
|
||||
|`data bmap `|Y |`Convert hex value according a binary template`
|
||||
|`data clear `|Y |`Clears bigbuf on deviceside and graph window`
|
||||
|`data crypto `|Y |`Encrypt and decrypt data`
|
||||
|`data diff `|Y |`Diff of input files`
|
||||
|`data hexsamples `|N |`Dump big buffer as hex bytes`
|
||||
|`data hex2bin `|Y |`Converts hexadecimal to binary`
|
||||
|`data load `|Y |`Load contents of file into graph window`
|
||||
|`data num `|Y |`Converts dec/hex/bin`
|
||||
|`data print `|Y |`Print the data in the DemodBuffer`
|
||||
|`data samples `|N |`Get raw samples for graph window ( GraphBuffer )`
|
||||
|`data save `|Y |`Save signal trace data ( GraphBuffer )`
|
||||
|`data setdebugmode `|Y |`Set Debugging Level on client side`
|
||||
|`data xor `|Y |`Xor a input string`
|
||||
|
||||
|
||||
### emv
|
||||
|
@ -857,9 +855,10 @@ Check column "offline" for their availability.
|
|||
|command |offline |description
|
||||
|------- |------- |-----------
|
||||
|`lf awid help `|Y |`this help`
|
||||
|`lf awid brute `|N |`bruteforce card number against reader`
|
||||
|`lf awid clone `|N |`clone AWID tag to T55x7, Q5/T5555 or EM4305/4469`
|
||||
|`lf awid demod `|Y |`demodulate an AWID FSK tag from the GraphBuffer`
|
||||
|`lf awid reader `|N |`attempt to read and extract tag data`
|
||||
|`lf awid clone `|N |`clone AWID tag to T55x7, Q5/T5555 or EM4305/4469`
|
||||
|`lf awid sim `|N |`simulate AWID tag`
|
||||
|`lf awid brute `|N |`bruteforce card number against reader`
|
||||
|`lf awid watch `|N |`continuously watch for cards. Reader mode`
|
||||
|
@ -923,7 +922,7 @@ Check column "offline" for their availability.
|
|||
|`lf em 4x05 help `|Y |`This help`
|
||||
|`lf em 4x05 clonehelp `|N |`Shows the available clone commands`
|
||||
|`lf em 4x05 brute `|N |`Bruteforce password`
|
||||
|`lf em 4x05 chk `|N |`Check passwords from dictionary`
|
||||
|`lf em 4x05 chk `|N |`Check passwords`
|
||||
|`lf em 4x05 config `|Y |`Create common configuration words`
|
||||
|`lf em 4x05 demod `|Y |`Demodulate a EM4x05/EM4x69 tag from the GraphBuffer`
|
||||
|`lf em 4x05 dump `|N |`Dump EM4x05/EM4x69 tag`
|
||||
|
@ -944,7 +943,7 @@ Check column "offline" for their availability.
|
|||
|------- |------- |-----------
|
||||
|`lf em 4x50 help `|Y |`This help`
|
||||
|`lf em 4x50 brute `|N |`Bruteforce attack to find password`
|
||||
|`lf em 4x50 chk `|N |`Check passwords from dictionary`
|
||||
|`lf em 4x50 chk `|N |`Check passwords`
|
||||
|`lf em 4x50 dump `|N |`Dump EM4x50 tag`
|
||||
|`lf em 4x50 info `|N |`Tag information`
|
||||
|`lf em 4x50 login `|N |`Login into EM4x50 tag`
|
||||
|
@ -1042,16 +1041,19 @@ Check column "offline" for their availability.
|
|||
|`lf hitag help `|Y |`This help`
|
||||
|`lf hitag list `|Y |`List Hitag trace history`
|
||||
|`lf hitag info `|N |`Hitag 2 tag information`
|
||||
|`lf hitag selftest `|Y |`Perform self test`
|
||||
|`lf hitag dump `|N |`Dump Hitag 2 tag`
|
||||
|`lf hitag read `|N |`Read Hitag memory`
|
||||
|`lf hitag sniff `|N |`Eavesdrop Hitag communication`
|
||||
|`lf hitag view `|Y |`Display content from tag dump file`
|
||||
|`lf hitag wrbl `|N |`Write a block (page) in Hitag memory`
|
||||
|`lf hitag sniff `|N |`Eavesdrop Hitag communication`
|
||||
|`lf hitag cc `|N |`Hitag S: test all provided challenges`
|
||||
|`lf hitag ta `|N |`Hitag 2: test all recorded authentications`
|
||||
|`lf hitag eload `|N |`Upload file into emulator memory`
|
||||
|`lf hitag eview `|N |`View emulator memory`
|
||||
|`lf hitag sim `|N |`Simulate Hitag transponder`
|
||||
|`lf hitag cc `|N |`Hitag S: test all provided challenges`
|
||||
|`lf hitag chk `|N |`Check keys`
|
||||
|`lf hitag lookup `|Y |`Uses authentication trace to check for key in dictionary file`
|
||||
|`lf hitag ta `|N |`Hitag 2: test all recorded authentications`
|
||||
|
||||
|
||||
### lf idteck
|
||||
|
@ -1285,7 +1287,7 @@ Check column "offline" for their availability.
|
|||
|`lf t55xx wakeup `|N |`Send AOR wakeup command`
|
||||
|`lf t55xx write `|N |`Write T55xx block data`
|
||||
|`lf t55xx bruteforce `|N |`Simple bruteforce attack to find password`
|
||||
|`lf t55xx chk `|N |`Check passwords from dictionary/flash`
|
||||
|`lf t55xx chk `|N |`Check passwords`
|
||||
|`lf t55xx protect `|N |`Password protect tag`
|
||||
|`lf t55xx recoverpw `|N |`Try to recover from bad password write from a cloner`
|
||||
|`lf t55xx sniff `|Y |`Attempt to recover T55xx commands from sample buffer`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue