mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-07 13:41:18 -07:00
add bitswap option for lf em 4x05write
default read mode of this chip outputs in reverse order... so offer the option to program in reverse order
This commit is contained in:
parent
8b6abef506
commit
713045f819
3 changed files with 30 additions and 14 deletions
|
@ -245,6 +245,15 @@ void num_to_bytebitsLSBF(uint64_t n, size_t len, uint8_t *dest) {
|
|||
}
|
||||
}
|
||||
|
||||
// Swap bit order on a uint32_t value. Can be limited by nrbits just use say 8bits reversal
|
||||
// And clears the rest of the bits.
|
||||
uint32_t SwapBits(uint32_t value, int nrbits) {
|
||||
uint32_t newvalue = 0;
|
||||
for(int i = 0; i < nrbits; i++) {
|
||||
newvalue ^= ((value >> i) & 1) << (nrbits - 1 - i);
|
||||
}
|
||||
return newvalue;
|
||||
}
|
||||
|
||||
// aa,bb,cc,dd,ee,ff,gg,hh, ii,jj,kk,ll,mm,nn,oo,pp
|
||||
// to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue