X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/32da0a464e03b39f894ecfe04cee0da114ff0c9a..2d3f8e5fa7e5a775cef24b526a85465cd7d125b5:/client/cmdanalyse.c?ds=sidebyside diff --git a/client/cmdanalyse.c b/client/cmdanalyse.c index 3f967ac6..32309c1c 100644 --- a/client/cmdanalyse.c +++ b/client/cmdanalyse.c @@ -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; }