mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-20 05:13:22 -07:00
Adds lf hid pack
and lf hid unpack
offline commands. (#614)
* These are used to pack and unpack the bit length, facility code and card number from "short" HID Prox IDs. * This also simplifies some repeated code that is used to parse hex digits in lfhid, and adds basic client-side validation to the `lf hid clone` and `lf hid sim` commands, for when an ID that is too long is entered. * Implements parity checks/calculation for 26-bit H10301 cards. * Adds links to useful resources for HID Prox cards. * Adds an explicit warning about the lack of parities on non-26-bit cards. * Changes all the examples to use 26-bit IDs that have a parity bit set.
This commit is contained in:
parent
913a54a86a
commit
ab20cc35b7
2 changed files with 301 additions and 56 deletions
|
@ -11,10 +11,39 @@
|
|||
#ifndef CMDLFHID_H__
|
||||
#define CMDLFHID_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
// Structure for unpacked "short" (<38 bits) HID Prox tags.
|
||||
typedef struct {
|
||||
// Format length, in bits.
|
||||
uint8_t fmtLen;
|
||||
|
||||
// Facility code.
|
||||
uint32_t fc;
|
||||
|
||||
// Card number.
|
||||
uint32_t cardnum;
|
||||
|
||||
// Parity validity.
|
||||
//
|
||||
// When used with pack_short_hid, this determines if we should calculate
|
||||
// parity values for the ID.
|
||||
//
|
||||
// When used with unpack_short_hid, this indicates if we got valid parity
|
||||
// values for the ID.
|
||||
bool parityValid;
|
||||
} short_hid_info;
|
||||
|
||||
bool pack_short_hid(/* out */ uint32_t *hi, /* out */ uint32_t *lo, /* in */ const short_hid_info *info);
|
||||
bool unpack_short_hid(short_hid_info* out, uint32_t hi, uint32_t lo);
|
||||
|
||||
int CmdLFHID(const char *Cmd);
|
||||
int CmdFSKdemodHID(const char *Cmd);
|
||||
int CmdHIDReadDemod(const char *Cmd);
|
||||
int CmdHIDSim(const char *Cmd);
|
||||
int CmdHIDClone(const char *Cmd);
|
||||
int CmdHIDPack(const char *Cmd);
|
||||
int CmdHIDUnpack(const char *Cmd);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue