1
0
mirror of synced 2024-11-30 16:24:27 +01:00
bananatools/iccard/mifare.h
2023-09-25 03:16:26 -04:00

29 lines
554 B
C

#pragma once
#include <stdint.h>
enum mifare_cmd {
MIFARE_CMD_AUTH_KEY_A = 0x60,
MIFARE_CMD_AUTH_KEY_B = 0x61,
MIFARE_CMD_PERSONALIZE_UID = 0x40,
MIFARE_CMD_SET_MOD_TYPE = 0x43,
MIFARE_CMD_READ = 0x30,
MIFARE_CMD_WRITE = 0xA0,
MIFARE_CMD_DECREMENT = 0xC0,
MIFARE_CMD_INCREMENT = 0xC1,
MIFARE_CMD_RESTORE = 0xC2,
MIFARE_CMD_TRANSFER = 0xB0,
};
struct mifare_block {
uint8_t bytes[16];
};
struct mifare_sector {
struct mifare_block blocks[4];
};
struct mifare {
struct mifare_sector sectors[16];
};