1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 04:34:43 +04:00
Files
unleashed-firmware/applications/main/nfc/api/gallagher/gallagher_util.h
hedger ffa3996a5e [FL-3867] Code formatting update (#3765)
* clang-format: AllowShortEnumsOnASingleLine: false
* clang-format: InsertNewlineAtEOF: true
* clang-format: Standard:        c++20
* clang-format: AlignConsecutiveBitFields
* clang-format: AlignConsecutiveMacros
* clang-format: RemoveParentheses: ReturnStatement
* clang-format: RemoveSemicolon: true
* Restored RemoveParentheses: Leave, retained general changes for it
* formatting: fixed logging TAGs
* Formatting update for dev

Co-authored-by: あく <alleteam@gmail.com>
2024-07-15 13:38:49 +09:00

34 lines
755 B
C

/* gallagher_util.h - Utilities for parsing Gallagher cards (New Zealand).
* Author: Nick Mooney (nick@mooney.nz)
*
* Reference: https://github.com/megabug/gallagher-research
*/
#pragma once
#include <lib/nfc/protocols/mf_classic/mf_classic.h>
#define GALLAGHER_CREDENTIAL_SECTOR 15
#ifdef __cplusplus
extern "C" {
#endif
extern const uint8_t GALLAGHER_DECODE_TABLE[256];
extern const uint8_t GALLAGHER_CARDAX_ASCII[MF_CLASSIC_BLOCK_SIZE];
typedef struct GallagherCredential {
uint8_t region;
uint8_t issue;
uint16_t facility;
uint32_t card;
} GallagherCredential;
void gallagher_deobfuscate_and_parse_credential(
GallagherCredential* credential,
const uint8_t* cardholder_data_obfuscated);
#ifdef __cplusplus
}
#endif