mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-19 12:59:44 -07:00
minor lf updates/cleanup
This commit is contained in:
parent
9f669cb26f
commit
76346455d2
4 changed files with 30 additions and 35 deletions
|
@ -1312,6 +1312,9 @@ void CopyHIDtoT55x7(uint32_t hi2, uint32_t hi, uint32_t lo, uint8_t longFMT) {
|
||||||
// load chip config block
|
// load chip config block
|
||||||
data[0] = T55x7_BITRATE_RF_50 | T55x7_MODULATION_FSK2a | last_block << T55x7_MAXBLOCK_SHIFT;
|
data[0] = T55x7_BITRATE_RF_50 | T55x7_MODULATION_FSK2a | last_block << T55x7_MAXBLOCK_SHIFT;
|
||||||
|
|
||||||
|
//TODO add selection of chip for Q5 or T55x7
|
||||||
|
// data[0] = (((50-2)/2)<<T5555_BITRATE_SHIFT) | T5555_MODULATION_FSK2 | T5555_INVERT_OUTPUT | last_block << T5555_MAXBLOCK_SHIFT;
|
||||||
|
|
||||||
LED_D_ON();
|
LED_D_ON();
|
||||||
// Program the data blocks for supplied ID
|
// Program the data blocks for supplied ID
|
||||||
// and the block 0 for HID format
|
// and the block 0 for HID format
|
||||||
|
@ -1324,6 +1327,8 @@ void CopyHIDtoT55x7(uint32_t hi2, uint32_t hi, uint32_t lo, uint8_t longFMT) {
|
||||||
|
|
||||||
void CopyIOtoT55x7(uint32_t hi, uint32_t lo) {
|
void CopyIOtoT55x7(uint32_t hi, uint32_t lo) {
|
||||||
uint32_t data[] = {T55x7_BITRATE_RF_64 | T55x7_MODULATION_FSK2a | (2 << T55x7_MAXBLOCK_SHIFT), hi, lo};
|
uint32_t data[] = {T55x7_BITRATE_RF_64 | T55x7_MODULATION_FSK2a | (2 << T55x7_MAXBLOCK_SHIFT), hi, lo};
|
||||||
|
//TODO add selection of chip for Q5 or T55x7
|
||||||
|
// data[0] = (((64-2)/2)<<T5555_BITRATE_SHIFT) | T5555_MODULATION_FSK2 | T5555_INVERT_OUTPUT | 2 << T5555_MAXBLOCK_SHIFT;
|
||||||
|
|
||||||
LED_D_ON();
|
LED_D_ON();
|
||||||
// Program the data blocks for supplied ID
|
// Program the data blocks for supplied ID
|
||||||
|
@ -1340,6 +1345,9 @@ void CopyIndala64toT55x7(uint32_t hi, uint32_t lo) {
|
||||||
//Program the 2 data blocks for supplied 64bit UID
|
//Program the 2 data blocks for supplied 64bit UID
|
||||||
// and the Config for Indala 64 format (RF/32;PSK1 with RF/2;Maxblock=2)
|
// and the Config for Indala 64 format (RF/32;PSK1 with RF/2;Maxblock=2)
|
||||||
uint32_t data[] = { T55x7_BITRATE_RF_32 | T55x7_MODULATION_PSK1 | (2 << T55x7_MAXBLOCK_SHIFT), hi, lo};
|
uint32_t data[] = { T55x7_BITRATE_RF_32 | T55x7_MODULATION_PSK1 | (2 << T55x7_MAXBLOCK_SHIFT), hi, lo};
|
||||||
|
//TODO add selection of chip for Q5 or T55x7
|
||||||
|
// data[0] = (((32-2)/2)<<T5555_BITRATE_SHIFT) | T5555_MODULATION_PSK1 | 2 << T5555_MAXBLOCK_SHIFT;
|
||||||
|
|
||||||
WriteT55xx(data, 0, 3);
|
WriteT55xx(data, 0, 3);
|
||||||
//Alternative config for Indala (Extended mode;RF/32;PSK1 with RF/2;Maxblock=2;Inverse data)
|
//Alternative config for Indala (Extended mode;RF/32;PSK1 with RF/2;Maxblock=2;Inverse data)
|
||||||
// T5567WriteBlock(0x603E1042,0);
|
// T5567WriteBlock(0x603E1042,0);
|
||||||
|
@ -1352,6 +1360,8 @@ void CopyIndala224toT55x7(uint32_t uid1, uint32_t uid2, uint32_t uid3, uint32_t
|
||||||
// and the block 0 for Indala224 format
|
// and the block 0 for Indala224 format
|
||||||
//Config for Indala (RF/32;PSK1 with RF/2;Maxblock=7)
|
//Config for Indala (RF/32;PSK1 with RF/2;Maxblock=7)
|
||||||
data[0] = T55x7_BITRATE_RF_32 | T55x7_MODULATION_PSK1 | (7 << T55x7_MAXBLOCK_SHIFT);
|
data[0] = T55x7_BITRATE_RF_32 | T55x7_MODULATION_PSK1 | (7 << T55x7_MAXBLOCK_SHIFT);
|
||||||
|
//TODO add selection of chip for Q5 or T55x7
|
||||||
|
// data[0] = (((32-2)/2)<<T5555_BITRATE_SHIFT) | T5555_MODULATION_PSK1 | 7 << T5555_MAXBLOCK_SHIFT;
|
||||||
WriteT55xx(data, 0, 8);
|
WriteT55xx(data, 0, 8);
|
||||||
//Alternative config for Indala (Extended mode;RF/32;PSK1 with RF/2;Maxblock=7;Inverse data)
|
//Alternative config for Indala (Extended mode;RF/32;PSK1 with RF/2;Maxblock=7;Inverse data)
|
||||||
// T5567WriteBlock(0x603E10E2,0);
|
// T5567WriteBlock(0x603E10E2,0);
|
||||||
|
@ -1423,19 +1433,20 @@ void WriteEM410x(uint32_t card, uint32_t id_hi, uint32_t id_lo) {
|
||||||
|
|
||||||
// Write EM410x ID
|
// Write EM410x ID
|
||||||
uint32_t data[] = {0, id>>32, id & 0xFFFFFFFF};
|
uint32_t data[] = {0, id>>32, id & 0xFFFFFFFF};
|
||||||
if (card) {
|
|
||||||
clock = (card & 0xFF00) >> 8;
|
clock = (card & 0xFF00) >> 8;
|
||||||
clock = (clock == 0) ? 64 : clock;
|
clock = (clock == 0) ? 64 : clock;
|
||||||
Dbprintf("Clock rate: %d", clock);
|
Dbprintf("Clock rate: %d", clock);
|
||||||
|
if (card & 0xFF) { //t55x7
|
||||||
clock = GetT55xxClockBit(clock);
|
clock = GetT55xxClockBit(clock);
|
||||||
if (clock == 0) {
|
if (clock == 0) {
|
||||||
Dbprintf("Invalid clock rate: %d", clock);
|
Dbprintf("Invalid clock rate: %d", clock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
data[0] = clock | T55x7_MODULATION_MANCHESTER | (2 << T55x7_MAXBLOCK_SHIFT);
|
data[0] = clock | T55x7_MODULATION_MANCHESTER | (2 << T55x7_MAXBLOCK_SHIFT);
|
||||||
} else {
|
} else { //t5555 (Q5)
|
||||||
data[0] = (0x1F << T5555_BITRATE_SHIFT) | T5555_MODULATION_MANCHESTER | (2 << T5555_MAXBLOCK_SHIFT);
|
clock = (clock-2)>>1; //n = (RF-2)/2
|
||||||
|
data[0] = (clock << T5555_BITRATE_SHIFT) | T5555_MODULATION_MANCHESTER | (2 << T5555_MAXBLOCK_SHIFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteT55xx(data, 0, 3);
|
WriteT55xx(data, 0, 3);
|
||||||
|
|
|
@ -1130,8 +1130,6 @@ int CmdFSKdemodParadox(const char *Cmd)
|
||||||
//print ioprox ID and some format details
|
//print ioprox ID and some format details
|
||||||
int CmdFSKdemodIO(const char *Cmd)
|
int CmdFSKdemodIO(const char *Cmd)
|
||||||
{
|
{
|
||||||
//raw fsk demod no manchester decoding no start bit finding just get binary from wave
|
|
||||||
//set defaults
|
|
||||||
int idx=0;
|
int idx=0;
|
||||||
//something in graphbuffer?
|
//something in graphbuffer?
|
||||||
if (GraphTraceLen < 65) {
|
if (GraphTraceLen < 65) {
|
||||||
|
@ -1220,11 +1218,6 @@ int CmdFSKdemodIO(const char *Cmd)
|
||||||
//print full AWID Prox ID and some bit format details if found
|
//print full AWID Prox ID and some bit format details if found
|
||||||
int CmdFSKdemodAWID(const char *Cmd)
|
int CmdFSKdemodAWID(const char *Cmd)
|
||||||
{
|
{
|
||||||
|
|
||||||
//int verbose=1;
|
|
||||||
//sscanf(Cmd, "%i", &verbose);
|
|
||||||
|
|
||||||
//raw fsk demod no manchester decoding no start bit finding just get binary from wave
|
|
||||||
uint8_t BitStream[MAX_GRAPH_TRACE_LEN]={0};
|
uint8_t BitStream[MAX_GRAPH_TRACE_LEN]={0};
|
||||||
size_t size = getFromGraphBuf(BitStream);
|
size_t size = getFromGraphBuf(BitStream);
|
||||||
if (size==0) return 0;
|
if (size==0) return 0;
|
||||||
|
@ -1423,7 +1416,6 @@ int CmdFSKdemodPyramid(const char *Cmd)
|
||||||
uint32_t fc = 0;
|
uint32_t fc = 0;
|
||||||
uint32_t cardnum = 0;
|
uint32_t cardnum = 0;
|
||||||
uint32_t code1 = 0;
|
uint32_t code1 = 0;
|
||||||
//uint32_t code2 = 0;
|
|
||||||
if (fmtLen==26){
|
if (fmtLen==26){
|
||||||
fc = bytebits_to_byte(BitStream+73, 8);
|
fc = bytebits_to_byte(BitStream+73, 8);
|
||||||
cardnum = bytebits_to_byte(BitStream+81, 16);
|
cardnum = bytebits_to_byte(BitStream+81, 16);
|
||||||
|
|
|
@ -197,21 +197,13 @@ int CmdEM410xWrite(const char *Cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check Clock
|
// Check Clock
|
||||||
if (card == 1)
|
|
||||||
{
|
|
||||||
// Default: 64
|
// Default: 64
|
||||||
if (clock == 0)
|
if (clock == 0)
|
||||||
clock = 64;
|
clock = 64;
|
||||||
|
|
||||||
// Allowed clock rates: 16, 32 and 64
|
// Allowed clock rates: 16, 32, 40 and 64
|
||||||
if ((clock != 16) && (clock != 32) && (clock != 64)) {
|
if ((clock != 16) && (clock != 32) && (clock != 64) && (clock != 40)) {
|
||||||
PrintAndLog("Error! Clock rate %d not valid. Supported clock rates are 16, 32 and 64.\n", clock);
|
PrintAndLog("Error! Clock rate %d not valid. Supported clock rates are 16, 32, 40 and 64.\n", clock);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (clock != 0)
|
|
||||||
{
|
|
||||||
PrintAndLog("Error! Clock rate is only supported on T55x7 tags.\n");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,11 +213,11 @@ int CmdEM410xWrite(const char *Cmd)
|
||||||
// provide for backwards-compatibility for older firmware, and to avoid
|
// provide for backwards-compatibility for older firmware, and to avoid
|
||||||
// having to add another argument to CMD_EM410X_WRITE_TAG, we just store
|
// having to add another argument to CMD_EM410X_WRITE_TAG, we just store
|
||||||
// the clock rate in bits 8-15 of the card value
|
// the clock rate in bits 8-15 of the card value
|
||||||
card = (card & 0xFF) | (((uint64_t)clock << 8) & 0xFF00);
|
card = (card & 0xFF) | ((clock << 8) & 0xFF00);
|
||||||
}
|
} else if (card == 0) {
|
||||||
else if (card == 0)
|
|
||||||
PrintAndLog("Writing %s tag with UID 0x%010" PRIx64, "T5555", id, clock);
|
PrintAndLog("Writing %s tag with UID 0x%010" PRIx64, "T5555", id, clock);
|
||||||
else {
|
card = (card & 0xFF) | ((clock << 8) & 0xFF00);
|
||||||
|
} else {
|
||||||
PrintAndLog("Error! Bad card type selected.\n");
|
PrintAndLog("Error! Bad card type selected.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,7 +243,7 @@ void getMemConfig(uint8_t mem_cfg, uint8_t chip_cfg, uint8_t *max_blk, uint8_t *
|
||||||
#define T5555_PSK_RF_8 0x00000200
|
#define T5555_PSK_RF_8 0x00000200
|
||||||
#define T5555_USE_PWD 0x00000400
|
#define T5555_USE_PWD 0x00000400
|
||||||
#define T5555_USE_AOR 0x00000800
|
#define T5555_USE_AOR 0x00000800
|
||||||
#define T5555_BITRATE_SHIFT 12
|
#define T5555_BITRATE_SHIFT 12 //(RF=2n+2) ie 64=2*0x1F+2 or n = (RF-2)/2
|
||||||
#define T5555_FAST_WRITE 0x00004000
|
#define T5555_FAST_WRITE 0x00004000
|
||||||
#define T5555_PAGE_SELECT 0x00008000
|
#define T5555_PAGE_SELECT 0x00008000
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue