case RHT2F_TEST_AUTH_ATTEMPTS: {
// No additional parameters needed
} break;
+ case RHT2F_UID_ONLY: {
+ // No additional parameters needed
+ } break;
default: {
- PrintAndLog("Error: unkown reader function %d",htf);
- PrintAndLog("Hitag reader functions");
+ PrintAndLog("\nError: unkown reader function %d",htf);
+ PrintAndLog("");
+ PrintAndLog("Usage: hitag reader <Reader Function #>");
+ PrintAndLog("Reader Functions:");
PrintAndLog(" HitagS (0*)");
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(" 22 <nr> <ar> (authentication)");
PrintAndLog(" 23 <key> (authentication) key is in format: ISK high + ISK low");
PrintAndLog(" 25 (test recorded authentications)");
+ PrintAndLog(" 26 just read UID");
return 1;
} break;
}
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];
FILE* f = NULL;
sprintf(filename,"%08x_%04x.ht2",id,(rand() & 0xffff));
fwrite(resp.d.asBytes, 1, 48, f);
fclose(f);
PrintAndLog("Succesfully saved tag memory to [%s]",filename);
+ }
return 0;
}
#include "common.h"\r
#include "usb_cmd.h"\r
#include "usb_cdc.h"\r
+#include "proxmark3.h"\r
+#include "string.h"\r
\r
bool cmd_receive(UsbCommand* cmd);\r
bool cmd_send(uint32_t cmd, uint32_t arg0, uint32_t arg1, uint32_t arg2, void* data, size_t len);\r
-#include <stdint.h>
-#include <stddef.h>
#include "crc32.h"
#define htole32(x) (x)
#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) {
void crc32_append (uint8_t *data, const size_t len) {
crc32 (data, len, data + len);
-}
+}
\ No newline at end of file