+ uint8_t get_pack[] = {0,0};
+ iso14a_card_select_t card;
+ //attempt to read pack
+ if (!ul_auth_select( &card, tagtype, hasAuthKey, authKeyPtr, get_pack, sizeof(get_pack))) {
+ //reset pack
+ get_pack[0]=0;
+ get_pack[1]=0;
+ }
+ ul_switch_off_field();
+ // add pack to block read
+ memcpy(data + (Pages*4) - 4, get_pack, sizeof(get_pack));
+
+ uint8_t dump_file_data[1024+DUMP_PREFIX_LENGTH] = {0x00};
+ uint8_t get_version[] = {0,0,0,0,0,0,0,0,0};
+ uint8_t get_tearing[] = {0,0,0};
+ uint8_t get_counter[] = {0,0,0};
+ uint8_t dummy_pack[] = {0,0};
+ uint8_t get_signature[32];
+ memset( get_signature, 0, sizeof(get_signature) );
+
+ if ( hasAuthKey )
+ ul_auth_select( &card, tagtype, hasAuthKey, authKeyPtr, dummy_pack, sizeof(dummy_pack));
+ else
+ ul_select(&card);
+
+ ulev1_getVersion( get_version, sizeof(get_version) );
+ for ( uint8_t i = 0; i<3; ++i) {
+ ulev1_readTearing(i, get_tearing+i, 1);
+ ulev1_readCounter(i, get_counter, sizeof(get_counter) );
+ }
+ ul_switch_off_field();
+ if ( hasAuthKey )
+ ul_auth_select( &card, tagtype, hasAuthKey, authKeyPtr, dummy_pack, sizeof(dummy_pack));
+ else
+ ul_select(&card);
+ ulev1_readSignature( get_signature, sizeof(get_signature));
+ ul_switch_off_field();
+ //get version
+ memcpy(dump_file_data, get_version, sizeof(get_version));
+ //tearing
+ memcpy(dump_file_data+10, get_tearing, sizeof(get_tearing));
+ //pack
+ memcpy(dump_file_data+13, get_pack, sizeof(get_pack));
+ //signature
+ memcpy(dump_file_data+16, get_signature, sizeof(get_signature));
+ //block read data
+ memcpy(dump_file_data+DUMP_PREFIX_LENGTH, data, Pages*4);
+
+ PrintAndLog("\nDataType| Data | | Ascii");
+ PrintAndLog("---------------------------------");
+ PrintAndLog("GetVer-1| %s| | %.4s", sprint_hex(dump_file_data, 4), dump_file_data);
+ PrintAndLog("GetVer-2| %s| | %.4s", sprint_hex(dump_file_data+4, 4), dump_file_data+4);
+ PrintAndLog("TBD | 00 00 | | ");
+ PrintAndLog("Tearing | %s| | %.3s", sprint_hex(dump_file_data+10, 3), dump_file_data+10);
+ PrintAndLog("Pack | %s | | %.2s", sprint_hex(dump_file_data+13, 2), dump_file_data+13);
+ PrintAndLog("TBD | 00 | | ");
+ PrintAndLog("Sig-1 | %s| | %.4s", sprint_hex(dump_file_data+16, 4), dump_file_data+16);
+ PrintAndLog("Sig-2 | %s| | %.4s", sprint_hex(dump_file_data+20, 4), dump_file_data+20);
+ PrintAndLog("Sig-3 | %s| | %.4s", sprint_hex(dump_file_data+24, 4), dump_file_data+24);
+ PrintAndLog("Sig-4 | %s| | %.4s", sprint_hex(dump_file_data+28, 4), dump_file_data+28);
+ PrintAndLog("Sig-5 | %s| | %.4s", sprint_hex(dump_file_data+32, 4), dump_file_data+32);
+ PrintAndLog("Sig-6 | %s| | %.4s", sprint_hex(dump_file_data+36, 4), dump_file_data+36);
+ PrintAndLog("Sig-7 | %s| | %.4s", sprint_hex(dump_file_data+40, 4), dump_file_data+40);
+ PrintAndLog("Sig-8 | %s| | %.4s", sprint_hex(dump_file_data+44, 4), dump_file_data+44);
+