mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
add: 'wiegand commands' - wiegand manipulation like encoding / decoding of credentials. From offical repo (@grauerfuchs)
Adapted and converted to fit this repo.
This commit is contained in:
parent
d3651cc075
commit
7abc10c63a
9 changed files with 1243 additions and 1 deletions
|
@ -878,3 +878,20 @@ char *strmcopy(const char *buf) {
|
|||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a hex string to component "hi2", "hi" and "lo" 32-bit integers, one nibble
|
||||
* at a time.
|
||||
*
|
||||
* Returns the number of nibbles (4 bits) entered.
|
||||
*/
|
||||
int hexstring_to_u96(uint32_t* hi2, uint32_t* hi, uint32_t* lo, const char* str) {
|
||||
int n = 0, i = 0;
|
||||
|
||||
while (sscanf(&str[i++], "%1x", &n ) == 1) {
|
||||
*hi2 = (*hi2 << 4) | (*hi >> 28);
|
||||
*hi = (*hi << 4) | (*lo >> 28);
|
||||
*lo = (*lo << 4) | (n & 0xf);
|
||||
}
|
||||
return i - 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue