whitespace

This commit is contained in:
iceman1001 2020-03-10 17:10:05 +01:00
commit f805e5c7c7
4 changed files with 33 additions and 33 deletions

View file

@ -117,7 +117,7 @@ void initSampleBufferEx(uint32_t *sample_size, bool use_malloc) {
if (use_malloc) { if (use_malloc) {
if (sample_size == NULL || *sample_size == 0 ) { if (sample_size == NULL || *sample_size == 0) {
*sample_size = BigBuf_max_traceLen(); *sample_size = BigBuf_max_traceLen();
data.buffer = BigBuf_get_addr(); data.buffer = BigBuf_get_addr();
} else { } else {
@ -127,7 +127,7 @@ void initSampleBufferEx(uint32_t *sample_size, bool use_malloc) {
} }
} else { } else {
if (sample_size == NULL || *sample_size == 0 ) { if (sample_size == NULL || *sample_size == 0) {
*sample_size = BigBuf_max_traceLen(); *sample_size = BigBuf_max_traceLen();
} }
data.buffer = BigBuf_get_addr(); data.buffer = BigBuf_get_addr();

View file

@ -400,8 +400,8 @@ static int CmdFlashMemSpiFFSLoad(const char *Cmd) {
cmdp += 2; cmdp += 2;
break; break;
case 'o': case 'o':
param_getstr(Cmd, cmdp + 1, (char*)destfilename, 32); param_getstr(Cmd, cmdp + 1, (char *)destfilename, 32);
if (strlen((char*)destfilename) == 0) { if (strlen((char *)destfilename) == 0) {
PrintAndLogEx(FAILED, "Destination Filename missing or invalid"); PrintAndLogEx(FAILED, "Destination Filename missing or invalid");
errors = true; errors = true;
} }
@ -432,7 +432,7 @@ static int CmdFlashMemSpiFFSLoad(const char *Cmd) {
free(data); free(data);
if ( res == PM3_SUCCESS ) if (res == PM3_SUCCESS)
PrintAndLogEx(SUCCESS, "Wrote "_GREEN_("%zu") "bytes to file "_GREEN_("%s"), datalen, destfilename); PrintAndLogEx(SUCCESS, "Wrote "_GREEN_("%zu") "bytes to file "_GREEN_("%s"), datalen, destfilename);
return res; return res;

View file

@ -897,30 +897,30 @@ static int CmdHFiClassDecrypt(const char *Cmd) {
// decode block 6 // decode block 6
if (memcmp(decrypted + (8*6), empty, 8) != 0 ) { if (memcmp(decrypted + (8 * 6), empty, 8) != 0) {
if (use_sc) { if (use_sc) {
DecodeBlock6(decrypted + (8*6)); DecodeBlock6(decrypted + (8 * 6));
} }
} }
// decode block 7-8-9 // decode block 7-8-9
if (memcmp(decrypted + (8*7), empty, 8) != 0 ) { if (memcmp(decrypted + (8 * 7), empty, 8) != 0) {
//todo: remove preamble/sentinal //todo: remove preamble/sentinal
uint32_t top = 0, mid, bot; uint32_t top = 0, mid, bot;
mid = bytes_to_num(decrypted + (8*7), 4); mid = bytes_to_num(decrypted + (8 * 7), 4);
bot = bytes_to_num(decrypted + (8*7) + 4, 4); bot = bytes_to_num(decrypted + (8 * 7) + 4, 4);
PrintAndLogEx(INFO, "Block 7 binary"); PrintAndLogEx(INFO, "Block 7 binary");
char hexstr[8+1] = {0}; char hexstr[8 + 1] = {0};
hex_to_buffer((uint8_t *)hexstr, decrypted + (8*7), 8, sizeof(hexstr) - 1, 0, 0, true); hex_to_buffer((uint8_t *)hexstr, decrypted + (8 * 7), 8, sizeof(hexstr) - 1, 0, 0, true);
char binstr[8*8+1] = {0}; char binstr[8 * 8 + 1] = {0};
hextobinstring(binstr, hexstr); hextobinstring(binstr, hexstr);
uint8_t i=0; uint8_t i = 0;
while (i<strlen(binstr) && binstr[i++] == '0'); while (i < strlen(binstr) && binstr[i++] == '0');
PrintAndLogEx(SUCCESS, "%s", binstr + i); PrintAndLogEx(SUCCESS, "%s", binstr + i);