tokens

package
v0.0.0-...-0d94b02 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIFARE_WRITABLE_SECTOR_COUNT      = 15
	MIFARE_WRITABLE_BLOCKS_PER_SECTOR = 3
	MIFARE_BLOCK_SIZE_BYTES           = 16
)
View Source
const (
	NTAG_213_CAPACITY_BYTES = 114
	NTAG_213_IDENTIFIER     = 0x12

	NTAG_215_CAPACITY_BYTES = 496
	NTAG_215_IDENTIFIER     = 0x3E

	NTAG_216_CAPACITY_BYTES = 872
	NTAG_216_IDENTIFIER     = 0x6D
)
View Source
const (
	TypeNTAG           = "NTAG"
	TypeMifare         = "MIFARE"
	TypeAmiibo         = "Amiibo"
	TypeLegoDimensions = "LegoDimensions"
	WRITE_COMMAND      = byte(0xA2)
	READ_COMMAND       = byte(0x30)
)

Variables

View Source
var AMIIBO_MATCHER = []byte{
	0x48, 0x0F, 0xE0,
	0xF1, 0x10, 0xFF, 0xEE}

Can be identified by matching address 0x09-0x0F

View Source
var LEGO_DIMENSIONS_MATCHER = []byte{

	0x01, 0x03, 0xA0, 0x0C,
	0x34, 0x03, 0x13, 0xD1,
	0x01, 0x0F, 0x54, 0x02,
	0x65, 0x6E}

Can be identified by matching blocks 0x03-0x07 https://github.com/RfidResearchGroup/proxmark3/blob/master/client/src/cmdhfmfu.c

View Source
var NDEF_END = []byte{0xFE}
View Source
var NDEF_START = []byte{0x54, 0x02, 0x65, 0x6E}
View Source
var SupportedCardTypes = []nfc.Modulation{
	{Type: nfc.ISO14443a, BaudRate: nfc.Nbr106},
}

Functions

func BuildMessage

func BuildMessage(text string) ([]byte, error)

func CalculateNdefHeader

func CalculateNdefHeader(ndefRecord []byte) ([]byte, error)

func GetCardType

func GetCardType(target nfc.Target) string

func GetCardUID

func GetCardUID(target nfc.Target) string

func ParseRecordText

func ParseRecordText(blocks []byte) (string, error)

func WriteMifare

func WriteMifare(pnd nfc.Device, text string, cardUid string) ([]byte, error)

WriteMifare writes the given text string to a Mifare card starting from sector, skipping any trailer blocks

func WriteNtag

func WriteNtag(pnd nfc.Device, text string) ([]byte, error)

Types

type TagData

type TagData struct {
	Type  string
	Bytes []byte
}

func ReadMifare

func ReadMifare(pnd nfc.Device, cardUid string) (TagData, error)

ReadMifare reads data from all blocks in sectors 1-15

func ReadNtag

func ReadNtag(pnd nfc.Device) (TagData, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL