2019-08-08 22:57:33 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
2022-01-06 09:19:46 +08:00
|
|
|
// Copyright (C) Gerhard de Koning Gans - May 2008
|
|
|
|
// Contribution made during a security research at Radboud University Nijmegen
|
|
|
|
// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
|
2019-08-08 22:57:33 +08:00
|
|
|
//
|
2022-01-06 09:19:46 +08:00
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// See LICENSE.txt for the text of the license.
|
2019-08-08 22:57:33 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#ifndef __ICLASS_H
|
|
|
|
#define __ICLASS_H
|
|
|
|
|
|
|
|
#include "common.h"
|
2022-01-04 05:08:55 +08:00
|
|
|
#include "iclass_cmd.h"
|
2019-08-08 22:57:33 +08:00
|
|
|
|
2020-07-04 03:33:17 +08:00
|
|
|
void SniffIClass(uint8_t jam_search_len, uint8_t *jam_search_string);
|
2021-01-28 19:05:32 +08:00
|
|
|
void ReaderIClass(uint8_t flags);
|
2020-07-15 05:12:28 +08:00
|
|
|
|
2020-07-29 17:02:30 +08:00
|
|
|
void iClass_WriteBlock(uint8_t *msg);
|
|
|
|
void iClass_Dump(uint8_t *msg);
|
|
|
|
|
2020-10-14 23:41:34 +08:00
|
|
|
void iClass_Restore(iclass_restore_req_t *msg);
|
2019-08-08 22:57:33 +08:00
|
|
|
|
2020-07-29 21:29:30 +08:00
|
|
|
int do_iclass_simulation_nonsec(void);
|
2020-07-15 17:35:27 +08:00
|
|
|
int do_iclass_simulation(int simulationMode, uint8_t *reader_mac_buf);
|
2020-07-14 21:43:54 +08:00
|
|
|
void SimulateIClass(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain);
|
|
|
|
void iclass_simulate(uint8_t sim_type, uint8_t num_csns, bool send_reply, uint8_t *datain, uint8_t *dataout, uint16_t *dataoutlen);
|
2020-07-15 05:12:28 +08:00
|
|
|
|
2021-05-04 02:01:12 +08:00
|
|
|
void iClass_Authentication_fast(iclass_chk_t *p);
|
2020-07-29 17:02:30 +08:00
|
|
|
bool iclass_auth(iclass_auth_req_t *payload, uint8_t *out);
|
|
|
|
|
|
|
|
void iClass_ReadBlock(uint8_t *msg);
|
2023-01-04 21:27:00 +08:00
|
|
|
bool iclass_read_block(uint16_t blockno, uint8_t *data, uint32_t *start_time, uint32_t *eof_time, bool shallow_mod);
|
2020-07-29 17:02:30 +08:00
|
|
|
|
2023-01-04 21:27:00 +08:00
|
|
|
bool select_iclass_tag(picopass_hdr_t *hdr, bool use_credit_key, uint32_t *eof_time, bool shallow_mod);
|
2021-04-08 15:34:11 +08:00
|
|
|
bool authenticate_iclass_tag(iclass_auth_req_t *payload, picopass_hdr_t *hdr, uint32_t *start_time, uint32_t *eof_time, uint8_t *mac_out);
|
2019-08-08 22:57:33 +08:00
|
|
|
#endif
|