mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-09-20 15:26:13 +08:00
Reverted some minor things, altered other things to get it to compile cleanly
This commit is contained in:
parent
8e863ab641
commit
31d1caa526
|
@ -18,6 +18,7 @@
|
|||
#include "util.h"
|
||||
#include "printf.h"
|
||||
#include "string.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "legicrf.h"
|
||||
|
@ -667,7 +668,9 @@ void UsbPacketReceived(uint8_t *packet, int len)
|
|||
WriteTItag(c->arg[0],c->arg[1],c->arg[2]);
|
||||
break;
|
||||
case CMD_SIMULATE_TAG_125K:
|
||||
LED_A_ON();
|
||||
SimulateTagLowFrequency(c->arg[0], c->arg[1], 1);
|
||||
LED_A_OFF();
|
||||
break;
|
||||
case CMD_LF_SIMULATE_BIDIR:
|
||||
SimulateTagLowFrequencyBidir(c->arg[0], c->arg[1]);
|
||||
|
@ -799,7 +802,7 @@ void UsbPacketReceived(uint8_t *packet, int len)
|
|||
MifareUReadBlock(c->arg[0],c->d.asBytes);
|
||||
break;
|
||||
case CMD_MIFAREU_READCARD:
|
||||
MifareUReadCard(c->arg[0],c->d.asBytes);
|
||||
MifareUReadCard(c->arg[0], c->arg[1], c->d.asBytes);
|
||||
break;
|
||||
case CMD_MIFARE_READSC:
|
||||
MifareReadSector(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
|
||||
|
|
|
@ -177,7 +177,7 @@ void ReaderMifare(bool first_try);
|
|||
int32_t dist_nt(uint32_t nt1, uint32_t nt2);
|
||||
void MifareReadBlock(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *data);
|
||||
void MifareUReadBlock(uint8_t arg0,uint8_t *datain);
|
||||
void MifareUReadCard(uint8_t arg0,uint8_t *datain);
|
||||
void MifareUReadCard(uint8_t arg0, int arg1, uint8_t *datain);
|
||||
void MifareReadSector(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain);
|
||||
void MifareWriteBlock(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain);
|
||||
void MifareUWriteBlock(uint8_t arg0,uint8_t *datain);
|
||||
|
|
|
@ -44,12 +44,12 @@ static void quicksort(uint32_t* const start, uint32_t* const stop)
|
|||
else if(*rit > *start)
|
||||
--rit;
|
||||
else
|
||||
*it ^= ( (*it ^= *rit ), *rit ^= *it);
|
||||
*it ^= (*it ^= *rit, *rit ^= *it);
|
||||
|
||||
if(*rit >= *start)
|
||||
--rit;
|
||||
if(rit != start)
|
||||
*rit ^= ( (*rit ^= *start), *start ^= *rit);
|
||||
*rit ^= (*rit ^= *start, *start ^= *rit);
|
||||
|
||||
quicksort(start, rit - 1);
|
||||
quicksort(rit + 1, stop);
|
||||
|
|
|
@ -102,21 +102,21 @@ void MifareUReadBlock(uint8_t arg0,uint8_t *datain)
|
|||
int len = iso14443a_select_card(uid, NULL, &cuid);
|
||||
if(!len) {
|
||||
if (MF_DBGLEVEL >= MF_DBG_ERROR) Dbprintf("Can't select card");
|
||||
OnError(1);
|
||||
//OnError(1);
|
||||
return;
|
||||
};
|
||||
|
||||
len = mifare_ultra_readblock(cuid, blockNo, dataout);
|
||||
if(len) {
|
||||
if (MF_DBGLEVEL >= MF_DBG_ERROR) Dbprintf("Read block error");
|
||||
OnError(2);
|
||||
//OnError(2);
|
||||
return;
|
||||
};
|
||||
|
||||
len = mifare_ultra_halt(cuid);
|
||||
if(len) {
|
||||
if (MF_DBGLEVEL >= MF_DBG_ERROR) Dbprintf("Halt error");
|
||||
OnError(3);
|
||||
//OnError(3);
|
||||
return;
|
||||
};
|
||||
|
||||
|
@ -201,11 +201,11 @@ void MifareUReadCard(uint8_t arg0, int arg1, uint8_t *datain)
|
|||
int count_Pages = 0;
|
||||
byte_t dataout[176] = {0x00};;
|
||||
uint8_t uid[10] = {0x00};
|
||||
uint32_t cuid;
|
||||
uint32_t cuid;
|
||||
|
||||
LED_A_ON();
|
||||
LED_B_OFF();
|
||||
LED_C_OFF();
|
||||
LED_A_ON();
|
||||
LED_B_OFF();
|
||||
LED_C_OFF();
|
||||
|
||||
if (MF_DBGLEVEL >= MF_DBG_ALL)
|
||||
Dbprintf("Pages %d",Pages);
|
||||
|
@ -218,7 +218,7 @@ void MifareUReadCard(uint8_t arg0, int arg1, uint8_t *datain)
|
|||
if (!len) {
|
||||
if (MF_DBGLEVEL >= MF_DBG_ERROR)
|
||||
Dbprintf("Can't select card");
|
||||
OnError(1);
|
||||
//OnError(1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -229,7 +229,7 @@ void MifareUReadCard(uint8_t arg0, int arg1, uint8_t *datain)
|
|||
if (len) {
|
||||
if (MF_DBGLEVEL >= MF_DBG_ERROR)
|
||||
Dbprintf("Read block %d error",i);
|
||||
OnError(2);
|
||||
//OnError(2);
|
||||
return;
|
||||
} else {
|
||||
count_Pages++;
|
||||
|
@ -240,7 +240,7 @@ void MifareUReadCard(uint8_t arg0, int arg1, uint8_t *datain)
|
|||
if (len) {
|
||||
if (MF_DBGLEVEL >= MF_DBG_ERROR)
|
||||
Dbprintf("Halt error");
|
||||
OnError(3);
|
||||
//OnError(3);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -255,8 +255,8 @@ void MifareUReadCard(uint8_t arg0, int arg1, uint8_t *datain)
|
|||
len = 176;
|
||||
|
||||
cmd_send(CMD_ACK, 1, 0, 0, dataout, len);
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
LEDsoff();
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
LEDsoff();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "cmdparser.h"
|
||||
#include "cmdhflegic.h"
|
||||
#include "cmdmain.h"
|
||||
|
||||
#include "util.h"
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
static command_t CommandTable[] =
|
||||
|
|
|
@ -662,6 +662,8 @@ int CmdHF14AMfRestore(const char *Cmd)
|
|||
for (sectorNo = 0; sectorNo < numSectors; sectorNo++) {
|
||||
if (fread(keyA[sectorNo], 1, 6, fkeys) == 0) {
|
||||
PrintAndLog("File reading error (dumpkeys.bin).");
|
||||
|
||||
fclose(fkeys);
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
@ -669,6 +671,7 @@ int CmdHF14AMfRestore(const char *Cmd)
|
|||
for (sectorNo = 0; sectorNo < numSectors; sectorNo++) {
|
||||
if (fread(keyB[sectorNo], 1, 6, fkeys) == 0) {
|
||||
PrintAndLog("File reading error (dumpkeys.bin).");
|
||||
fclose(fkeys);
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "cmdparser.h"
|
||||
#include "cmdmain.h"
|
||||
#include "cmddata.h"
|
||||
#include "util.h"
|
||||
#include "cmdlf.h"
|
||||
#include "cmdlfhid.h"
|
||||
#include "cmdlfti.h"
|
||||
|
|
|
@ -49,7 +49,7 @@ end
|
|||
|
||||
local function save_TEXT(data,filename)
|
||||
-- Open the output file
|
||||
local outfile = io.open(filename, "wb")
|
||||
local outfile = io.open(filename, "w")
|
||||
if outfile == nil then
|
||||
return oops(string.format("Could not write to file %s",tostring(filename)))
|
||||
end
|
||||
|
|
|
@ -150,10 +150,8 @@ typedef struct {
|
|||
|
||||
#define CMD_MIFARE_READBL 0x0620
|
||||
#define CMD_MIFAREU_READBL 0x0720
|
||||
|
||||
#define CMD_MIFARE_READSC 0x0621
|
||||
#define CMD_MIFAREU_READCARD 0x0721
|
||||
|
||||
#define CMD_MIFARE_WRITEBL 0x0622
|
||||
#define CMD_MIFAREU_WRITEBL 0x0722
|
||||
#define CMD_MIFAREU_WRITEBL_COMPAT 0x0723
|
||||
|
|
Loading…
Reference in a new issue