]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
CHG: 'analyse hid' added @holiman 's permute functions to the output to verify
authoriceman1001 <iceman@iuse.se>
Tue, 3 Jan 2017 18:32:24 +0000 (19:32 +0100)
committericeman1001 <iceman@iuse.se>
Tue, 3 Jan 2017 18:32:24 +0000 (19:32 +0100)
client/cmdanalyse.c
client/cmdanalyse.h

index 3f967ac66a39de0069e1e43cf008d021f7fe9e83..32309c1c229135e89479874c28a860ff4c99fa4e 100644 (file)
@@ -445,6 +445,9 @@ static void generate(uint8_t *data, uint8_t len) {
 }
 int CmdAnalyseHid(const char *Cmd){
 
+       uint8_t key[8] = {0};   
+       uint8_t key_std_format[8] = {0};
+       uint8_t key_iclass_format[8] = {0};
        uint8_t data[16] = {0};
        bool isReverse = FALSE;
        int len = 0;
@@ -457,12 +460,20 @@ int CmdAnalyseHid(const char *Cmd){
        param_gethex_ex(Cmd, 1, data, &len);
        if ( len%2 ) return usage_analyse_hid();
        
-       len >>= 1;
-       
-       if ( isReverse )
+       len >>= 1;      
+
+       memcpy(key, data, 8);
+
+       if ( isReverse ) {
                generate_rev(data, len);
-       else 
+               permutekey_rev(key, key_std_format);
+               printf(" holiman iclass key | %s \n", sprint_hex(key_std_format, 8));
+       }
+       else {
                generate(data, len);
+               permutekey(key, key_iclass_format);             
+               printf(" holiman std key | %s \n", sprint_hex(key_iclass_format, 8));
+       }
        return 0;
 }
 
index e5bb227c42b706c1213e8118f856530116d986f6..70e472cdd30b2d05e4f2af4cbda9d3a781070bcb 100644 (file)
@@ -21,6 +21,7 @@
 #include "../common/iso15693tools.h"
 #include "tea.h"
 #include "../include/legic_prng.h"
+#include "loclass/elite_crack.h"
 
 int usage_analyse_lcr(void);
 int usage_analyse_checksum(void);
Impressum, Datenschutz