]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlffdx.c
CHG: @Marshmellow42 's fixes. ref: https://github.com/marshmellow42/proxmark3/commi...
[proxmark3-svn] / client / cmdlffdx.c
index 511806ddb64eca8b221574378bc8861019aff0a3..17f50ab148a227ab559329514dd6f975d3812654 100644 (file)
@@ -175,8 +175,8 @@ int CmdFdxDemod(const char *Cmd) {
        uint16_t calcCrc = crc16_ccitt_kermit(raw, 8);
        
        PrintAndLog("\nFDX-B / ISO 11784/5 Animal Tag ID Found:  Raw : %s", sprint_hex(raw, 8));
-       PrintAndLog("Animal ID          %04u-%012llu", countryCode, NationalCode);
-       PrintAndLog("National Code      %012llu (0x%llX)", NationalCode, NationalCode);
+       PrintAndLog("Animal ID          %04u-%012" PRIu64, countryCode, NationalCode);
+       PrintAndLog("National Code      %012" PRIu64 " (0x%" PRIx64 ")", NationalCode, NationalCode);
        PrintAndLog("Country Code       %04u", countryCode);
        PrintAndLog("Reserved/RFU       %u (0x04%X)", reservedCode,  reservedCode);
        PrintAndLog("");
@@ -202,7 +202,7 @@ int CmdFdxClone(const char *Cmd) {
 
        uint32_t countryid = 0;
        uint64_t animalid = 0;
-       uint32_t blocks[5] = {T55x7_MODULATION_DIPHASE | T55x7_BITRATE_RF_32 | 4<<T55x7_MAXBLOCK_SHIFT, 0, 0, 0, 0};
+       uint32_t blocks[5] = {T55x7_MODULATION_DIPHASE | T55x7_BITRATE_RF_32 | 4 << T55x7_MAXBLOCK_SHIFT, 0, 0, 0, 0};
        uint8_t bits[128];
        uint8_t *bs = bits;
        memset(bs, 0, sizeof(bits));
@@ -214,9 +214,9 @@ int CmdFdxClone(const char *Cmd) {
        animalid = param_get64ex(Cmd, 1, 0, 10);
        
        //Q5
-       if (param_getchar(Cmd, 1) == 'Q' || param_getchar(Cmd, 1) == 'q') {
+       if (param_getchar(Cmd, 2) == 'Q' || param_getchar(Cmd, 2) == 'q') {
                //t5555 (Q5) BITRATE = (RF-2)/2 (iceman)
-               blocks[0] = T5555_MODULATION_BIPHASE | T5555_INVERT_OUTPUT | 32<<T5555_BITRATE_SHIFT | 4<<T5555_MAXBLOCK_SHIFT;
+               blocks[0] = T5555_MODULATION_BIPHASE | T5555_INVERT_OUTPUT | ((32-2)>>1) << T5555_BITRATE_SHIFT | 4 << T5555_MAXBLOCK_SHIFT;
        }
        
        verify_values(countryid, animalid);
@@ -250,7 +250,7 @@ int CmdFdxClone(const char *Cmd) {
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
-               if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)){
+               if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)){
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
Impressum, Datenschutz