X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/87342aadbc93dcef9c8dd0ba80699507d68bb9e9..25d52dd261bc454dafeedc31c9b3d62b8832b23a:/client/cmdhflegic.c diff --git a/client/cmdhflegic.c b/client/cmdhflegic.c index 2cfb286e..b52034dc 100644 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@ -404,13 +404,15 @@ int CmdLegicRFRead(const char *Cmd) { PrintAndLog("Current IV: 0x%02x", IV); // get some prng bytes from - uint8_t temp[12]; + uint8_t temp[32]; legic_prng_init(IV); - for ( uint8_t j = 0; j < sizeof(temp); ++j) - temp[j] = legic_prng_get_bits(8); - - PrintAndLog("PRNG: %s", sprint_hex(temp, sizeof(temp))); - + for ( uint8_t j = 0; j < sizeof(temp); ++j) { + temp[j] = legic_prng_get_bit(1); + legic_prng_forward(1); + //PrintAndLog("PRNG: %s", sprint_hex(temp, sizeof(temp))); + } + PrintAndLog("PRNG: %s", sprint_bin(temp, sizeof(temp))); + UsbCommand c = {CMD_READER_LEGIC_RF, {offset, len, IV}}; clearCommandBuffer(); SendCommand(&c);