mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
style
This commit is contained in:
+2
-2
@@ -163,8 +163,8 @@ void FpgaSetupSsc(uint16_t fpga_mode) {
|
||||
// 8, 16 or 32 bits per transfer, no loopback, MSB first, 1 transfer per sync
|
||||
// pulse, no output sync
|
||||
if (((fpga_mode & FPGA_MAJOR_MODE_MASK) == FPGA_MAJOR_MODE_HF_READER ||
|
||||
(fpga_mode & FPGA_MAJOR_MODE_MASK) == FPGA_MAJOR_MODE_HF_FSK_READER) &&
|
||||
(FpgaGetCurrent() == FPGA_BITSTREAM_HF || FpgaGetCurrent() == FPGA_BITSTREAM_HF_15)) {
|
||||
(fpga_mode & FPGA_MAJOR_MODE_MASK) == FPGA_MAJOR_MODE_HF_FSK_READER) &&
|
||||
(FpgaGetCurrent() == FPGA_BITSTREAM_HF || FpgaGetCurrent() == FPGA_BITSTREAM_HF_15)) {
|
||||
AT91C_BASE_SSC->SSC_RFMR = SSC_FRAME_MODE_BITS_IN_WORD(16) | AT91C_SSC_MSBF | SSC_FRAME_MODE_WORDS_PER_TRANSFER(0);
|
||||
} else {
|
||||
AT91C_BASE_SSC->SSC_RFMR = SSC_FRAME_MODE_BITS_IN_WORD(8) | AT91C_SSC_MSBF | SSC_FRAME_MODE_WORDS_PER_TRANSFER(0);
|
||||
|
||||
+170
-204
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -45,10 +45,10 @@ int GetIso15693AnswerFromTag(uint8_t *response, uint16_t max_len, uint16_t timeo
|
||||
|
||||
//void RecordRawAdcSamplesIso15693(void);
|
||||
void AcquireRawAdcSamplesIso15693(void);
|
||||
void ReaderIso15693(iso15_card_select_t *p_card); // ISO15693 reader
|
||||
void ReaderIso15693(iso15_card_select_t *p_card); // ISO15693 reader
|
||||
void SimTagIso15693(uint8_t *uid); // simulate an ISO15693 tag
|
||||
void BruteforceIso15693Afi(uint32_t speed); // find an AFI of a tag
|
||||
void DirectTag15693Command(uint32_t datalen, uint32_t speed, uint32_t recv, uint8_t *data); // send arbitrary commands from CLI
|
||||
void BruteforceIso15693Afi(uint32_t speed); // find an AFI of a tag
|
||||
void DirectTag15693Command(uint32_t datalen, uint32_t speed, uint32_t recv, uint8_t *data); // send arbitrary commands from CLI
|
||||
|
||||
void SniffIso15693(uint8_t jam_search_len, uint8_t *jam_search_string, bool iclass);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ function main(args)
|
||||
|
||||
local i
|
||||
local cmds = {}
|
||||
--check for params
|
||||
--check for params
|
||||
for o, a in getopt.getopt(args, 'h') do
|
||||
if o == 'h' then return help() end
|
||||
end
|
||||
|
||||
+25
-25
@@ -2888,16 +2888,16 @@ static int CmdDiff(const char *Cmd) {
|
||||
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "data diff",
|
||||
"Diff takes a multitude of input data and makes a binary compare.\n"
|
||||
"It accepts filenames (filesystem or RDV4 flashmem SPIFFS), emulator memory, magic gen1",
|
||||
"data diff -w 4 -a hf-mfu-01020304.bin -b hf-mfu-04030201.bin\n"
|
||||
"data diff -a fileA -b fileB\n"
|
||||
"data diff -a fileA --eb\n"
|
||||
"Diff takes a multitude of input data and makes a binary compare.\n"
|
||||
"It accepts filenames (filesystem or RDV4 flashmem SPIFFS), emulator memory, magic gen1",
|
||||
"data diff -w 4 -a hf-mfu-01020304.bin -b hf-mfu-04030201.bin\n"
|
||||
"data diff -a fileA -b fileB\n"
|
||||
"data diff -a fileA --eb\n"
|
||||
// "data diff -a fileA --cb\n"
|
||||
"data diff --fa fileA -b fileB\n"
|
||||
"data diff --fa fileA --fb fileB\n"
|
||||
"data diff --ea --cb\n"
|
||||
);
|
||||
"data diff --fa fileA -b fileB\n"
|
||||
"data diff --fa fileA --fb fileB\n"
|
||||
"data diff --ea --cb\n"
|
||||
);
|
||||
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
@@ -2937,7 +2937,7 @@ static int CmdDiff(const char *Cmd) {
|
||||
CLIParserFree(ctx);
|
||||
|
||||
// sanity check
|
||||
if (IfPm3Rdv4Fw() == false && (splenA > 0 || splenB > 0) ) {
|
||||
if (IfPm3Rdv4Fw() == false && (splenA > 0 || splenB > 0)) {
|
||||
PrintAndLogEx(WARNING, "No RDV4 Flashmemory available");
|
||||
return PM3_EINVARG;
|
||||
}
|
||||
@@ -2952,7 +2952,7 @@ static int CmdDiff(const char *Cmd) {
|
||||
}
|
||||
|
||||
//
|
||||
if (width > 16 || width < 1 ) {
|
||||
if (width > 16 || width < 1) {
|
||||
PrintAndLogEx(INFO, "Width out of range, using default 16 bytes width");
|
||||
width = 16;
|
||||
}
|
||||
@@ -3111,19 +3111,19 @@ static int CmdDiff(const char *Cmd) {
|
||||
|
||||
// print data diff loop
|
||||
int i;
|
||||
for (i = 0; i < n; i += width ) {
|
||||
for (i = 0; i < n; i += width) {
|
||||
|
||||
memset(line, 0, sizeof(line));
|
||||
|
||||
int diff = memcmp(inA + i, inB + i, width);
|
||||
int diff = memcmp(inA + i, inB + i, width);
|
||||
|
||||
// if ok, just print
|
||||
if (diff == 0) {
|
||||
hex_to_buffer((uint8_t*)line, inA + i, width, width, 0, 1, true);
|
||||
ascii_to_buffer((uint8_t*)(line + strlen(line)), inA + i, width, width, 0);
|
||||
hex_to_buffer((uint8_t *)line, inA + i, width, width, 0, 1, true);
|
||||
ascii_to_buffer((uint8_t *)(line + strlen(line)), inA + i, width, width, 0);
|
||||
strcat(line + strlen(line), " | ");
|
||||
hex_to_buffer((uint8_t*)(line + strlen(line)), inB + i, width, width, 0, 1, true);
|
||||
ascii_to_buffer((uint8_t*)(line + strlen(line)), inB + i, width, width, 0);
|
||||
hex_to_buffer((uint8_t *)(line + strlen(line)), inB + i, width, width, 0, 1, true);
|
||||
ascii_to_buffer((uint8_t *)(line + strlen(line)), inB + i, width, width, 0);
|
||||
} else {
|
||||
|
||||
char dlnA[240] = {0};
|
||||
@@ -3138,7 +3138,7 @@ static int CmdDiff(const char *Cmd) {
|
||||
|
||||
// if diff, time to find it
|
||||
for (int j = i; j < (i + width); j++) {
|
||||
|
||||
|
||||
char ca = inA[j];
|
||||
char cb = inB[j];
|
||||
|
||||
@@ -3166,8 +3166,8 @@ static int CmdDiff(const char *Cmd) {
|
||||
// mod
|
||||
|
||||
|
||||
// print different length
|
||||
bool tallestA = (datalenA > datalenB);
|
||||
// print different length
|
||||
bool tallestA = (datalenA > datalenB);
|
||||
if (tallestA) {
|
||||
n = datalenA;
|
||||
} else {
|
||||
@@ -3175,13 +3175,13 @@ static int CmdDiff(const char *Cmd) {
|
||||
}
|
||||
|
||||
// print data diff loop
|
||||
for (; i < n; i += width ) {
|
||||
for (; i < n; i += width) {
|
||||
|
||||
memset(line, 0, sizeof(line));
|
||||
|
||||
if (tallestA) {
|
||||
hex_to_buffer((uint8_t*)line, inA + i, width, width, 0, 1, true);
|
||||
ascii_to_buffer((uint8_t*)(line + strlen(line)), inA + i, width, width, 0);
|
||||
hex_to_buffer((uint8_t *)line, inA + i, width, width, 0, 1, true);
|
||||
ascii_to_buffer((uint8_t *)(line + strlen(line)), inA + i, width, width, 0);
|
||||
strcat(line + strlen(line), " | ");
|
||||
for (int j = 0; j < width; j++) {
|
||||
strcat(line + strlen(line), "-- ");
|
||||
@@ -3198,8 +3198,8 @@ static int CmdDiff(const char *Cmd) {
|
||||
strcat(line + strlen(line), ".");
|
||||
}
|
||||
strcat(line + strlen(line), " | ");
|
||||
hex_to_buffer((uint8_t*)(line + strlen(line)), inB + i, width, width, 0, 1, true);
|
||||
ascii_to_buffer((uint8_t*)(line + strlen(line)), inB + i, width, width, 0);
|
||||
hex_to_buffer((uint8_t *)(line + strlen(line)), inB + i, width, width, 0, 1, true);
|
||||
ascii_to_buffer((uint8_t *)(line + strlen(line)), inB + i, width, width, 0);
|
||||
}
|
||||
|
||||
PrintAndLogEx(INFO, "%03X | %s", i, line);
|
||||
|
||||
@@ -90,7 +90,7 @@ out:
|
||||
}
|
||||
|
||||
int flashmem_spiffs_download(char *fn, uint8_t fnlen, void **pdest, size_t *destlen) {
|
||||
// get size from spiffs itself !
|
||||
// get size from spiffs itself !
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_SPIFFS_STAT, (uint8_t *)fn, fnlen);
|
||||
PacketResponseNG resp;
|
||||
@@ -542,7 +542,7 @@ static int CmdFlashMemSpiFFSView(const char *Cmd) {
|
||||
|
||||
int breaks = arg_get_int_def(ctx, 2, 32);
|
||||
CLIParserFree(ctx);
|
||||
|
||||
|
||||
uint8_t *dump = NULL;
|
||||
size_t dumplen = 0;
|
||||
int res = flashmem_spiffs_download(fn, fnlen, (void **)&dump, &dumplen);
|
||||
|
||||
@@ -261,7 +261,7 @@ static void mf_print_blocks(uint16_t n, uint8_t *d) {
|
||||
static int mf_print_keys(uint16_t n, uint8_t *d) {
|
||||
|
||||
uint8_t sectors = 0;
|
||||
switch(n) {
|
||||
switch (n) {
|
||||
case MIFARE_MINI_MAXBLOCK:
|
||||
sectors = MIFARE_MINI_MAXSECTOR;
|
||||
break;
|
||||
@@ -270,7 +270,7 @@ static int mf_print_keys(uint16_t n, uint8_t *d) {
|
||||
break;
|
||||
case MIFARE_4K_MAXBLOCK:
|
||||
sectors = MIFARE_4K_MAXSECTOR;
|
||||
break;
|
||||
break;
|
||||
case MIFARE_1K_MAXBLOCK:
|
||||
default:
|
||||
sectors = MIFARE_1K_MAXSECTOR;
|
||||
@@ -292,7 +292,7 @@ static int mf_print_keys(uint16_t n, uint8_t *d) {
|
||||
}
|
||||
printKeyTable(sectors, e_sector);
|
||||
free(e_sector);
|
||||
return PM3_SUCCESS;
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
static void mf_print_values(uint16_t n, uint8_t *d) {
|
||||
@@ -303,7 +303,7 @@ static void mf_print_values(uint16_t n, uint8_t *d) {
|
||||
uint8_t cnt = 0;
|
||||
uint32_t value = 0;
|
||||
for (uint16_t i = 0; i < n; i++) {
|
||||
|
||||
|
||||
if (mfc_value(d + (i * MFBLOCK_SIZE), &value)) {
|
||||
PrintAndLogEx(INFO, "%03d | " _YELLOW_("%" PRIu32) " " _YELLOW_("0x%" PRIX32), i, value, value);
|
||||
++cnt;
|
||||
@@ -311,7 +311,7 @@ static void mf_print_values(uint16_t n, uint8_t *d) {
|
||||
}
|
||||
|
||||
if (cnt) {
|
||||
PrintAndLogEx(INFO, "Found %u value blocks in file", cnt);
|
||||
PrintAndLogEx(INFO, "Found %u value blocks in file", cnt);
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
}
|
||||
}
|
||||
@@ -3634,7 +3634,7 @@ void printKeyTableEx(uint8_t sectorscnt, sector_t *e_sector, uint8_t start_secto
|
||||
snprintf(strB, sizeof(strB), "%012" PRIX64, e_sector[i].Key[1]);
|
||||
|
||||
if (e_sector[i].foundKey[0] > 1) {
|
||||
PrintAndLogEx(SUCCESS, " "_YELLOW_("%03d")" | %03d | " _GREEN_("%s")" | " _YELLOW_("%c")" | " _GREEN_("%s")" | " _YELLOW_("%c")
|
||||
PrintAndLogEx(SUCCESS, " "_YELLOW_("%03d")" | %03d | " _GREEN_("%s")" | " _YELLOW_("%c")" | " _GREEN_("%s")" | " _YELLOW_("%c")
|
||||
, i
|
||||
, mfSectorTrailerOfSector(i)
|
||||
, strA, e_sector[i].foundKey[0]
|
||||
@@ -3647,7 +3647,7 @@ void printKeyTableEx(uint8_t sectorscnt, sector_t *e_sector, uint8_t start_secto
|
||||
if (start_sector == 0)
|
||||
s = i;
|
||||
|
||||
PrintAndLogEx(SUCCESS, " "_YELLOW_("%03d")" | %03d | " _GREEN_("%s")" | " _YELLOW_("%d")" | " _GREEN_("%s")" | " _YELLOW_("%d")
|
||||
PrintAndLogEx(SUCCESS, " "_YELLOW_("%03d")" | %03d | " _GREEN_("%s")" | " _YELLOW_("%d")" | " _GREEN_("%s")" | " _YELLOW_("%d")
|
||||
, s
|
||||
, mfSectorTrailerOfSector(s)
|
||||
, strA, e_sector[i].foundKey[0]
|
||||
|
||||
@@ -101,6 +101,7 @@ const static vocabulory_t vocabulory[] = {
|
||||
{ 1, "data bin2hex" },
|
||||
{ 0, "data bitsamples" },
|
||||
{ 1, "data clear" },
|
||||
{ 1, "data diff" },
|
||||
{ 0, "data hexsamples" },
|
||||
{ 1, "data hex2bin" },
|
||||
{ 1, "data load" },
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ int FillBuffer(uint8_t *data, size_t maxDataLength, size_t *dataLength, ...);
|
||||
|
||||
bool CheckStringIsHEXValue(const char *value);
|
||||
void ascii_to_buffer(uint8_t *buf, const uint8_t *hex_data, const size_t hex_len,
|
||||
const size_t hex_max_len, const size_t min_str_len);
|
||||
const size_t hex_max_len, const size_t min_str_len);
|
||||
void hex_to_buffer(uint8_t *buf, const uint8_t *hex_data, const size_t hex_len,
|
||||
const size_t hex_max_len, const size_t min_str_len, const size_t spaces_between,
|
||||
bool uppercase);
|
||||
|
||||
+26
-3
File diff suppressed because one or more lines are too long
@@ -120,6 +120,7 @@ Check column "offline" for their availability.
|
||||
|`data bin2hex `|Y |`Converts binary to hexadecimal`
|
||||
|`data bitsamples `|N |`Get raw samples as bitstring`
|
||||
|`data clear `|Y |`Clears bigbuf on deviceside and graph window`
|
||||
|`data diff `|Y |`diff of input files`
|
||||
|`data hexsamples `|N |`Dump big buffer as hex bytes`
|
||||
|`data hex2bin `|Y |`Converts hexadecimal to binary`
|
||||
|`data load `|Y |`Load contents of file into graph window`
|
||||
|
||||
@@ -207,9 +207,9 @@ hi_get_trace gt(
|
||||
// Major modes:
|
||||
// 000 -- HF 15 reader; subcarrier frequency and modulation depth selectable
|
||||
// 001 -- HF simulated tag
|
||||
// 010 --
|
||||
// 010 --
|
||||
// 011 -- HF sniff
|
||||
// 100 --
|
||||
// 100 --
|
||||
// 101 -- HF get trace
|
||||
// 110 -- unused
|
||||
// 111 -- FPGA_MAJOR_MODE_OFF
|
||||
|
||||
@@ -87,7 +87,7 @@ reg [7:0] diff32 = 8'd0;
|
||||
reg [11:0] match16 = 12'd0;
|
||||
reg [11:0] match32 = 12'd0;
|
||||
reg [11:0] match28 = 12'd0;
|
||||
|
||||
|
||||
always @(negedge adc_clk)
|
||||
begin
|
||||
if (corr_i_cnt[0] == 1'b0) // every 2 clock
|
||||
@@ -116,7 +116,7 @@ begin
|
||||
|
||||
avg128[127:8] = avg128[119:0];
|
||||
avg128[7:0] = avg;
|
||||
|
||||
|
||||
|
||||
if (corr_i_cnt[4:1] == 4'b0000) // every 32 clock (8*4)
|
||||
begin
|
||||
|
||||
Reference in New Issue
Block a user