X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/0d2c590974319db6fc54400ce153d86b68a09852..ad5bc8cc8c0a6573d6b2c7bc58bf94f7ab66ad4c:/client/cmdlfguard.c diff --git a/client/cmdlfguard.c b/client/cmdlfguard.c index 828bdb68..a6bc5e87 100644 --- a/client/cmdlfguard.c +++ b/client/cmdlfguard.c @@ -48,7 +48,7 @@ int GetGuardBits(uint32_t fc, uint32_t cn, uint8_t *guardBits) { time_t t; srand((unsigned) time(&t)); //uint8_t xorKey = rand() % 0xFF; - uint8_t xorKey = 0x6b; + uint8_t xorKey = 0x66; uint8_t i; @@ -91,12 +91,6 @@ int GetGuardBits(uint32_t fc, uint32_t cn, uint8_t *guardBits) { if (g_debugMode) printf(" WIE | %s\n", sprint_hex(rawbytes, sizeof(rawbytes))); - // NIBBLE_SWAP (works on all data) - // for (i = 0; i < 12; ++i) - // rawbytes[i] = SWAP_NIBBLE( rawbytes[i] ); - - // printf("SWAP | %s\n", sprint_hex(rawbytes, sizeof(rawbytes))); - // XOR (only works on wiegand stuff) for (i = 1; i < 12; ++i) rawbytes[i] ^= xorKey ; @@ -111,7 +105,7 @@ int GetGuardBits(uint32_t fc, uint32_t cn, uint8_t *guardBits) { if (g_debugMode) printf(" Raw | %s\n", sprint_bin(pre, 64) ); // add spacer bit 0 every 4 bits, starting with index 0, - // 12 bytes, 24 nibbles. 24+1 extra bites. 3bytes. Ie 9bytes | 1byte xorkey, 8bytes rawdata (64bits, should be enough for a 40bit wiegand) + // 12 bytes, 24 nibbles. 24+1 extra bites. 3bytes. ie 9bytes | 1byte xorkey, 8bytes rawdata (64bits, should be enough for a 40bit wiegand) addParity(pre, guardBits+6, 64, 5, 3); // preamble @@ -121,10 +115,6 @@ int GetGuardBits(uint32_t fc, uint32_t cn, uint8_t *guardBits) { guardBits[3] = 1; guardBits[4] = 1; guardBits[5] = 0; -/* 6 B -PRE | 0110 1101 0101 1110 0001 1101 1101 0111 1101011011010110110101101101011 -FIN | 111110 0 0110 0 1101 0 0101 0 1110 0 0001 0 1101 0 1101 0 0111 0 110100110011010011001101001100110100110000000000 -*/ if (g_debugMode) printf(" FIN | %s\n", sprint_bin(guardBits, 96) ); return 1; @@ -150,6 +140,7 @@ int CmdGuardClone(const char *Cmd) { uint32_t blocks[5] = {T55x7_MODULATION_BIPHASE | T55x7_BITRATE_RF_64 | 3< clone Guardall tag"}, -// {"sim", CmdGuardSim, 0, " simulate Guardall tag"}, + {"sim", CmdGuardSim, 0, " simulate Guardall tag"}, {NULL, NULL, 0, NULL} };