mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
FIX: 'lf hitag2' forgot to add some of @marshmellow42 's changes. Lf search should works just fine now.
This commit is contained in:
parent
69784c3801
commit
1b75698cb7
7 changed files with 32 additions and 11 deletions
|
@ -222,9 +222,14 @@ int CmdLFHitagReader(const char *Cmd) {
|
||||||
case RHT2F_TEST_AUTH_ATTEMPTS: {
|
case RHT2F_TEST_AUTH_ATTEMPTS: {
|
||||||
// No additional parameters needed
|
// No additional parameters needed
|
||||||
} break;
|
} break;
|
||||||
|
case RHT2F_UID_ONLY: {
|
||||||
|
// No additional parameters needed
|
||||||
|
} break;
|
||||||
default: {
|
default: {
|
||||||
PrintAndLog("Error: unkown reader function %d",htf);
|
PrintAndLog("\nError: unkown reader function %d",htf);
|
||||||
PrintAndLog("Hitag reader functions");
|
PrintAndLog("");
|
||||||
|
PrintAndLog("Usage: hitag reader <Reader Function #>");
|
||||||
|
PrintAndLog("Reader Functions:");
|
||||||
PrintAndLog(" HitagS (0*)");
|
PrintAndLog(" HitagS (0*)");
|
||||||
PrintAndLog(" 01 <nr> <ar> (Challenge) read all pages from a Hitag S tag");
|
PrintAndLog(" 01 <nr> <ar> (Challenge) read all pages from a Hitag S tag");
|
||||||
PrintAndLog(" 02 <key> (set to 0 if no authentication is needed) read all pages from a Hitag S tag");
|
PrintAndLog(" 02 <key> (set to 0 if no authentication is needed) read all pages from a Hitag S tag");
|
||||||
|
@ -234,6 +239,7 @@ int CmdLFHitagReader(const char *Cmd) {
|
||||||
PrintAndLog(" 22 <nr> <ar> (authentication)");
|
PrintAndLog(" 22 <nr> <ar> (authentication)");
|
||||||
PrintAndLog(" 23 <key> (authentication) key is in format: ISK high + ISK low");
|
PrintAndLog(" 23 <key> (authentication) key is in format: ISK high + ISK low");
|
||||||
PrintAndLog(" 25 (test recorded authentications)");
|
PrintAndLog(" 25 (test recorded authentications)");
|
||||||
|
PrintAndLog(" 26 just read UID");
|
||||||
return 1;
|
return 1;
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
@ -250,6 +256,9 @@ int CmdLFHitagReader(const char *Cmd) {
|
||||||
|
|
||||||
uint32_t id = bytes_to_num(resp.d.asBytes,4);
|
uint32_t id = bytes_to_num(resp.d.asBytes,4);
|
||||||
|
|
||||||
|
if (htf == RHT2F_UID_ONLY){
|
||||||
|
PrintAndLog("Valid Hitag2 tag found - UID: %08x",id);
|
||||||
|
} else {
|
||||||
char filename[FILE_PATH_SIZE];
|
char filename[FILE_PATH_SIZE];
|
||||||
FILE* f = NULL;
|
FILE* f = NULL;
|
||||||
sprintf(filename,"%08x_%04x.ht2",id,(rand() & 0xffff));
|
sprintf(filename,"%08x_%04x.ht2",id,(rand() & 0xffff));
|
||||||
|
@ -263,6 +272,7 @@ int CmdLFHitagReader(const char *Cmd) {
|
||||||
fwrite(resp.d.asBytes, 1, 48, f);
|
fwrite(resp.d.asBytes, 1, 48, f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
PrintAndLog("Succesfully saved tag memory to [%s]",filename);
|
PrintAndLog("Succesfully saved tag memory to [%s]",filename);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "cmd.h"
|
#include "cmd.h"
|
||||||
#include "string.h"
|
|
||||||
#include "proxmark3.h"
|
|
||||||
|
|
||||||
bool cmd_receive(UsbCommand* cmd) {
|
bool cmd_receive(UsbCommand* cmd) {
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "usb_cmd.h"
|
#include "usb_cmd.h"
|
||||||
#include "usb_cdc.h"
|
#include "usb_cdc.h"
|
||||||
|
#include "proxmark3.h"
|
||||||
|
#include "string.h"
|
||||||
|
|
||||||
bool cmd_receive(UsbCommand* cmd);
|
bool cmd_receive(UsbCommand* cmd);
|
||||||
bool cmd_send(uint32_t cmd, uint32_t arg0, uint32_t arg1, uint32_t arg2, void* data, size_t len);
|
bool cmd_send(uint32_t cmd, uint32_t arg0, uint32_t arg1, uint32_t arg2, void* data, size_t len);
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
#include <stdint.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include "crc32.h"
|
#include "crc32.h"
|
||||||
|
|
||||||
#define htole32(x) (x)
|
#define htole32(x) (x)
|
||||||
#define CRC32_PRESET 0xFFFFFFFF
|
#define CRC32_PRESET 0xFFFFFFFF
|
||||||
|
|
||||||
|
|
||||||
static void crc32_byte (uint32_t *crc, const uint8_t value);
|
static void crc32_byte (uint32_t *crc, const uint8_t value);
|
||||||
|
|
||||||
static void crc32_byte (uint32_t *crc, const uint8_t value) {
|
static void crc32_byte (uint32_t *crc, const uint8_t value) {
|
||||||
|
@ -32,4 +29,4 @@ void crc32 (const uint8_t *data, const size_t len, uint8_t *crc) {
|
||||||
|
|
||||||
void crc32_append (uint8_t *data, const size_t len) {
|
void crc32_append (uint8_t *data, const size_t len) {
|
||||||
crc32 (data, len, data + len);
|
crc32 (data, len, data + len);
|
||||||
}
|
}
|
|
@ -9,7 +9,19 @@
|
||||||
#ifndef __CRC32_H
|
#ifndef __CRC32_H
|
||||||
#define __CRC32_H
|
#define __CRC32_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
void crc32 (const uint8_t *data, const size_t len, uint8_t *crc);
|
void crc32 (const uint8_t *data, const size_t len, uint8_t *crc);
|
||||||
void crc32_append (uint8_t *data, const size_t len);
|
void crc32_append (uint8_t *data, const size_t len);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
#include <string.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include "protocols.h"
|
#include "protocols.h"
|
||||||
|
|
||||||
// ATA55xx shared presets & routines
|
// ATA55xx shared presets & routines
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
#ifndef PROTOCOLS_H
|
#ifndef PROTOCOLS_H
|
||||||
#define PROTOCOLS_H
|
#define PROTOCOLS_H
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
|
||||||
//The following data is taken from http://www.proxmark.org/forum/viewtopic.php?pid=13501#p13501
|
//The following data is taken from http://www.proxmark.org/forum/viewtopic.php?pid=13501#p13501
|
||||||
/*
|
/*
|
||||||
ISO14443A (usually NFC tags)
|
ISO14443A (usually NFC tags)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue