]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Changes requested by @marshmellow42
authorgrauerfuchs <42082416+grauerfuchs@users.noreply.github.com>
Fri, 14 Sep 2018 01:05:11 +0000 (21:05 -0400)
committergrauerfuchs <42082416+grauerfuchs@users.noreply.github.com>
Fri, 14 Sep 2018 01:05:11 +0000 (21:05 -0400)
Added CHANGELOG details for new lf hid commands
Restored basic ARM-side decoding of 26-bit and 35-bit cards

CHANGELOG.md
armsrc/lfops.c

index da6463e91bd755c96bc1ba51690ac5d29e51e483..3b454f64f8c99b07cfc5780aa1b29f558e7082c0 100644 (file)
@@ -18,6 +18,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac
 - Changed `hf 14a raw` - works with LED's and some exchange logic (Merlok)
 - Changed TLV parser messages to more convenient (Merlok)
 - Rewritten Legic Prime reader (`hf legic reader`, `write` and `fill`) - it is using xcorrelation now (AntiCat)
+- HID LF operations on firmware updated for complete native support of long (>37 bit) HID tags (grauerfuchs)
 
 ### Fixed
 - Changed start sequence in Qt mode (fix: short commands hangs main Qt thread) (Merlok)
@@ -52,6 +53,8 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac
 - Added to `hf emv exec` SDA, DDA, fast DDA, CDA calculations for VISA and Mastercard and some other compatible EMV cards (Merlok)
 - Added `hf emv test` - crypto tests for DES, AES, SHA, RSA, SDA, DDA, CDA and some other crypto functions (Merlok)
 - Added `hf list mf` - deciphers crypto1 stream and works with first authentication and weak nested authentications (Merlok)
+- Added `lf hid encode` and `lf hid decode` commands to translate printed HID card data to and from the packed data transmitted by a prox tag (grauerfuchs)
+- Added `lf hid write` command, which operates as a macro for encode followed by clone operations (grauerfuchs)
 
 ## [3.0.1][2017-06-08]
 
@@ -229,5 +232,3 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac
 ### Added
 - iClass functionality: full simulation of iclass tags, so tags can be simulated with data (not only CSN). Not yet support for write/update, but readers don't seem to enforce update. (holiman).
 - iClass decryption. Proxmark can now decrypt data on an iclass tag, but requires you to have the HID decryption key locally on your computer, as this is not bundled with the sourcecode. 
-
-
index 7ad4dabe130dbe8e863fd5ce2bd007498158788b..c0134778b485108f0bc7ce7d5a421f871fc9e430 100644 (file)
@@ -876,7 +876,6 @@ void CmdHIDdemodFSK(int findone, int *high2, int *high, int *low, int ledcontrol
        BigBuf_Clear_keep_EM();
 
        while(!BUTTON_PRESS() && !usb_poll_validate_length()) {
-
                WDT_HIT();
                if (ledcontrol) LED_A_ON();
 
@@ -887,13 +886,67 @@ void CmdHIDdemodFSK(int findone, int *high2, int *high, int *low, int ledcontrol
                idx = HIDdemodFSK(dest, &size, &hi2, &hi, &lo, &dummyIdx);
                
                if (idx>0 && lo>0 && (size==96 || size==192)){
+                       uint8_t bitlen = 0;
+                       uint32_t fc = 0;
+                       uint32_t cardnum = 0;
+                       bool decoded = false;
+
                        // go over previously decoded manchester data and decode into usable tag ID
-                       if (hi2 != 0){ //extra large HID tags  88/192 bits
-                               Dbprintf("TAG ID: %x%08x%08x (%d)",
-                                 (unsigned int) hi2, (unsigned int) hi, (unsigned int) lo, (unsigned int) (lo>>1) & 0xFFFF);
-                       } else {  //standard HID tags 44/96 bits
-                               Dbprintf("TAG ID: %x%08x (%d)",(unsigned int) hi, (unsigned int) lo, (unsigned int) (lo>>1) & 0xFFFF); //old print cmd
+                       if ((hi2 & 0x000FFFF) != 0){ //extra large HID tags  88/192 bits
+                               uint32_t bp = hi2 & 0x000FFFFF;
+                               bitlen = 63;
+                               while (bp > 0) {
+                                       bp = bp >> 1;
+                                       bitlen++;
+                               }
+                       } else if ((hi >> 6) > 0) {
+                               uint32_t bp = hi;
+                               bitlen = 31;
+                               while (bp > 0) {
+                                       bp = bp >> 1;
+                                       bitlen++;
+                               }
+                       } else if (((hi >> 5) & 1) == 0) {
+                               bitlen = 37;
+                       } else if ((hi & 0x0000001F) > 0 ) {
+                               uint32_t bp = (hi & 0x0000001F);
+                               bitlen = 31;
+                               while (bp > 0) {
+                                       bp = bp >> 1;
+                                       bitlen++;
+                               }
+                       } else {
+                               uint32_t bp = lo;
+                               bitlen = 0;
+                               while (bp > 0) {
+                                       bp = bp >> 1;
+                                       bitlen++;
+                               }
+                       }
+                       switch (bitlen){
+                               case 26:
+                                       cardnum = (lo>>1)&0xFFFF;
+                                       fc = (lo>>17)&0xFF;
+                                       decoded = true;
+                                       break;
+                               case 35:
+                                       cardnum = (lo>>1)&0xFFFFF;
+                                       fc = ((hi&1)<<11)|(lo>>21);
+                                       decoded = true;
+                                       break;
                        }
+                               
+                       if (hi2 != 0) //extra large HID tags  88/192 bits
+                               Dbprintf("TAG ID: %x%08x%08x (%d)",
+                                       (unsigned int) hi2, (unsigned int) hi, (unsigned int) lo, (unsigned int) (lo>>1) & 0xFFFF);
+                       else 
+                               Dbprintf("TAG ID: %x%08x (%d)",
+                                       (unsigned int) hi, (unsigned int) lo, (unsigned int) (lo>>1) & 0xFFFF);
+                       
+                       if (decoded)
+                               Dbprintf("Format Len: %dbits - FC: %d - Card: %d",
+                                       (unsigned int) bitlen, (unsigned int) fc, (unsigned int) cardnum);
+
                        if (findone){
                                if (ledcontrol) LED_A_OFF();
                                *high2 = hi2;
Impressum, Datenschutz