mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-12 19:23:54 +08:00
em: display nr of flips
This commit is contained in:
parent
b589699c38
commit
d4e6a5b7a6
1 changed files with 6 additions and 1 deletions
|
@ -2013,7 +2013,12 @@ static int CmdEM4x05Unlock(const char *Cmd) {
|
|||
for (int i=0; i < 8; i++) {
|
||||
bitstring[i] = bitflips & (0xF << ((7-i) * 4)) ? 'x' : '.';
|
||||
}
|
||||
PrintAndLogEx(INFO, "Bitflips => %s", bitstring);
|
||||
// compute number of bits flipped
|
||||
uint32_t i = bitflips;
|
||||
i = i - ((i >> 1) & 0x55555555);
|
||||
i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
|
||||
i = (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
|
||||
PrintAndLogEx(INFO, "Bitflips: %2u events => %s", i, bitstring);
|
||||
PrintAndLogEx(INFO, "New protection word => " _CYAN_("%08X") "\n", word14b);
|
||||
PrintAndLogEx(INFO, "Try " _YELLOW_("`lf em 4x05_dump`"));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue