Rename dev_config_option to nfc_device_option_t.
Use NULL instead of INVALID_DEVICE_INFO to know if device is valid (all occurences are now replaced).
This commit is contained in:
parent
2a0ff6c5d0
commit
2feedddbfe
15 changed files with 84 additions and 85 deletions
|
|
@ -138,14 +138,14 @@ int main(int argc,char* argv[])
|
|||
nfc_initiator_init(pnd);
|
||||
|
||||
// Drop the field for a while
|
||||
nfc_configure(pnd,DCO_ACTIVATE_FIELD,false);
|
||||
nfc_configure(pnd,NDO_ACTIVATE_FIELD,false);
|
||||
|
||||
// Configure the CRC and Parity settings
|
||||
nfc_configure(pnd,DCO_HANDLE_CRC,false);
|
||||
nfc_configure(pnd,DCO_HANDLE_PARITY,true);
|
||||
nfc_configure(pnd,NDO_HANDLE_CRC,false);
|
||||
nfc_configure(pnd,NDO_HANDLE_PARITY,true);
|
||||
|
||||
// Enable field so more power consuming cards can power themselves up
|
||||
nfc_configure(pnd,DCO_ACTIVATE_FIELD,true);
|
||||
nfc_configure(pnd,NDO_ACTIVATE_FIELD,true);
|
||||
|
||||
printf("\nConnected to NFC reader: %s\n\n",pnd->acName);
|
||||
|
||||
|
|
|
|||
|
|
@ -108,8 +108,8 @@ int main(int argc, char *argv[])
|
|||
printf("[+] Received initiator command: ");
|
||||
print_hex_bits(abtRecv,szRecvBits);
|
||||
printf("[+] Configuring communication\n");
|
||||
nfc_configure(pnd,DCO_HANDLE_CRC,false);
|
||||
nfc_configure(pnd,DCO_HANDLE_PARITY,true);
|
||||
nfc_configure(pnd,NDO_HANDLE_CRC,false);
|
||||
nfc_configure(pnd,NDO_HANDLE_PARITY,true);
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -60,17 +60,17 @@ int main(int argc, const char* argv[])
|
|||
nfc_initiator_init(pnd);
|
||||
|
||||
// Drop the field for a while
|
||||
nfc_configure(pnd,DCO_ACTIVATE_FIELD,false);
|
||||
nfc_configure(pnd,NDO_ACTIVATE_FIELD,false);
|
||||
|
||||
// Let the reader only try once to find a tag
|
||||
nfc_configure(pnd,DCO_INFINITE_SELECT,false);
|
||||
nfc_configure(pnd,NDO_INFINITE_SELECT,false);
|
||||
|
||||
// Configure the CRC and Parity settings
|
||||
nfc_configure(pnd,DCO_HANDLE_CRC,true);
|
||||
nfc_configure(pnd,DCO_HANDLE_PARITY,true);
|
||||
nfc_configure(pnd,NDO_HANDLE_CRC,true);
|
||||
nfc_configure(pnd,NDO_HANDLE_PARITY,true);
|
||||
|
||||
// Enable field so more power consuming cards can power themselves up
|
||||
nfc_configure(pnd,DCO_ACTIVATE_FIELD,true);
|
||||
nfc_configure(pnd,NDO_ACTIVATE_FIELD,true);
|
||||
|
||||
printf("Connected to NFC reader: %s\n\n",pnd->acName);
|
||||
|
||||
|
|
|
|||
|
|
@ -414,15 +414,15 @@ int main(int argc, const char* argv[])
|
|||
nfc_initiator_init(pnd);
|
||||
|
||||
// Drop the field for a while
|
||||
nfc_configure(pnd,DCO_ACTIVATE_FIELD,false);
|
||||
nfc_configure(pnd,NDO_ACTIVATE_FIELD,false);
|
||||
|
||||
// Let the reader only try once to find a tag
|
||||
nfc_configure(pnd,DCO_INFINITE_SELECT,false);
|
||||
nfc_configure(pnd,DCO_HANDLE_CRC,true);
|
||||
nfc_configure(pnd,DCO_HANDLE_PARITY,true);
|
||||
nfc_configure(pnd,NDO_INFINITE_SELECT,false);
|
||||
nfc_configure(pnd,NDO_HANDLE_CRC,true);
|
||||
nfc_configure(pnd,NDO_HANDLE_PARITY,true);
|
||||
|
||||
// Enable field so more power consuming cards can power themselves up
|
||||
nfc_configure(pnd,DCO_ACTIVATE_FIELD,true);
|
||||
nfc_configure(pnd,NDO_ACTIVATE_FIELD,true);
|
||||
|
||||
printf("Connected to NFC reader: %s\n",pnd->acName);
|
||||
|
||||
|
|
|
|||
|
|
@ -158,15 +158,15 @@ int main(int argc, const char* argv[])
|
|||
nfc_initiator_init(pnd);
|
||||
|
||||
// Drop the field for a while
|
||||
nfc_configure(pnd,DCO_ACTIVATE_FIELD,false);
|
||||
nfc_configure(pnd,NDO_ACTIVATE_FIELD,false);
|
||||
|
||||
// Let the reader only try once to find a tag
|
||||
nfc_configure(pnd,DCO_INFINITE_SELECT,false);
|
||||
nfc_configure(pnd,DCO_HANDLE_CRC,true);
|
||||
nfc_configure(pnd,DCO_HANDLE_PARITY,true);
|
||||
nfc_configure(pnd,NDO_INFINITE_SELECT,false);
|
||||
nfc_configure(pnd,NDO_HANDLE_CRC,true);
|
||||
nfc_configure(pnd,NDO_HANDLE_PARITY,true);
|
||||
|
||||
// Enable field so more power consuming cards can power themselves up
|
||||
nfc_configure(pnd,DCO_ACTIVATE_FIELD,true);
|
||||
nfc_configure(pnd,NDO_ACTIVATE_FIELD,true);
|
||||
|
||||
printf("Connected to NFC reader: %s\n",pnd->acName);
|
||||
|
||||
|
|
|
|||
|
|
@ -85,18 +85,18 @@ int main(int argc,char* argv[])
|
|||
printf("[+] For example, send a RATS command or use the \"nfc-anticol\" tool\n");
|
||||
nfc_target_init(pndTag,abtReaderRx,&szReaderRxBits);
|
||||
printf("[+] Configuring emulator settings\n");
|
||||
nfc_configure(pndTag,DCO_HANDLE_CRC,false);
|
||||
nfc_configure(pndTag,DCO_HANDLE_PARITY,false);
|
||||
nfc_configure(pndTag,DCO_ACCEPT_INVALID_FRAMES,true);
|
||||
nfc_configure(pndTag,NDO_HANDLE_CRC,false);
|
||||
nfc_configure(pndTag,NDO_HANDLE_PARITY,false);
|
||||
nfc_configure(pndTag,NDO_ACCEPT_INVALID_FRAMES,true);
|
||||
printf("[+] Thank you, the emulated tag is initialized\n");
|
||||
|
||||
// Try to open the NFC reader
|
||||
pndReader = NULL;
|
||||
while (pndReader == NULL) pndReader = nfc_connect(NULL);
|
||||
printf("[+] Configuring NFC reader settings\n");
|
||||
nfc_configure(pndReader,DCO_HANDLE_CRC,false);
|
||||
nfc_configure(pndReader,DCO_HANDLE_PARITY,false);
|
||||
nfc_configure(pndReader,DCO_ACCEPT_INVALID_FRAMES,true);
|
||||
nfc_configure(pndReader,NDO_HANDLE_CRC,false);
|
||||
nfc_configure(pndReader,NDO_HANDLE_PARITY,false);
|
||||
nfc_configure(pndReader,NDO_ACCEPT_INVALID_FRAMES,true);
|
||||
printf("[+] Done, relaying frames now!\n\n");
|
||||
|
||||
while(true)
|
||||
|
|
@ -108,10 +108,10 @@ int main(int argc,char* argv[])
|
|||
if (szReaderRxBits == 7 && abtReaderRx[0] == 0x26)
|
||||
{
|
||||
// Drop down field for a very short time (original tag will reboot)
|
||||
nfc_configure(pndReader,DCO_ACTIVATE_FIELD,false);
|
||||
nfc_configure(pndReader,NDO_ACTIVATE_FIELD,false);
|
||||
if(!quiet_output)
|
||||
printf("\n");
|
||||
nfc_configure(pndReader,DCO_ACTIVATE_FIELD,true);
|
||||
nfc_configure(pndReader,NDO_ACTIVATE_FIELD,true);
|
||||
}
|
||||
|
||||
// Print the reader frame to the screen
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue