mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-19 19:38:52 +08:00
CHG: "hf 14a sim" now uses mfkey32 and mfkey32_moebius as methods to retrive the key in attack_mode.
This commit is contained in:
parent
c01d8e21ea
commit
f7c1a934d0
1 changed files with 8 additions and 11 deletions
|
@ -507,7 +507,7 @@ int CmdHF14ASim(const char *Cmd) {
|
||||||
uint8_t uid[10] = {0,0,0,0,0,0,0,0,0,0};
|
uint8_t uid[10] = {0,0,0,0,0,0,0,0,0,0};
|
||||||
int uidlen = 0;
|
int uidlen = 0;
|
||||||
uint8_t data[40];
|
uint8_t data[40];
|
||||||
uint8_t key[6] = {0,0,0,0,0,0};
|
uint64_t key = 0;
|
||||||
UsbCommand resp;
|
UsbCommand resp;
|
||||||
bool useUIDfromEML = TRUE;
|
bool useUIDfromEML = TRUE;
|
||||||
|
|
||||||
|
@ -562,7 +562,7 @@ int CmdHF14ASim(const char *Cmd) {
|
||||||
PrintAndLog("Press pm3-button to abort simulation");
|
PrintAndLog("Press pm3-button to abort simulation");
|
||||||
|
|
||||||
UsbCommand c = {CMD_SIMULATE_TAG_ISO_14443a,{ tagtype, flags, 0 }};
|
UsbCommand c = {CMD_SIMULATE_TAG_ISO_14443a,{ tagtype, flags, 0 }};
|
||||||
memcpy(c.d.asBytes, uid, uidlen);
|
memcpy(c.d.asBytes, uid, uidlen>>1);
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
SendCommand(&c);
|
SendCommand(&c);
|
||||||
|
|
||||||
|
@ -570,13 +570,14 @@ int CmdHF14ASim(const char *Cmd) {
|
||||||
if ( WaitForResponseTimeout(CMD_ACK,&resp,1500)) {
|
if ( WaitForResponseTimeout(CMD_ACK,&resp,1500)) {
|
||||||
if ( (resp.arg[0] & 0xffff) == CMD_SIMULATE_MIFARE_CARD ){
|
if ( (resp.arg[0] & 0xffff) == CMD_SIMULATE_MIFARE_CARD ){
|
||||||
memset(data, 0x00, sizeof(data));
|
memset(data, 0x00, sizeof(data));
|
||||||
memset(key, 0x00, sizeof(key));
|
|
||||||
int len = (resp.arg[1] > sizeof(data)) ? sizeof(data) : resp.arg[1];
|
int len = (resp.arg[1] > sizeof(data)) ? sizeof(data) : resp.arg[1];
|
||||||
memcpy(data, resp.d.asBytes, len);
|
memcpy(data, resp.d.asBytes, len);
|
||||||
uint32_t cuid = bytes_to_num(data, 4);
|
key = 0;
|
||||||
tryMfk32(cuid, data, key); // 201604, iceman, errors!
|
|
||||||
//tryMfk32_moebius(cuid, data, key);
|
if ( flags & FLAG_NR_AR_ATTACK ) {
|
||||||
//tryMfk64(cuid, data, key);
|
bool found = tryMfk32(data, &key);
|
||||||
|
found ^= tryMfk32_moebius(data, &key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -776,11 +777,7 @@ static command_t CommandTable[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
int CmdHF14A(const char *Cmd) {
|
int CmdHF14A(const char *Cmd) {
|
||||||
// flush
|
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
//WaitForResponseTimeout(CMD_ACK,NULL,100);
|
|
||||||
|
|
||||||
// parse
|
|
||||||
CmdsParse(CommandTable, Cmd);
|
CmdsParse(CommandTable, Cmd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue