mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
whitespace
This commit is contained in:
parent
bccad7b9d5
commit
f805e5c7c7
4 changed files with 33 additions and 33 deletions
|
@ -117,8 +117,8 @@ 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 {
|
||||||
*sample_size = MIN(*sample_size, BigBuf_max_traceLen());
|
*sample_size = MIN(*sample_size, BigBuf_max_traceLen());
|
||||||
|
@ -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();
|
||||||
|
@ -221,7 +221,7 @@ void LFSetupFPGAForADC(int divisor, bool reader_field) {
|
||||||
SetAdcMuxFor(GPIO_MUXSEL_LOPKD);
|
SetAdcMuxFor(GPIO_MUXSEL_LOPKD);
|
||||||
// 50ms for the resonant antenna to settle.
|
// 50ms for the resonant antenna to settle.
|
||||||
if (reader_field)
|
if (reader_field)
|
||||||
SpinDelay(50);
|
SpinDelay(50);
|
||||||
|
|
||||||
// Now set up the SSC to get the ADC samples that are now streaming at us.
|
// Now set up the SSC to get the ADC samples that are now streaming at us.
|
||||||
FpgaSetupSsc();
|
FpgaSetupSsc();
|
||||||
|
|
|
@ -130,7 +130,7 @@ CORESRCS = uart_posix.c \
|
||||||
util_posix.c \
|
util_posix.c \
|
||||||
scandir.c \
|
scandir.c \
|
||||||
crc16.c \
|
crc16.c \
|
||||||
comms.c
|
comms.c
|
||||||
|
|
||||||
CMDSRCS = crapto1/crapto1.c \
|
CMDSRCS = crapto1/crapto1.c \
|
||||||
crapto1/crypto1.c \
|
crapto1/crypto1.c \
|
||||||
|
|
|
@ -315,7 +315,7 @@ static int CmdFlashMemSpiFFSDump(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int flashmem_spiffs_load(uint8_t *destfn, uint8_t *data, size_t datalen) {
|
int flashmem_spiffs_load(uint8_t *destfn, uint8_t *data, size_t datalen) {
|
||||||
|
|
||||||
int ret_val = PM3_SUCCESS;
|
int ret_val = PM3_SUCCESS;
|
||||||
|
|
||||||
// We want to mount before multiple operation so the lazy writes/append will not
|
// We want to mount before multiple operation so the lazy writes/append will not
|
||||||
|
@ -349,7 +349,7 @@ int flashmem_spiffs_load(uint8_t *destfn, uint8_t *data, size_t datalen) {
|
||||||
bytes_sent += bytes_in_packet;
|
bytes_sent += bytes_in_packet;
|
||||||
|
|
||||||
PacketResponseNG resp;
|
PacketResponseNG resp;
|
||||||
|
|
||||||
uint8_t retry = 3;
|
uint8_t retry = 3;
|
||||||
while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||||
PrintAndLogEx(WARNING, "timeout while waiting for reply.");
|
PrintAndLogEx(WARNING, "timeout while waiting for reply.");
|
||||||
|
@ -377,7 +377,7 @@ out:
|
||||||
// We want to unmount after these to set things back to normal but more than this
|
// We want to unmount after these to set things back to normal but more than this
|
||||||
// unmouting ensure that SPIFFS CACHES are all flushed so our file is actually written on memory
|
// unmouting ensure that SPIFFS CACHES are all flushed so our file is actually written on memory
|
||||||
SendCommandNG(CMD_SPIFFS_UNMOUNT, NULL, 0);
|
SendCommandNG(CMD_SPIFFS_UNMOUNT, NULL, 0);
|
||||||
|
|
||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -429,12 +429,12 @@ static int CmdFlashMemSpiFFSLoad(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
res = flashmem_spiffs_load(destfilename, data, datalen);
|
res = flashmem_spiffs_load(destfilename, data, datalen);
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -861,7 +861,7 @@ static int CmdHFiClassDecrypt(const char *Cmd) {
|
||||||
getMemConfig(mem, chip, &max_blk, &app_areas, &kb);
|
getMemConfig(mem, chip, &max_blk, &app_areas, &kb);
|
||||||
|
|
||||||
uint8_t empty[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
uint8_t empty[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
||||||
|
|
||||||
BLOCK79ENCRYPTION aa1_encryption = (decrypted[(6 * 8) + 7] & 0x03);
|
BLOCK79ENCRYPTION aa1_encryption = (decrypted[(6 * 8) + 7] & 0x03);
|
||||||
|
|
||||||
for (uint16_t blocknum = 0; blocknum < applimit; ++blocknum) {
|
for (uint16_t blocknum = 0; blocknum < applimit; ++blocknum) {
|
||||||
|
@ -894,36 +894,36 @@ static int CmdHFiClassDecrypt(const char *Cmd) {
|
||||||
saveFileJSON(fptr, jsfIclass, decrypted, decryptedlen);
|
saveFileJSON(fptr, jsfIclass, decrypted, decryptedlen);
|
||||||
|
|
||||||
printIclassDumpContents(decrypted, 1, (decryptedlen / 8), decryptedlen);
|
printIclassDumpContents(decrypted, 1, (decryptedlen / 8), decryptedlen);
|
||||||
|
|
||||||
|
|
||||||
// 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);
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "Wiegand decode");
|
PrintAndLogEx(INFO, "Wiegand decode");
|
||||||
wiegand_message_t packed = initialize_message_object(top, mid, bot);
|
wiegand_message_t packed = initialize_message_object(top, mid, bot);
|
||||||
HIDTryUnpack(&packed, true);
|
HIDTryUnpack(&packed, true);
|
||||||
|
@ -931,7 +931,7 @@ static int CmdHFiClassDecrypt(const char *Cmd) {
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(INFO, "No credential found.");
|
PrintAndLogEx(INFO, "No credential found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
free(decrypted);
|
free(decrypted);
|
||||||
free(fptr);
|
free(fptr);
|
||||||
}
|
}
|
||||||
|
@ -1757,7 +1757,7 @@ static int ReadBlock(uint8_t *KEY, uint8_t blockno, uint8_t keyType, bool elite,
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "block %02X: %s\n", blockno, sprint_hex(result->blockdata, sizeof(result->blockdata)));
|
PrintAndLogEx(SUCCESS, "block %02X: %s\n", blockno, sprint_hex(result->blockdata, sizeof(result->blockdata)));
|
||||||
|
|
||||||
if (blockno == 6) {
|
if (blockno == 6) {
|
||||||
if (IsCryptoHelperPresent()) {
|
if (IsCryptoHelperPresent()) {
|
||||||
DecodeBlock6(result->blockdata);
|
DecodeBlock6(result->blockdata);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue