mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
#makestyleday
This commit is contained in:
parent
6ee3a5fa10
commit
7cd80611d3
30 changed files with 381 additions and 381 deletions
|
@ -37,11 +37,11 @@
|
|||
#define EM4X50_T_TAG_WAITING_FOR_SIGNAL 75
|
||||
#define EM4X50_T_WAITING_FOR_DBLLIW 1550
|
||||
#define EM4X50_T_WAITING_FOR_SNGLLIW 140 // this value seems to be
|
||||
// critical;
|
||||
// if it's too low
|
||||
// (e.g. < 120) some cards
|
||||
// are no longer readable
|
||||
// although they're ok
|
||||
// critical;
|
||||
// if it's too low
|
||||
// (e.g. < 120) some cards
|
||||
// are no longer readable
|
||||
// although they're ok
|
||||
|
||||
#define EM4X50_TAG_TOLERANCE 8
|
||||
#define EM4X50_TAG_WORD 45
|
||||
|
|
|
@ -70,7 +70,7 @@ static int em4x70_receive(uint8_t *bits);
|
|||
static bool find_listen_window(bool command);
|
||||
|
||||
static void init_tag(void) {
|
||||
memset(tag.data, 0x00, sizeof(tag.data)/sizeof(tag.data[0]));
|
||||
memset(tag.data, 0x00, sizeof(tag.data) / sizeof(tag.data[0]));
|
||||
}
|
||||
|
||||
static void EM4170_setup_read(void) {
|
||||
|
@ -158,7 +158,7 @@ static bool get_signalproperties(void) {
|
|||
gLow = sample_ref - pct * (sample_max_mean - sample_ref) / 100;
|
||||
|
||||
// Basic sanity check
|
||||
if(gHigh - gLow < EM4X70_MIN_AMPLITUDE) {
|
||||
if (gHigh - gLow < EM4X70_MIN_AMPLITUDE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ static uint32_t get_pulse_length(void) {
|
|||
|
||||
do {
|
||||
sample = (uint8_t)AT91C_BASE_SSC->SSC_RHR;
|
||||
}while (IS_HIGH(sample) && !IS_TIMEOUT(timeout));
|
||||
} while (IS_HIGH(sample) && !IS_TIMEOUT(timeout));
|
||||
|
||||
if (IS_TIMEOUT(timeout))
|
||||
return 0;
|
||||
|
@ -188,7 +188,7 @@ static uint32_t get_pulse_length(void) {
|
|||
|
||||
do {
|
||||
sample = (uint8_t)AT91C_BASE_SSC->SSC_RHR;
|
||||
}while (IS_LOW(sample) && !IS_TIMEOUT(timeout));
|
||||
} while (IS_LOW(sample) && !IS_TIMEOUT(timeout));
|
||||
|
||||
if (IS_TIMEOUT(timeout))
|
||||
return 0;
|
||||
|
@ -196,7 +196,7 @@ static uint32_t get_pulse_length(void) {
|
|||
timeout = (TICKS_PER_FC * 3 * EM4X70_T_TAG_FULL_PERIOD) + GetTicks();
|
||||
do {
|
||||
sample = (uint8_t)AT91C_BASE_SSC->SSC_RHR;
|
||||
}while (IS_HIGH(sample) && !IS_TIMEOUT(timeout));
|
||||
} while (IS_HIGH(sample) && !IS_TIMEOUT(timeout));
|
||||
|
||||
if (IS_TIMEOUT(timeout))
|
||||
return 0;
|
||||
|
@ -217,7 +217,7 @@ static uint32_t get_pulse_invert_length(void) {
|
|||
|
||||
do {
|
||||
sample = (uint8_t)AT91C_BASE_SSC->SSC_RHR;
|
||||
}while (IS_LOW(sample) && !IS_TIMEOUT(timeout));
|
||||
} while (IS_LOW(sample) && !IS_TIMEOUT(timeout));
|
||||
|
||||
if (IS_TIMEOUT(timeout))
|
||||
return 0;
|
||||
|
@ -227,7 +227,7 @@ static uint32_t get_pulse_invert_length(void) {
|
|||
|
||||
do {
|
||||
sample = (uint8_t)AT91C_BASE_SSC->SSC_RHR;
|
||||
}while (IS_HIGH(sample) && !IS_TIMEOUT(timeout));
|
||||
} while (IS_HIGH(sample) && !IS_TIMEOUT(timeout));
|
||||
|
||||
if (IS_TIMEOUT(timeout))
|
||||
return 0;
|
||||
|
@ -235,7 +235,7 @@ static uint32_t get_pulse_invert_length(void) {
|
|||
timeout = GetTicks() + (TICKS_PER_FC * 3 * EM4X70_T_TAG_FULL_PERIOD);
|
||||
do {
|
||||
sample = (uint8_t)AT91C_BASE_SSC->SSC_RHR;
|
||||
}while (IS_LOW(sample) && !IS_TIMEOUT(timeout));
|
||||
} while (IS_LOW(sample) && !IS_TIMEOUT(timeout));
|
||||
|
||||
if (IS_TIMEOUT(timeout))
|
||||
return 0;
|
||||
|
@ -289,7 +289,7 @@ static void em4x70_send_nibble(uint8_t nibble, bool with_parity) {
|
|||
|
||||
// Non automotive EM4x70 based tags are 3 bits + 1 parity.
|
||||
// So drop the MSB and send a parity bit instead after the command
|
||||
if(command_parity)
|
||||
if (command_parity)
|
||||
msb_bit = 1;
|
||||
|
||||
for (int i = msb_bit; i < 4; i++) {
|
||||
|
@ -298,7 +298,7 @@ static void em4x70_send_nibble(uint8_t nibble, bool with_parity) {
|
|||
parity ^= bit;
|
||||
}
|
||||
|
||||
if(with_parity)
|
||||
if (with_parity)
|
||||
em4x70_send_bit(parity);
|
||||
}
|
||||
|
||||
|
@ -313,8 +313,8 @@ static void em4x70_send_word(const uint16_t word) {
|
|||
// Split into nibbles
|
||||
uint8_t nibbles[4];
|
||||
uint8_t j = 0;
|
||||
for(int i = 0; i < 2; i++) {
|
||||
uint8_t byte = (word >> (8*i)) & 0xff;
|
||||
for (int i = 0; i < 2; i++) {
|
||||
uint8_t byte = (word >> (8 * i)) & 0xff;
|
||||
nibbles[j++] = (byte >> 4) & 0xf;
|
||||
nibbles[j++] = byte & 0xf;
|
||||
}
|
||||
|
@ -369,13 +369,13 @@ static int send_pin(const uint32_t pin) {
|
|||
em4x70_send_nibble(EM4X70_COMMAND_PIN, true);
|
||||
|
||||
// --> Send TAG ID (bytes 4-7)
|
||||
for(int i=0; i < 4; i++) {
|
||||
em4x70_send_byte(tag.data[7-i]);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
em4x70_send_byte(tag.data[7 - i]);
|
||||
}
|
||||
|
||||
// --> Send PIN
|
||||
for(int i=0; i < 4 ; i++) {
|
||||
em4x70_send_byte((pin>>(i*8)) & 0xff);
|
||||
for (int i = 0; i < 4 ; i++) {
|
||||
em4x70_send_byte((pin >> (i * 8)) & 0xff);
|
||||
}
|
||||
|
||||
// Wait TWALB (write access lock bits)
|
||||
|
@ -389,7 +389,7 @@ static int send_pin(const uint32_t pin) {
|
|||
// <-- Receive header + ID
|
||||
uint8_t tag_id[64];
|
||||
int num = em4x70_receive(tag_id);
|
||||
if(num < 32) {
|
||||
if (num < 32) {
|
||||
Dbprintf("Invalid ID Received");
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
@ -437,7 +437,7 @@ static int write(const uint16_t word, const uint8_t address) {
|
|||
static bool find_listen_window(bool command) {
|
||||
|
||||
int cnt = 0;
|
||||
while(cnt < EM4X70_T_WAITING_FOR_SNGLLIW) {
|
||||
while (cnt < EM4X70_T_WAITING_FOR_SNGLLIW) {
|
||||
/*
|
||||
80 ( 64 + 16 )
|
||||
80 ( 64 + 16 )
|
||||
|
@ -445,13 +445,12 @@ static bool find_listen_window(bool command) {
|
|||
96 ( 64 + 32 )
|
||||
64 ( 32 + 16 +16 )*/
|
||||
|
||||
if ( check_pulse_length(get_pulse_invert_length(), 80) &&
|
||||
if (check_pulse_length(get_pulse_invert_length(), 80) &&
|
||||
check_pulse_length(get_pulse_invert_length(), 80) &&
|
||||
check_pulse_length(get_pulse_length(), 96) &&
|
||||
check_pulse_length(get_pulse_length(), 64) )
|
||||
{
|
||||
check_pulse_length(get_pulse_length(), 64)) {
|
||||
|
||||
if(command) {
|
||||
if (command) {
|
||||
/* Here we are after the 64 duration edge.
|
||||
* em4170 says we need to wait about 48 RF clock cycles.
|
||||
* depends on the delay between tag and us
|
||||
|
@ -473,14 +472,14 @@ static bool find_listen_window(bool command) {
|
|||
|
||||
static void bits2bytes(const uint8_t *bits, int length, uint8_t *out) {
|
||||
|
||||
if(length%8 != 0) {
|
||||
if (length % 8 != 0) {
|
||||
Dbprintf("Should have a multiple of 8 bits, was sent %d", length);
|
||||
}
|
||||
|
||||
int num_bytes = length / 8; // We should have a multiple of 8 here
|
||||
|
||||
for(int i=1; i <= num_bytes; i++) {
|
||||
out[num_bytes-i] = bits2byte(bits, 8);
|
||||
for (int i = 1; i <= num_bytes; i++) {
|
||||
out[num_bytes - i] = bits2byte(bits, 8);
|
||||
bits += 8;
|
||||
}
|
||||
}
|
||||
|
@ -503,14 +502,14 @@ static uint8_t bits2byte(const uint8_t *bits, int length) {
|
|||
static bool send_command_and_read(uint8_t command, uint8_t resp_len_bits, uint8_t *out_bytes) {
|
||||
|
||||
int retries = EM4X70_COMMAND_RETRIES;
|
||||
while(retries) {
|
||||
while (retries) {
|
||||
retries--;
|
||||
|
||||
if(find_listen_window(true)) {
|
||||
if (find_listen_window(true)) {
|
||||
uint8_t bits[EM4X70_MAX_RECEIVE_LENGTH] = {0};
|
||||
em4x70_send_nibble(command, command_parity);
|
||||
int len = em4x70_receive(bits);
|
||||
if(len < resp_len_bits) {
|
||||
if (len < resp_len_bits) {
|
||||
Dbprintf("Invalid data received length: %d", len);
|
||||
return false;
|
||||
}
|
||||
|
@ -579,22 +578,22 @@ static int em4x70_receive(uint8_t *bits) {
|
|||
|
||||
// wait until we get the transition from 1's to 0's which is 1.5 full windows
|
||||
int pulse_count = 0;
|
||||
while(pulse_count < 12){
|
||||
while (pulse_count < 12) {
|
||||
pl = get_pulse_invert_length();
|
||||
pulse_count++;
|
||||
if(check_pulse_length(pl, 3 * EM4X70_T_TAG_HALF_PERIOD)) {
|
||||
if (check_pulse_length(pl, 3 * EM4X70_T_TAG_HALF_PERIOD)) {
|
||||
foundheader = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!foundheader) {
|
||||
if (!foundheader) {
|
||||
Dbprintf("Failed to find read header");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Skip next 3 0's, header check consumes the first 0
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
get_pulse_invert_length();
|
||||
}
|
||||
|
||||
|
@ -602,7 +601,7 @@ static int em4x70_receive(uint8_t *bits) {
|
|||
// between two listen windows only pulse lengths of 1, 1.5 and 2 are possible
|
||||
while (bit_pos < EM4X70_MAX_RECEIVE_LENGTH) {
|
||||
|
||||
if(edge)
|
||||
if (edge)
|
||||
pl = get_pulse_length();
|
||||
else
|
||||
pl = get_pulse_invert_length();
|
||||
|
@ -615,7 +614,7 @@ static int em4x70_receive(uint8_t *bits) {
|
|||
} else if (check_pulse_length(pl, 3 * EM4X70_T_TAG_HALF_PERIOD)) {
|
||||
|
||||
// pulse length = 1.5 -> flip edge detection
|
||||
if(edge) {
|
||||
if (edge) {
|
||||
bits[bit_pos++] = 0;
|
||||
bits[bit_pos++] = 0;
|
||||
edge = 0;
|
||||
|
@ -628,7 +627,7 @@ static int em4x70_receive(uint8_t *bits) {
|
|||
} else if (check_pulse_length(pl, 2 * EM4X70_T_TAG_FULL_PERIOD)) {
|
||||
|
||||
// pulse length of 2
|
||||
if(edge) {
|
||||
if (edge) {
|
||||
bits[bit_pos++] = 0;
|
||||
bits[bit_pos++] = 1;
|
||||
} else {
|
||||
|
@ -636,7 +635,7 @@ static int em4x70_receive(uint8_t *bits) {
|
|||
bits[bit_pos++] = 0;
|
||||
}
|
||||
|
||||
} else if ( (edge && check_pulse_length(pl, 3 * EM4X70_T_TAG_FULL_PERIOD)) ||
|
||||
} else if ((edge && check_pulse_length(pl, 3 * EM4X70_T_TAG_FULL_PERIOD)) ||
|
||||
(!edge && check_pulse_length(pl, 80))) {
|
||||
|
||||
// LIW detected (either invert or normal)
|
||||
|
@ -684,7 +683,7 @@ void em4x70_write(em4x70_data_t *etd) {
|
|||
// Write
|
||||
status = write(etd->word, etd->address) == PM3_SUCCESS;
|
||||
|
||||
if(status) {
|
||||
if (status) {
|
||||
// Read Tag after writing
|
||||
em4x70_read_id();
|
||||
em4x70_read_um1();
|
||||
|
@ -711,13 +710,13 @@ void em4x70_unlock(em4x70_data_t *etd) {
|
|||
if (get_signalproperties() && find_EM4X70_Tag()) {
|
||||
|
||||
// Read ID (required for send_pin command)
|
||||
if(em4x70_read_id()) {
|
||||
if (em4x70_read_id()) {
|
||||
|
||||
// Send PIN
|
||||
status = send_pin(etd->pin) == PM3_SUCCESS;
|
||||
|
||||
// If the write succeeded, read the rest of the tag
|
||||
if(status) {
|
||||
if (status) {
|
||||
// Read Tag
|
||||
// ID doesn't change
|
||||
em4x70_read_um1();
|
||||
|
|
|
@ -2181,7 +2181,7 @@ static int CmdHf14AFuzzapdu(const char *Cmd) {
|
|||
uint8_t d = p2[0];
|
||||
uint8_t e = le[0];
|
||||
|
||||
PrintAndLogEx(SUCCESS, "Starting the apdu fuzzer [ CLA " _GREEN_("%02X") " INS " _GREEN_("%02X") " P1 " _GREEN_("%02X") " P2 " _GREEN_("%02X") " LE " _GREEN_("%02x")" ]", a,b,c,d,e);
|
||||
PrintAndLogEx(SUCCESS, "Starting the apdu fuzzer [ CLA " _GREEN_("%02X") " INS " _GREEN_("%02X") " P1 " _GREEN_("%02X") " P2 " _GREEN_("%02X") " LE " _GREEN_("%02x")" ]", a, b, c, d, e);
|
||||
PrintAndLogEx(INFO, "Press " _GREEN_("<Enter>") " to exit");
|
||||
|
||||
uint8_t response[PM3_CMD_DATA_SIZE];
|
||||
|
@ -2226,26 +2226,26 @@ static int CmdHf14AFuzzapdu(const char *Cmd) {
|
|||
sw != 0x6986 &&
|
||||
sw != 0x6d00
|
||||
) {
|
||||
PrintAndLogEx(INFO, "%02X %02X %02X %02X %02X (%04x - %s)", a,b,c,d,e, sw, GetAPDUCodeDescription(sw >> 8, sw & 0xff));
|
||||
PrintAndLogEx(INFO, "%02X %02X %02X %02X %02X (%04x - %s)", a, b, c, d, e, sw, GetAPDUCodeDescription(sw >> 8, sw & 0xff));
|
||||
}
|
||||
e++;
|
||||
if (verbose) {
|
||||
PrintAndLogEx(INFO, "Status: %02X %02X %02X %02X %02X", a,b,c,d,e);
|
||||
PrintAndLogEx(INFO, "Status: %02X %02X %02X %02X %02X", a, b, c, d, e);
|
||||
}
|
||||
|
||||
} while (e);
|
||||
d++;
|
||||
PrintAndLogEx(INFO, "Status: %02X %02X %02X %02X %02X", a,b,c,d,e);
|
||||
PrintAndLogEx(INFO, "Status: %02X %02X %02X %02X %02X", a, b, c, d, e);
|
||||
} while (d);
|
||||
c++;
|
||||
PrintAndLogEx(INFO, "Status: %02X %02X %02X %02X %02X", a,b,c,d,e);
|
||||
PrintAndLogEx(INFO, "Status: %02X %02X %02X %02X %02X", a, b, c, d, e);
|
||||
} while (c);
|
||||
b++;
|
||||
PrintAndLogEx(INFO, "Status: %02X %02X %02X %02X %02X", a,b,c,d,e);
|
||||
PrintAndLogEx(INFO, "Status: %02X %02X %02X %02X %02X", a, b, c, d, e);
|
||||
} while (b);
|
||||
a++;
|
||||
PrintAndLogEx(INFO, "Status: %02X %02X %02X %02X %02X", a,b,c,d,e);
|
||||
} while(a);
|
||||
PrintAndLogEx(INFO, "Status: %02X %02X %02X %02X %02X", a, b, c, d, e);
|
||||
} while (a);
|
||||
|
||||
out:
|
||||
PrintAndLogEx(SUCCESS, "time: %" PRIu64 " seconds\n", (msclock() - t1) / 1000);
|
||||
|
|
|
@ -3449,11 +3449,11 @@ static int CmdHFiClassEncode(const char *Cmd) {
|
|||
|
||||
int isok = PM3_SUCCESS;
|
||||
// write
|
||||
for (uint8_t i=0; i<4; i++) {
|
||||
isok = iclass_write_block(6 + i, credential + (i*8), key, use_credit_key, elite, rawkey, false, false, auth);
|
||||
for (uint8_t i = 0; i < 4; i++) {
|
||||
isok = iclass_write_block(6 + i, credential + (i * 8), key, use_credit_key, elite, rawkey, false, false, auth);
|
||||
switch (isok) {
|
||||
case PM3_SUCCESS:
|
||||
PrintAndLogEx(SUCCESS, "Write block %d/0x0%x ( " _GREEN_("ok") " ) --> " _YELLOW_("%s"), 6 + i, 6 + i, sprint_hex_inrow(credential + (i*8), 8));
|
||||
PrintAndLogEx(SUCCESS, "Write block %d/0x0%x ( " _GREEN_("ok") " ) --> " _YELLOW_("%s"), 6 + i, 6 + i, sprint_hex_inrow(credential + (i * 8), 8));
|
||||
break;
|
||||
default:
|
||||
PrintAndLogEx(SUCCESS, "Write block %d/0x0%x ( " _RED_("fail") " )", 6 + i, 6 + i);
|
||||
|
|
|
@ -791,7 +791,7 @@ int CmdEM4x05Write(const char *Cmd) {
|
|||
}
|
||||
|
||||
bool use_pwd = false;
|
||||
uint32_t pwd = ( inputpwd != 0xFFFFFFFFFFFFFFFF) ? (inputpwd & 0xFFFFFFFF) : 0;
|
||||
uint32_t pwd = (inputpwd != 0xFFFFFFFFFFFFFFFF) ? (inputpwd & 0xFFFFFFFF) : 0;
|
||||
if (pwd == 0xFFFFFFFF) {
|
||||
if (protect_operation)
|
||||
PrintAndLogEx(INFO, "Writing protection words data %08X", data);
|
||||
|
@ -809,12 +809,12 @@ int CmdEM4x05Write(const char *Cmd) {
|
|||
// set Protect Words
|
||||
if (protect_operation) {
|
||||
res = em4x05_protect(pwd, use_pwd, data);
|
||||
if ( res != PM3_SUCCESS) {
|
||||
if (res != PM3_SUCCESS) {
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
res = em4x05_write_word_ext(addr, pwd, use_pwd, data);
|
||||
if ( res != PM3_SUCCESS) {
|
||||
if (res != PM3_SUCCESS) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
@ -888,25 +888,25 @@ int CmdEM4x05Wipe(const char *Cmd) {
|
|||
|
||||
bool use_pwd = false;
|
||||
uint32_t pwd = 0;
|
||||
if ( inputpwd != 0xFFFFFFFFFFFFFFFF) {
|
||||
if (inputpwd != 0xFFFFFFFFFFFFFFFF) {
|
||||
pwd = (inputpwd & 0xFFFFFFFF);
|
||||
use_pwd = true;
|
||||
}
|
||||
// block 0 : User Data or Chip Info
|
||||
int res = em4x05_write_word_ext(0, pwd, use_pwd, chip_info);
|
||||
if ( res != PM3_SUCCESS) {
|
||||
if (res != PM3_SUCCESS) {
|
||||
return res;
|
||||
}
|
||||
|
||||
// block 1 : UID - this should be read only for EM4205 and EM4305 not sure about others
|
||||
res = em4x05_write_word_ext(1, pwd, use_pwd, chip_UID);
|
||||
if ( res != PM3_SUCCESS) {
|
||||
if (res != PM3_SUCCESS) {
|
||||
PrintAndLogEx(INFO, "UID block write failed");
|
||||
}
|
||||
|
||||
// block 2 : password
|
||||
res = em4x05_write_word_ext(2, pwd, use_pwd, block_data);
|
||||
if ( res != PM3_SUCCESS) {
|
||||
if (res != PM3_SUCCESS) {
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -914,20 +914,20 @@ int CmdEM4x05Wipe(const char *Cmd) {
|
|||
pwd = block_data;
|
||||
// block 3 : user data
|
||||
res = em4x05_write_word_ext(3, pwd, use_pwd, block_data);
|
||||
if ( res != PM3_SUCCESS) {
|
||||
if (res != PM3_SUCCESS) {
|
||||
return res;
|
||||
}
|
||||
|
||||
// block 4 : config
|
||||
res = em4x05_write_word_ext(4, pwd, use_pwd, config);
|
||||
if ( res != PM3_SUCCESS) {
|
||||
if (res != PM3_SUCCESS) {
|
||||
return res;
|
||||
}
|
||||
|
||||
// Remainder of user/data blocks
|
||||
for (addr = 5; addr < 14; addr++) {// Clear user data blocks
|
||||
res = em4x05_write_word_ext(addr, pwd, use_pwd, block_data);
|
||||
if ( res != PM3_SUCCESS) {
|
||||
if (res != PM3_SUCCESS) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -317,10 +317,10 @@ int CmdEM4x50Brute(const char *Cmd) {
|
|||
|
||||
CLIExecWithReturn(ctx, Cmd, argtable, true);
|
||||
int first_len = 0;
|
||||
uint8_t first[4] = {0,0,0,0};
|
||||
uint8_t first[4] = {0, 0, 0, 0};
|
||||
CLIGetHexWithReturn(ctx, 1, first, &first_len);
|
||||
int last_len = 0;
|
||||
uint8_t last[4] = {0,0,0,0};
|
||||
uint8_t last[4] = {0, 0, 0, 0};
|
||||
CLIGetHexWithReturn(ctx, 2, last, &last_len);
|
||||
CLIParserFree(ctx);
|
||||
|
||||
|
@ -610,7 +610,7 @@ int CmdEM4x50Info(const char *Cmd) {
|
|||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
||||
if ( resp.status == PM3_SUCCESS)
|
||||
if (resp.status == PM3_SUCCESS)
|
||||
print_info_result(resp.data.asBytes);
|
||||
else
|
||||
PrintAndLogEx(FAILED, "Reading tag " _RED_("failed"));
|
||||
|
@ -971,7 +971,7 @@ int CmdEM4x50Wipe(const char *Cmd) {
|
|||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
||||
if ( resp.status != PM3_SUCCESS) {
|
||||
if (resp.status != PM3_SUCCESS) {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(FAILED, "Wiping data " _RED_("failed"));
|
||||
return PM3_ESOFT;
|
||||
|
@ -1118,10 +1118,10 @@ static command_t CommandTable[] = {
|
|||
{"login", CmdEM4x50Login, IfPm3EM4x50, "login into EM4x50"},
|
||||
{"rdbl", CmdEM4x50Read, IfPm3EM4x50, "read word data from EM4x50"},
|
||||
{"wrbl", CmdEM4x50Write, IfPm3EM4x50, "write word data to EM4x50"},
|
||||
{"writepwd",CmdEM4x50WritePwd, IfPm3EM4x50, "change password of EM4x50"},
|
||||
{"writepwd", CmdEM4x50WritePwd, IfPm3EM4x50, "change password of EM4x50"},
|
||||
{"wipe", CmdEM4x50Wipe, IfPm3EM4x50, "wipe EM4x50 tag"},
|
||||
{"reader", CmdEM4x50Reader, IfPm3EM4x50, "show standard read mode data of EM4x50"},
|
||||
{"restore",CmdEM4x50Restore, IfPm3EM4x50, "restore EM4x50 dump to tag"},
|
||||
{"restore", CmdEM4x50Restore, IfPm3EM4x50, "restore EM4x50 dump to tag"},
|
||||
{"sim", CmdEM4x50Sim, IfPm3EM4x50, "simulate EM4x50 tag"},
|
||||
{"eload", CmdEM4x50ELoad, IfPm3EM4x50, "upload dump of EM4x50 to flash memory"},
|
||||
{"esave", CmdEM4x50ESave, IfPm3EM4x50, "save flash memory to file"},
|
||||
|
|
|
@ -32,12 +32,12 @@ static void print_info_result(uint8_t *data) {
|
|||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(INFO, _YELLOW_("EM4x70 data:"));
|
||||
|
||||
for(int i=1; i <= 32; i+=2) {
|
||||
PrintAndLogEx(NORMAL, "%02X %02X", data[32-i], data[32-i-1]);
|
||||
for (int i = 1; i <= 32; i += 2) {
|
||||
PrintAndLogEx(NORMAL, "%02X %02X", data[32 - i], data[32 - i - 1]);
|
||||
}
|
||||
PrintAndLogEx(NORMAL, "Tag ID: %02X %02X %02X %02X", data[7], data[6], data[5], data[4]);
|
||||
PrintAndLogEx(NORMAL, "Lockbit 0: %d %s", (data[3] & 0x40) ? 1:0, (data[3] & 0x40) ? "LOCKED":"UNLOCKED");
|
||||
PrintAndLogEx(NORMAL, "Lockbit 1: %d", (data[3] & 0x80) ? 1:0);
|
||||
PrintAndLogEx(NORMAL, "Lockbit 0: %d %s", (data[3] & 0x40) ? 1 : 0, (data[3] & 0x40) ? "LOCKED" : "UNLOCKED");
|
||||
PrintAndLogEx(NORMAL, "Lockbit 1: %d", (data[3] & 0x80) ? 1 : 0);
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
|
||||
}
|
||||
|
|
|
@ -454,7 +454,7 @@ static int CmdLFNedapClone(const char *Cmd) {
|
|||
NedapGen(sub_type, customer_code, id, is_long, data);
|
||||
|
||||
for (uint8_t i = 1; i < max ; i++) {
|
||||
blocks[i] = bytes_to_num (data + ((i - 1) * 4), 4);
|
||||
blocks[i] = bytes_to_num(data + ((i - 1) * 4), 4);
|
||||
}
|
||||
|
||||
PrintAndLogEx(SUCCESS, "Preparing to clone NEDAP to " _YELLOW_("%s") " tag", cardtype);
|
||||
|
|
|
@ -134,7 +134,7 @@ static int CmdLFPCF7931Config(const char *Cmd) {
|
|||
configPcf.OffsetWidth = (ow & 0xFFFF);
|
||||
}
|
||||
if (op != 0xFFFF) {
|
||||
configPcf.OffsetPosition =(op & 0xFFFF);
|
||||
configPcf.OffsetPosition = (op & 0xFFFF);
|
||||
}
|
||||
|
||||
pcf7931_printConfig();
|
||||
|
|
|
@ -354,7 +354,7 @@ static int CmdTIWrite(const char *Cmd) {
|
|||
payload.crc = bytes_to_num(crc, crc_len);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_LF_TI_WRITE, (uint8_t*)&payload, sizeof(payload));
|
||||
SendCommandNG(CMD_LF_TI_WRITE, (uint8_t *)&payload, sizeof(payload));
|
||||
PrintAndLogEx(SUCCESS, "Done");
|
||||
PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf ti reader`") " to verify");
|
||||
return PM3_SUCCESS;
|
||||
|
|
|
@ -109,7 +109,7 @@ uint32_t reflect32(uint32_t b) {
|
|||
// swap bytes
|
||||
v = ((v >> 8) & 0x00FF00FF) | ((v & 0x00FF00FF) << 8);
|
||||
// swap 2-byte long pairs
|
||||
v = ( v >> 16 ) | ( v << 16);
|
||||
v = (v >> 16) | (v << 16);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
|
|
@ -1082,8 +1082,8 @@ int DetectPSKClock(uint8_t *dest, size_t size, int clock, size_t *firstPhaseShif
|
|||
if (g_debugMode == 2) prnt("DEBUG PSK: firstFullWave: %zu, waveLen: %d", firstFullWave, fullWaveLen);
|
||||
|
||||
// Avoid autodetect if user selected a clock
|
||||
for(uint8_t validClk = 1; validClk < 8; validClk++) {
|
||||
if(clock == clk[validClk]) return(clock);
|
||||
for (uint8_t validClk = 1; validClk < 8; validClk++) {
|
||||
if (clock == clk[validClk]) return (clock);
|
||||
}
|
||||
|
||||
//test each valid clock from greatest to smallest to see which lines up
|
||||
|
|
|
@ -38,7 +38,6 @@ Check column "offline" for their availability.
|
|||
|`analyse nuid `|Y |`create NUID from 7byte UID`
|
||||
|`analyse demodbuff `|Y |`Load binary string to demodbuffer`
|
||||
|`analyse freq `|Y |`Calc wave lengths`
|
||||
|`analyse foo `|Y |`muxer`
|
||||
|
||||
|
||||
### data
|
||||
|
@ -143,6 +142,7 @@ Check column "offline" for their availability.
|
|||
|`hf 14a raw `|N |`Send raw hex data to tag`
|
||||
|`hf 14a antifuzz `|N |`Fuzzing the anticollision phase. Warning! Readers may react strange`
|
||||
|`hf 14a config `|N |`Configure 14a settings (use with caution)`
|
||||
|`hf 14a apdufuzz `|N |`Fuzz APDU - CLA/INS/P1P2`
|
||||
|
||||
|
||||
### hf 14b
|
||||
|
@ -248,28 +248,29 @@ Check column "offline" for their availability.
|
|||
|
||||
|command |offline |description
|
||||
|------- |------- |-----------
|
||||
|`hf iclass help `|Y |`This help`
|
||||
|`hf iclass dump `|N |`[options..] Dump Picopass / iCLASS tag to file`
|
||||
|`hf iclass help `|Y |` This help`
|
||||
|`hf iclass dump `|N |`[*] Dump Picopass / iCLASS tag to file`
|
||||
|`hf iclass info `|Y |` Tag information`
|
||||
|`hf iclass list `|Y |` List iclass history`
|
||||
|`hf iclass rdbl `|N |`[options..] Read Picopass / iCLASS block`
|
||||
|`hf iclass rdbl `|N |`[*] Read Picopass / iCLASS block`
|
||||
|`hf iclass reader `|N |` Act like an Picopass / iCLASS reader`
|
||||
|`hf iclass restore `|N |`[options..] Restore a dump file onto a Picopass / iCLASS tag`
|
||||
|`hf iclass restore `|N |`[*] Restore a dump file onto a Picopass / iCLASS tag`
|
||||
|`hf iclass sniff `|N |` Eavesdrop Picopass / iCLASS communication`
|
||||
|`hf iclass wrbl `|N |`[options..] Write Picopass / iCLASS block`
|
||||
|`hf iclass chk `|N |`[options..] Check keys`
|
||||
|`hf iclass loclass `|Y |`[options..] Use loclass to perform bruteforce reader attack`
|
||||
|`hf iclass lookup `|Y |`[options..] Uses authentication trace to check for key in dictionary file`
|
||||
|`hf iclass sim `|N |`[options..] Simulate iCLASS tag`
|
||||
|`hf iclass eload `|N |`[f <fn> ] Load Picopass / iCLASS dump file into emulator memory`
|
||||
|`hf iclass esave `|N |`[f <fn> ] Save emulator memory to file`
|
||||
|`hf iclass eview `|N |`[options..] View emulator memory`
|
||||
|`hf iclass calcnewkey `|Y |`[options..] Calc diversified keys (blocks 3 & 4) to write new keys`
|
||||
|`hf iclass encrypt `|Y |`[options..] Encrypt given block data`
|
||||
|`hf iclass decrypt `|Y |`[options..] Decrypt given block data or tag dump file`
|
||||
|`hf iclass managekeys `|Y |`[options..] Manage keys to use with iclass commands`
|
||||
|`hf iclass wrbl `|N |`[*] Write Picopass / iCLASS block`
|
||||
|`hf iclass chk `|N |`[*] Check keys`
|
||||
|`hf iclass loclass `|Y |`[*] Use loclass to perform bruteforce reader attack`
|
||||
|`hf iclass lookup `|Y |`[*] Uses authentication trace to check for key in dictionary file`
|
||||
|`hf iclass sim `|N |`[*] Simulate iCLASS tag`
|
||||
|`hf iclass eload `|N |`[*] Load Picopass / iCLASS dump file into emulator memory`
|
||||
|`hf iclass esave `|N |`[*] Save emulator memory to file`
|
||||
|`hf iclass eview `|N |`[.] View emulator memory`
|
||||
|`hf iclass calcnewkey `|Y |`[*] Calc diversified keys (blocks 3 & 4) to write new keys`
|
||||
|`hf iclass encode `|Y |`[*] Encode binary wiegand to block 7`
|
||||
|`hf iclass encrypt `|Y |`[*] Encrypt given block data`
|
||||
|`hf iclass decrypt `|Y |`[*] Decrypt given block data or tag dump file`
|
||||
|`hf iclass managekeys `|Y |`[*] Manage keys to use with iclass commands`
|
||||
|`hf iclass permutekey `|N |` Permute function from 'heart of darkness' paper`
|
||||
|`hf iclass view `|Y |`[options..] Display content from tag dump file`
|
||||
|`hf iclass view `|Y |`[*] Display content from tag dump file`
|
||||
|
||||
|
||||
### hf legic
|
||||
|
@ -577,10 +578,10 @@ Check column "offline" for their availability.
|
|||
|command |offline |description
|
||||
|------- |------- |-----------
|
||||
|`lf em help `|Y |`This help`
|
||||
|`lf em 410x `|Y |`EM 410x commands...`
|
||||
|`lf em 4x05 `|Y |`EM 4x05 commands...`
|
||||
|`lf em 4x50 `|Y |`EM 4x50 commands...`
|
||||
|`lf em 4x70 `|Y |`EM 4x70 commands...`
|
||||
|`lf em 410x `|Y |`EM 4102 commands...`
|
||||
|`lf em 4x05 `|Y |`EM 4205 / 4305 / 4369 / 4469 commands...`
|
||||
|`lf em 4x50 `|Y |`EM 4350 / 4450 commands...`
|
||||
|`lf em 4x70 `|Y |`EM 4070 / 4170 commands...`
|
||||
|
||||
|
||||
### lf fdxb
|
||||
|
@ -672,9 +673,9 @@ Check column "offline" for their availability.
|
|||
|command |offline |description
|
||||
|------- |------- |-----------
|
||||
|`lf indala help `|Y |`this help`
|
||||
|`lf indala demod `|Y |`demodulate an indala tag (PSK1) from GraphBuffer`
|
||||
|`lf indala altdemod `|Y |`alternative method to Demodulate samples for Indala 64 bit UID (option '224' for 224 bit)`
|
||||
|`lf indala reader `|N |`read an Indala Prox tag from the antenna`
|
||||
|`lf indala demod `|Y |`demodulate an Indala tag (PSK1) from GraphBuffer`
|
||||
|`lf indala altdemod `|Y |`alternative method to demodulate samples for Indala 64 bit UID (option '224' for 224 bit)`
|
||||
|`lf indala reader `|N |`read an Indala tag from the antenna`
|
||||
|`lf indala clone `|N |`clone Indala tag to T55x7 or Q5/T5555`
|
||||
|`lf indala sim `|N |`simulate Indala tag`
|
||||
|
||||
|
@ -686,10 +687,10 @@ Check column "offline" for their availability.
|
|||
|command |offline |description
|
||||
|------- |------- |-----------
|
||||
|`lf io help `|Y |`this help`
|
||||
|`lf io demod `|Y |`demodulate an IOProx tag from the GraphBuffer`
|
||||
|`lf io demod `|Y |`demodulate an ioProx tag from the GraphBuffer`
|
||||
|`lf io reader `|N |`attempt to read and extract tag data`
|
||||
|`lf io clone `|N |`clone IOProx tag to T55x7 or Q5/T5555`
|
||||
|`lf io sim `|N |`simulate IOProx tag`
|
||||
|`lf io clone `|N |`clone ioProx tag to T55x7 or Q5/T5555`
|
||||
|`lf io sim `|N |`simulate ioProx tag`
|
||||
|`lf io watch `|N |`continuously watch for cards. Reader mode`
|
||||
|
||||
|
||||
|
@ -1001,7 +1002,7 @@ Check column "offline" for their availability.
|
|||
|------- |------- |-----------
|
||||
|`wiegand help `|Y |`This help`
|
||||
|`wiegand list `|Y |`List available wiegand formats`
|
||||
|`wiegand encode `|Y |`Encode to wiegand raw hex`
|
||||
|`wiegand decode `|Y |`Convert raw hex to decoded wiegand format`
|
||||
|`wiegand encode `|Y |`Encode to wiegand raw hex (currently for HID Prox)`
|
||||
|`wiegand decode `|Y |`Convert raw hex to decoded wiegand format (currently for HID Prox)`
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue