test I can commit by adding allow UID to be specified
This commit is contained in:
parent
1ca94ca86c
commit
0b6090cfd6
1 changed files with 18 additions and 3 deletions
|
@ -34,18 +34,33 @@ static dev_info* pdi;
|
||||||
byte_t abtAtqa [2] = { 0x04,0x00 };
|
byte_t abtAtqa [2] = { 0x04,0x00 };
|
||||||
byte_t abtUidBcc [5] = { 0xDE,0xAD,0xBE,0xAF,0x62 };
|
byte_t abtUidBcc [5] = { 0xDE,0xAD,0xBE,0xAF,0x62 };
|
||||||
byte_t abtSak [9] = { 0x08,0xb6,0xdd };
|
byte_t abtSak [9] = { 0x08,0xb6,0xdd };
|
||||||
|
byte_t Tmp [3] = { 0x00,0x00,0x00 };
|
||||||
|
|
||||||
int main(int argc, const char* argv[])
|
int main(int argc, const char* argv[])
|
||||||
{
|
{
|
||||||
byte_t* pbtTx = NULL;
|
byte_t* pbtTx = NULL;
|
||||||
uint32_t uiTxBits;
|
uint32_t uiTxBits;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
// See if UID was specified as HEX string
|
||||||
|
if(argc == 2 && strlen(argv[1]) == 8)
|
||||||
|
{
|
||||||
|
printf("[+] Using UID: %s",argv[1]);
|
||||||
|
abtUidBcc[4]= 0x00;
|
||||||
|
for(i= 0; i < 4; ++i)
|
||||||
|
{
|
||||||
|
memcpy(Tmp,argv[1]+i*2,2);
|
||||||
|
abtUidBcc[i]= (byte_t) strtol(Tmp,NULL,16);
|
||||||
|
abtUidBcc[4] ^= abtUidBcc[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Try to open the NFC reader
|
// Try to open the NFC reader
|
||||||
pdi = nfc_connect();
|
pdi = nfc_connect();
|
||||||
|
|
||||||
if (pdi == INVALID_DEVICE_INFO)
|
if (pdi == INVALID_DEVICE_INFO)
|
||||||
{
|
{
|
||||||
printf("Error connecting NFC second reader\n");
|
printf("Error connecting NFC reader\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +79,7 @@ int main(int argc, const char* argv[])
|
||||||
printf("[+] Configuring communication\n");
|
printf("[+] Configuring communication\n");
|
||||||
nfc_configure(pdi,DCO_HANDLE_CRC,false);
|
nfc_configure(pdi,DCO_HANDLE_CRC,false);
|
||||||
nfc_configure(pdi,DCO_HANDLE_PARITY,true);
|
nfc_configure(pdi,DCO_HANDLE_PARITY,true);
|
||||||
printf("[+] Done, the emulated tag is initialized\n\n");
|
printf("[+] Done, the emulated tag is initialized with UID: %02X%02X%02X%02X\n\n",abtUidBcc[0],abtUidBcc[1],abtUidBcc[2],abtUidBcc[3]);
|
||||||
|
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue