mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
FIX: 'mfu authentication' bug where the pack-length was wrong
ADD: 'hf mfu restore' - added a restore from file command, see helptext for instructions CHG: some help-text updates and refactored to functions CHG: 'hf mfu gen' - added the possibility to read uid from card as input CHG: 'hf mfu dump' - refactored out the dump-printing
This commit is contained in:
+12
-10
@@ -143,6 +143,14 @@ int usage_hf14_keybrute(void){
|
||||
PrintAndLog(" hf mf keybrute 1 A 000011223344");
|
||||
return 0;
|
||||
}
|
||||
int usage_hf14_restore(void){
|
||||
PrintAndLog("Usage: hf mf restore [card memory]");
|
||||
PrintAndLog(" [card memory]: 0 = 320 bytes (Mifare Mini), 1 = 1K (default), 2 = 2K, 4 = 4K");
|
||||
PrintAndLog("");
|
||||
PrintAndLog("Samples: hf mf restore");
|
||||
PrintAndLog(" hf mf restore 4");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int usage_hf14_eget(void){
|
||||
PrintAndLog("Usage: hf mf eget <block number>");
|
||||
@@ -188,7 +196,7 @@ int usage_hf14_ecfill(void){
|
||||
PrintAndLog(" hf mf ecfill A 4");
|
||||
return 0;
|
||||
}
|
||||
int usage_hf14a_ekeyprn(void){
|
||||
int usage_hf14_ekeyprn(void){
|
||||
PrintAndLog("It prints the keys loaded in the emulator memory");
|
||||
PrintAndLog("Usage: hf mf ekeyprn [card memory]");
|
||||
PrintAndLog(" [card memory]: 0 = 320 bytes (Mifare Mini), 1 = 1K (default), 2 = 2K, 4 = 4K");
|
||||
@@ -772,14 +780,8 @@ int CmdHF14AMfRestore(const char *Cmd) {
|
||||
char cmdp = param_getchar(Cmd, 0);
|
||||
numSectors = NumOfSectors(cmdp);
|
||||
|
||||
if (strlen(Cmd) > 1 || cmdp == 'h' || cmdp == 'H') {
|
||||
PrintAndLog("Usage: hf mf restore [card memory]");
|
||||
PrintAndLog(" [card memory]: 0 = 320 bytes (Mifare Mini), 1 = 1K (default), 2 = 2K, 4 = 4K");
|
||||
PrintAndLog("");
|
||||
PrintAndLog("Samples: hf mf restore");
|
||||
PrintAndLog(" hf mf restore 4");
|
||||
return 0;
|
||||
}
|
||||
if (strlen(Cmd) > 1 || cmdp == 'h' || cmdp == 'H')
|
||||
return usage_hf14_restore();
|
||||
|
||||
if ((fkeys = fopen("dumpkeys.bin","rb")) == NULL) {
|
||||
PrintAndLog("Could not find file dumpkeys.bin");
|
||||
@@ -2116,7 +2118,7 @@ int CmdHF14AMfEKeyPrn(const char *Cmd) {
|
||||
char c = param_getchar(Cmd, 0);
|
||||
|
||||
if ( c == 'h' || c == 'H' )
|
||||
return usage_hf14a_ekeyprn();
|
||||
return usage_hf14_ekeyprn();
|
||||
|
||||
numSectors = NumOfSectors(c);
|
||||
|
||||
|
||||
+32
-32
@@ -26,39 +26,39 @@
|
||||
#include "cmdhfmfhard.h"
|
||||
#include "nonce2key/nonce2key.h"
|
||||
|
||||
int CmdHFMF(const char *Cmd);
|
||||
extern int CmdHFMF(const char *Cmd);
|
||||
|
||||
int CmdHF14AMfDbg(const char* cmd);
|
||||
int CmdHF14AMfRdBl(const char* cmd);
|
||||
int CmdHF14AMfURdBl(const char* cmd);
|
||||
int CmdHF14AMfRdSc(const char* cmd);
|
||||
int CmdHF14SMfURdCard(const char* cmd);
|
||||
int CmdHF14AMfDump(const char* cmd);
|
||||
int CmdHF14AMfRestore(const char* cmd);
|
||||
int CmdHF14AMfWrBl(const char* cmd);
|
||||
int CmdHF14AMfUWrBl(const char* cmd);
|
||||
int CmdHF14AMfChk(const char* cmd);
|
||||
int CmdHF14AMifare(const char* cmd);
|
||||
int CmdHF14AMfNested(const char* cmd);
|
||||
int CmdHF14AMfNestedHard(const char *Cmd);
|
||||
int CmdHF14AMfSniff(const char* cmd);
|
||||
int CmdHF14AMf1kSim(const char* cmd);
|
||||
int CmdHF14AMfKeyBrute(const char *Cmd);
|
||||
int CmdHF14AMfEClear(const char* cmd);
|
||||
int CmdHF14AMfEGet(const char* cmd);
|
||||
int CmdHF14AMfESet(const char* cmd);
|
||||
int CmdHF14AMfELoad(const char* cmd);
|
||||
int CmdHF14AMfESave(const char* cmd);
|
||||
int CmdHF14AMfECFill(const char* cmd);
|
||||
int CmdHF14AMfEKeyPrn(const char* cmd);
|
||||
int CmdHF14AMfCSetUID(const char* cmd);
|
||||
int CmdHF14AMfCSetBlk(const char* cmd);
|
||||
int CmdHF14AMfCGetBlk(const char* cmd);
|
||||
int CmdHF14AMfCGetSc(const char* cmd);
|
||||
int CmdHF14AMfCLoad(const char* cmd);
|
||||
int CmdHF14AMfCSave(const char* cmd);
|
||||
int CmdHf14MfDecryptBytes(const char *Cmd);
|
||||
int CmdHf14AMfSetMod(const char *Cmd);
|
||||
extern int CmdHF14AMfDbg(const char* cmd);
|
||||
extern int CmdHF14AMfRdBl(const char* cmd);
|
||||
extern int CmdHF14AMfURdBl(const char* cmd);
|
||||
extern int CmdHF14AMfRdSc(const char* cmd);
|
||||
extern int CmdHF14SMfURdCard(const char* cmd);
|
||||
extern int CmdHF14AMfDump(const char* cmd);
|
||||
extern int CmdHF14AMfRestore(const char* cmd);
|
||||
extern int CmdHF14AMfWrBl(const char* cmd);
|
||||
extern int CmdHF14AMfUWrBl(const char* cmd);
|
||||
extern int CmdHF14AMfChk(const char* cmd);
|
||||
extern int CmdHF14AMifare(const char* cmd);
|
||||
extern int CmdHF14AMfNested(const char* cmd);
|
||||
extern int CmdHF14AMfNestedHard(const char *Cmd);
|
||||
extern int CmdHF14AMfSniff(const char* cmd);
|
||||
extern int CmdHF14AMf1kSim(const char* cmd);
|
||||
extern int CmdHF14AMfKeyBrute(const char *Cmd);
|
||||
extern int CmdHF14AMfEClear(const char* cmd);
|
||||
extern int CmdHF14AMfEGet(const char* cmd);
|
||||
extern int CmdHF14AMfESet(const char* cmd);
|
||||
extern int CmdHF14AMfELoad(const char* cmd);
|
||||
extern int CmdHF14AMfESave(const char* cmd);
|
||||
extern int CmdHF14AMfECFill(const char* cmd);
|
||||
extern int CmdHF14AMfEKeyPrn(const char* cmd);
|
||||
extern int CmdHF14AMfCSetUID(const char* cmd);
|
||||
extern int CmdHF14AMfCSetBlk(const char* cmd);
|
||||
extern int CmdHF14AMfCGetBlk(const char* cmd);
|
||||
extern int CmdHF14AMfCGetSc(const char* cmd);
|
||||
extern int CmdHF14AMfCLoad(const char* cmd);
|
||||
extern int CmdHF14AMfCSave(const char* cmd);
|
||||
extern int CmdHf14MfDecryptBytes(const char *Cmd);
|
||||
extern int CmdHf14AMfSetMod(const char *Cmd);
|
||||
|
||||
void showSectorTable(void);
|
||||
void readerAttack(nonces_t data, bool setEmulatorMem, bool verbose);
|
||||
|
||||
+347
-159
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,17 @@
|
||||
#ifndef CMDHFMFU_H__
|
||||
#define CMDHFMFU_H__
|
||||
|
||||
typedef struct {
|
||||
uint8_t version[8];
|
||||
uint8_t tbo[2];
|
||||
uint8_t tearing[3];
|
||||
uint8_t pack[2];
|
||||
uint8_t tbo1[1];
|
||||
uint8_t signature[32];
|
||||
//uint8_t counter[3];
|
||||
uint8_t data[1024];
|
||||
} mfu_dump_t;
|
||||
|
||||
extern int CmdHF14AMfUWrBl(const char *Cmd);
|
||||
extern int CmdHF14AMfURdBl(const char *Cmd);
|
||||
|
||||
@@ -16,6 +27,7 @@ extern int CmdHF14AMfuPwdGen(const char *Cmd);
|
||||
|
||||
//general stuff
|
||||
extern int CmdHF14AMfUDump(const char *Cmd);
|
||||
extern int CmdHF14AMfURestore(const char *Cmd);
|
||||
extern int CmdHF14AMfUInfo(const char *Cmd);
|
||||
extern int CmdHF14AMfUeLoad(const char *Cmd);
|
||||
extern int CmdHF14AMfUSim(const char *Cmd);
|
||||
@@ -24,6 +36,9 @@ extern uint32_t GetHF14AMfU_Type(void);
|
||||
extern int ul_print_type(uint32_t tagtype, uint8_t spacer);
|
||||
extern void ul_switch_off_field(void);
|
||||
|
||||
void printMFUdump(mfu_dump_t* card);
|
||||
void printMFUdumpEx(mfu_dump_t* card, uint16_t pages, uint8_t startpage);
|
||||
|
||||
extern int usage_hf_mfu_info(void);
|
||||
extern int usage_hf_mfu_dump(void);
|
||||
extern int usage_hf_mfu_rdbl(void);
|
||||
@@ -77,4 +92,5 @@ typedef enum TAGTYPE_UL {
|
||||
UL_ERROR = 0xFFFFFF,
|
||||
} TagTypeUL_t;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user