Added Indala cloning. Fixed HID cloning bug

This commit is contained in:
cex123@gmail.com 2012-07-02 08:37:50 +00:00
commit 2414f97889
5 changed files with 146 additions and 7 deletions

View file

@ -611,13 +611,13 @@ void UsbPacketReceived(uint8_t *packet, int len)
ModThenAcquireRawAdcSamples125k(c->arg[0],c->arg[1],c->arg[2],c->d.asBytes);
break;
case CMD_HID_DEMOD_FSK:
CmdHIDdemodFSK(0, 0, 0, 1); // Demodulate HID tag
CmdHIDdemodFSK(0, 0, 0, 1); // Demodulate HID tag
break;
case CMD_HID_SIM_TAG:
CmdHIDsimTAG(c->arg[0], c->arg[1], 1); // Simulate HID tag by ID
break;
case CMD_HID_CLONE_TAG:
CopyHIDtoT5567(c->arg[0], c->arg[1]); // Clone HID tag by ID to T55x7
CopyHIDtoT55x7(c->arg[0], c->arg[1]); // Clone HID tag by ID to T55x7
break;
case CMD_EM410X_WRITE_TAG:
WriteEM410x(c->arg[0], c->arg[1], c->arg[2]);
@ -636,6 +636,12 @@ void UsbPacketReceived(uint8_t *packet, int len)
case CMD_LF_SIMULATE_BIDIR:
SimulateTagLowFrequencyBidir(c->arg[0], c->arg[1]);
break;
case CMD_INDALA_CLONE_TAG: // Clone Indala 64-bit tag by UID to T55x7
CopyIndala64toT55x7(c->arg[0], c->arg[1]);
break;
case CMD_INDALA_CLONE_TAG_L: // Clone Indala 224-bit tag by UID to T55x7
CopyIndala224toT55x7(c->d.asDwords[0], c->d.asDwords[1], c->d.asDwords[2], c->d.asDwords[3], c->d.asDwords[4], c->d.asDwords[5], c->d.asDwords[6]);
break;
#endif
#ifdef WITH_ISO15693

View file

@ -112,8 +112,10 @@ void SimulateTagLowFrequency(int period, int gap, int ledcontrol);
void CmdHIDsimTAG(int hi, int lo, int ledcontrol);
void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol);
void SimulateTagLowFrequencyBidir(int divisor, int max_bitlen);
void CopyHIDtoT5567(int hi, int lo); // Clone an HID card to T5557/T5567
void CopyHIDtoT55x7(int hi, int lo); // Clone an HID card to T5557/T5567
void WriteEM410x(uint32_t card, uint32_t id_hi, uint32_t id_lo);
void CopyIndala64toT55x7(int hi, int lo); // Clone Indala 64-bit tag by UID to T55x7
void CopyIndala224toT55x7(int uid1, int uid2, int uid3, int uid4, int uid5, int uid6, int uid7); // Clone Indala 224-bit tag by UID to T55x7
/// iso14443.h
void SimulateIso14443Tag(void);

View file

@ -1092,7 +1092,7 @@ void T55xxWriteBlock(int Data, int Block)
}
// Copy HID id to card and setup block 0 config
void CopyHIDtoT5567(int hi, int lo)
void CopyHIDtoT55x7(int hi, int lo)
{
int data1, data2, data3;
@ -1135,8 +1135,8 @@ void CopyHIDtoT5567(int hi, int lo)
T55xxWriteBlock(data3,3);
// Config for HID (RF/50, FSK2a, Maxblock=3)
T55xxWriteBlock(T55x7_BITRATE_RF_50 |
T55x7_MODULATION_MANCHESTER |
T55xxWriteBlock(T55x7_BITRATE_RF_50 |
T55x7_MODULATION_FSK2a |
3 << T55x7_MAXBLOCK_SHIFT,
0);
@ -1228,3 +1228,47 @@ void WriteEM410x(uint32_t card, uint32_t id_hi, uint32_t id_lo)
Dbprintf("Tag %s written with 0x%08x%08x\n", card ? "T55x7":"T5555",
(uint32_t)(id >> 32), (uint32_t)id);
}
// Clone Indala 64-bit tag by UID to T55x7
void CopyIndala64toT55x7(int hi, int lo)
{
//Program the 2 data blocks for supplied 64bit UID
// and the block 0 for Indala64 format
T55xxWriteBlock(hi,1);
T55xxWriteBlock(lo,2);
//Config for Indala (RF/32;PSK1 with RF/2;Maxblock=2)
T55xxWriteBlock(T55x7_BITRATE_RF_32 |
T55x7_MODULATION_PSK1 |
2 << T55x7_MAXBLOCK_SHIFT,
0);
//Alternative config for Indala (Extended mode;RF/32;PSK1 with RF/2;Maxblock=2;Inverse data)
// T5567WriteBlock(0x603E1042,0);
DbpString("DONE!");
}
void CopyIndala224toT55x7(int uid1, int uid2, int uid3, int uid4, int uid5, int uid6, int uid7)
{
//Program the 7 data blocks for supplied 224bit UID
// and the block 0 for Indala224 format
T55xxWriteBlock(uid1,1);
T55xxWriteBlock(uid2,2);
T55xxWriteBlock(uid3,3);
T55xxWriteBlock(uid4,4);
T55xxWriteBlock(uid5,5);
T55xxWriteBlock(uid6,6);
T55xxWriteBlock(uid7,7);
//Config for Indala (RF/32;PSK1 with RF/2;Maxblock=7)
T55xxWriteBlock(T55x7_BITRATE_RF_32 |
T55x7_MODULATION_PSK1 |
7 << T55x7_MAXBLOCK_SHIFT,
0);
//Alternative config for Indala (Extended mode;RF/32;PSK1 with RF/2;Maxblock=7;Inverse data)
// T5567WriteBlock(0x603E10E2,0);
DbpString("DONE!");
}