diff --git a/client/pyscripts/theremin.py b/client/pyscripts/theremin.py old mode 100644 new mode 100755 index a84ff3adf..2bd1681ac --- a/client/pyscripts/theremin.py +++ b/client/pyscripts/theremin.py @@ -28,9 +28,9 @@ p = pyaudio.PyAudio() # For paFloat32 sample values must be in range [-1.0, 1.0] stream = p.open(format=pyaudio.paFloat32, - channels=1, - rate=sampling_freq, - output=True) + channels=1, + rate=sampling_freq, + output=True) # Initial voltage to frequency values min_v = 100.0 @@ -38,9 +38,9 @@ max_v = 0.0 v = 0 out_freq = min_freq -# Spawn the Proxmark3 client +# Spawn the Proxmark3 client pm3_proc = Popen([pm3_client, pm3_reader_dev_file, "-c", pm3_tune_cmd], - bufsize=0, env={}, stdin=DEVNULL, stdout=PIPE, stderr=DEVNULL) + bufsize=0, env={}, stdin=DEVNULL, stdout=PIPE, stderr=DEVNULL) mv_recbuf = "" # Read voltages from the Proxmark3, generate the sine wave, output to soundcard @@ -66,7 +66,8 @@ while True: max_v = v # Recalculate the audio frequency to generate - out_freq = (max_freq - min_freq) * (max_v - v) / (max_v - min_v) + min_freq + out_freq = (max_freq - min_freq) * (max_v - v) / (max_v - min_v) \ + + min_freq # Generate the samples and write them to the soundcard sinevs = out_freq / sampling_freq * numpy.pi * 2 @@ -75,4 +76,5 @@ while True: sinev = sinev if sinev < numpy.pi * 2 else sinev - numpy.pi * 2 i = (i + 1) % sample_buf_size if not i: - stream.write((numpy.sin(sample_buf) * volume).astype(numpy.float32).tobytes()) + stream.write((numpy.sin(sample_buf) * volume). + astype(numpy.float32).tobytes()) diff --git a/client/src/cmdhf14a.c b/client/src/cmdhf14a.c index 50d3fd30a..2a8fe5485 100644 --- a/client/src/cmdhf14a.c +++ b/client/src/cmdhf14a.c @@ -1354,7 +1354,7 @@ static int detect_nxp_card(uint8_t sak, uint16_t atqa) { type |= MTDESFIRE; } } - + if (type == MTNONE) { PrintAndLogEx(WARNING, " failed to fingerprint"); } diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index 82ef2d852..396511efd 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -770,7 +770,7 @@ static int CmdHFiClassELoad(const char *Cmd) { break; } case EML: { - res = loadFileEML_safe(filename, (void**)&dump, &bytes_read); + res = loadFileEML_safe(filename, (void **)&dump, &bytes_read); break; } case JSON: { @@ -1676,7 +1676,7 @@ static int CmdHFiClassCloneTag(const char *Cmd) { uint8_t *dump = NULL; size_t bytes_read = 0; - if (loadFile_safe(filename, "", (void**)&dump, &bytes_read) != PM3_SUCCESS) { + if (loadFile_safe(filename, "", (void **)&dump, &bytes_read) != PM3_SUCCESS) { PrintAndLogEx(FAILED, "File: " _YELLOW_("%s") ": not found or locked.", filename); return PM3_EFILE; } @@ -1702,7 +1702,7 @@ static int CmdHFiClassCloneTag(const char *Cmd) { memcpy(tag_data, dump + startblock * 8, sizeof(iclass_block_t) * (endblock - startblock + 1)); free(dump); - + uint8_t MAC[4] = {0x00, 0x00, 0x00, 0x00}; uint8_t div_key[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; @@ -2040,7 +2040,7 @@ static int CmdHFiClassReadTagFile(const char *Cmd) { uint8_t *dump = NULL; size_t bytes_read = 0; - if (loadFile_safe(filename, "", (void**)&dump, &bytes_read) != PM3_SUCCESS) { + if (loadFile_safe(filename, "", (void **)&dump, &bytes_read) != PM3_SUCCESS) { PrintAndLogEx(FAILED, "File: " _YELLOW_("%s") ": not found or locked.", filename); return PM3_EFILE; } @@ -2190,7 +2190,7 @@ static int loadKeys(char *filename) { uint8_t *dump = NULL; size_t bytes_read = 0; - if (loadFile_safe(filename, "", (void**)&dump, &bytes_read) != PM3_SUCCESS) { + if (loadFile_safe(filename, "", (void **)&dump, &bytes_read) != PM3_SUCCESS) { PrintAndLogEx(FAILED, "File: " _YELLOW_("%s") ": not found or locked.", filename); return PM3_EFILE; } diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index ffc07099b..9cd0b282e 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -4525,8 +4525,8 @@ static int CmdHF14AMfMAD(const char *Cmd) { PrintAndLogEx(ERR, "error, read sector 0. card don't have MAD or don't have MAD on default keys"); return PM3_ESOFT; } - - + + PrintAndLogEx(NORMAL, ""); PrintAndLogEx(INFO, "--- " _CYAN_("MAD Information") " -------------------------------"); PrintAndLogEx(INFO, "---------------------------------------------------"); diff --git a/client/src/cmdlfviking.c b/client/src/cmdlfviking.c index 5dd29a95f..dccdb16c5 100644 --- a/client/src/cmdlfviking.c +++ b/client/src/cmdlfviking.c @@ -1,5 +1,5 @@ //----------------------------------------------------------------------------- -// Marshmellow, +// Marshmellow, // // This code is licensed to you under the terms of the GNU GPL, version 2 or, // at your option, any later version. See the LICENSE.txt file for the text of @@ -53,18 +53,18 @@ static int usage_lf_viking_sim(void) { } static int CmdVikingDemod(const char *Cmd) { - return demodViking(); + return demodViking(); } //see ASKDemod for what args are accepted int demodViking(void) { - + if (ASKDemod("", false, false, 1) != PM3_SUCCESS) { PrintAndLogEx(DEBUG, "DEBUG: Error - Viking ASKDemod failed"); return PM3_ESOFT; } - - size_t size = DemodBufferLen; + + size_t size = DemodBufferLen; int ans = detectViking(DemodBuffer, &size); if (ans < 0) { PrintAndLogEx(DEBUG, "DEBUG: Error - Viking Demod %d %s", ans, (ans == -5) ? _RED_("[chksum error]") : "");