Adds `lf hid pack` and `lf hid unpack` offline commands. (#614)
[proxmark3-svn] / client / cmdlfhid.h
1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2010 iZsh <izsh at fail0verflow.com>
3 //
4 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
5 // at your option, any later version. See the LICENSE.txt file for the text of
6 // the license.
7 //-----------------------------------------------------------------------------
8 // Low frequency HID commands
9 //-----------------------------------------------------------------------------
10
11 #ifndef CMDLFHID_H__
12 #define CMDLFHID_H__
13
14 #include <stdint.h>
15 #include <stdbool.h>
16
17 // Structure for unpacked "short" (<38 bits) HID Prox tags.
18 typedef struct {
19 // Format length, in bits.
20 uint8_t fmtLen;
21
22 // Facility code.
23 uint32_t fc;
24
25 // Card number.
26 uint32_t cardnum;
27
28 // Parity validity.
29 //
30 // When used with pack_short_hid, this determines if we should calculate
31 // parity values for the ID.
32 //
33 // When used with unpack_short_hid, this indicates if we got valid parity
34 // values for the ID.
35 bool parityValid;
36 } short_hid_info;
37
38 bool pack_short_hid(/* out */ uint32_t *hi, /* out */ uint32_t *lo, /* in */ const short_hid_info *info);
39 bool unpack_short_hid(short_hid_info* out, uint32_t hi, uint32_t lo);
40
41 int CmdLFHID(const char *Cmd);
42 int CmdFSKdemodHID(const char *Cmd);
43 int CmdHIDReadDemod(const char *Cmd);
44 int CmdHIDSim(const char *Cmd);
45 int CmdHIDClone(const char *Cmd);
46 int CmdHIDPack(const char *Cmd);
47 int CmdHIDUnpack(const char *Cmd);
48
49 #endif
Impressum, Datenschutz