mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
CHG: changed to use BigBuff_Eml memory instead of big_buff_malloc.
CHG: downloading eml memory from device should use uint's CHG: "hf legic read" has a different printing. It now prints 32bytes / row
This commit is contained in:
parent
44d9c722f0
commit
0b0b182fe2
4 changed files with 29 additions and 21 deletions
|
@ -414,7 +414,7 @@ int CmdLegicRFRead(const char *Cmd) {
|
|||
PrintAndLog("LSB of IV must be SET");
|
||||
}
|
||||
|
||||
//PrintAndLog("Using IV: 0x%02x | Offset: 0x%02x | Len: 0x%02x ", IV, offset, len);
|
||||
//PrintAndLog("Using IV: 0x%02x", IV);
|
||||
|
||||
UsbCommand c = {CMD_READER_LEGIC_RF, {offset, len, IV}};
|
||||
clearCommandBuffer();
|
||||
|
@ -424,12 +424,24 @@ int CmdLegicRFRead(const char *Cmd) {
|
|||
uint8_t isOK = resp.arg[0] & 0xFF;
|
||||
uint16_t len = resp.arg[1] & 0x3FF;
|
||||
if ( isOK ) {
|
||||
PrintAndLog("use 'hf legic decode'");
|
||||
|
||||
uint8_t *data = resp.d.asBytes;
|
||||
PrintAndLog("\nData |");
|
||||
uint8_t *data = malloc(len);
|
||||
if ( !data ){
|
||||
PrintAndLog("Cannot allocate memory");
|
||||
return 2;
|
||||
}
|
||||
// copy data from device
|
||||
GetEMLFromBigBuf(data, len, 0);
|
||||
if ( !WaitForResponseTimeout(CMD_ACK, NULL, 2000)){
|
||||
PrintAndLog("Command execute timeout");
|
||||
if ( data )
|
||||
free(data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
PrintAndLog("\nData");
|
||||
PrintAndLog("-----------------------------");
|
||||
PrintAndLog(" %s|\n", sprint_hex(data, len));
|
||||
print_hex_break( data, len, 32);
|
||||
} else {
|
||||
PrintAndLog("failed reading tag");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue