mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
style
This commit is contained in:
parent
0a7ebcf3e3
commit
2ad635ce57
8 changed files with 21 additions and 22 deletions
|
@ -2789,7 +2789,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
LED_B_OFF();
|
||||
break;
|
||||
}
|
||||
if (page < spi_flash_pages64k-1) {
|
||||
if (page < spi_flash_pages64k - 1) {
|
||||
isok = Flash_WipeMemoryPage(page);
|
||||
// let spiffs check and update its info post flash erase
|
||||
rdv40_spiffs_check();
|
||||
|
|
|
@ -226,7 +226,6 @@ static void showBanner(void) {
|
|||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(NORMAL, " [ " _YELLOW_("%s!")" ]", get_quote());
|
||||
PrintAndLogEx(NORMAL, " Patreon - https://www.patreon.com/iceman1001/");
|
||||
PrintAndLogEx(NORMAL, " Paypal - https://www.paypal.me/iceman1001/");
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
// PrintAndLogEx(NORMAL, " Monero");
|
||||
// PrintAndLogEx(NORMAL, " 43mNJLpgBVaTvyZmX9ajcohpvVkaRy1kbZPm8tqAb7itZgfuYecgkRF36rXrKFUkwEGeZedPsASRxgv4HPBHvJwyJdyvQuP");
|
||||
|
|
|
@ -575,7 +575,7 @@ int char2int(char c) {
|
|||
return -1; // Invalid character for hex
|
||||
}
|
||||
|
||||
// returns the number of bytes written
|
||||
// returns the number of bytes written
|
||||
int hexstr2ByteArr(const char *hexstr, unsigned char *array, size_t asize) {
|
||||
size_t n = 0;
|
||||
while (hexstr[n] != '\0') {
|
||||
|
|
|
@ -556,7 +556,7 @@ int mfc_algo_bambu_one(uint8_t *uid, uint8_t sector, uint8_t keytype, uint64_t *
|
|||
const mbedtls_md_info_t *info = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256);
|
||||
|
||||
if (keytype == 0) {
|
||||
mbedtls_hkdf(info, bambu_salt, sizeof(bambu_salt), uid, 4, bambu_context_a, sizeof(bambu_context_a), keys, sizeof(keys) );
|
||||
mbedtls_hkdf(info, bambu_salt, sizeof(bambu_salt), uid, 4, bambu_context_a, sizeof(bambu_context_a), keys, sizeof(keys));
|
||||
} else {
|
||||
mbedtls_hkdf(info, bambu_salt, sizeof(bambu_salt), uid, 4, bambu_context_b, sizeof(bambu_context_b), keys, sizeof(keys));
|
||||
}
|
||||
|
@ -571,7 +571,7 @@ int mfc_algo_bambu_all(uint8_t *uid, uint8_t *keys) {
|
|||
|
||||
// prepare hmac context
|
||||
const mbedtls_md_info_t *info = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256);
|
||||
mbedtls_hkdf(info, bambu_salt, sizeof(bambu_salt), uid, 4, bambu_context_a, sizeof(bambu_context_a), keys, (16 * 6) );
|
||||
mbedtls_hkdf(info, bambu_salt, sizeof(bambu_salt), uid, 4, bambu_context_a, sizeof(bambu_context_a), keys, (16 * 6));
|
||||
mbedtls_hkdf(info, bambu_salt, sizeof(bambu_salt), uid, 4, bambu_context_b, sizeof(bambu_context_b), keys + (16 * 6), (16 * 6));
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ uint16_t Flash_ReadDataCont(uint32_t address, uint8_t *out, uint16_t len) {
|
|||
|
||||
uint16_t i = 0;
|
||||
for (; i < (len - 1); i++) {
|
||||
out[i] = ( FlashSendByte(0xFF) & 0xFF);
|
||||
out[i] = (FlashSendByte(0xFF) & 0xFF);
|
||||
}
|
||||
out[i] = (FlashSendLastByte(0xFF) & 0xFF);
|
||||
return len;
|
||||
|
@ -271,7 +271,7 @@ bool Flash_WipeMemory(void) {
|
|||
|
||||
// Each block is 64Kb. Four blocks
|
||||
// one block erase takes 1s ( 1000ms )
|
||||
for (uint8_t i=0; i < spi_flash_pages64k; i++) {
|
||||
for (uint8_t i = 0; i < spi_flash_pages64k; i++) {
|
||||
Flash_WriteEnable();
|
||||
Flash_Erase64k(i);
|
||||
Flash_CheckBusy(BUSY_TIMEOUT);
|
||||
|
@ -352,7 +352,7 @@ void Flashmem_print_status(void) {
|
|||
}
|
||||
DbpString(" Init.................... " _GREEN_("ok"));
|
||||
|
||||
if (spi_flash_data.device_id > 0 ) {
|
||||
if (spi_flash_data.device_id > 0) {
|
||||
Dbprintf(" Mfr ID / Dev ID......... " _YELLOW_("%02X / %02X"),
|
||||
spi_flash_data.manufacturer_id,
|
||||
spi_flash_data.device_id
|
||||
|
@ -427,9 +427,9 @@ bool FlashDetect(void) {
|
|||
// read using 0x9F (JEDEC)
|
||||
if (Flash_ReadID(&flash_data, true)) {
|
||||
spi_flash_data.manufacturer_id = flash_data.manufacturer_id;
|
||||
spi_flash_data.jedec_id = (flash_data.device_id <<8) + flash_data.device_id2;
|
||||
spi_flash_data.jedec_id = (flash_data.device_id << 8) + flash_data.device_id2;
|
||||
ret = true;
|
||||
} else{
|
||||
} else {
|
||||
if (g_dbglevel > 3) Dbprintf("Flash_ReadID failed reading JEDEC (0x9F)");
|
||||
}
|
||||
// read using 0x90 (Manufacturer / Device ID)
|
||||
|
@ -446,7 +446,7 @@ bool FlashDetect(void) {
|
|||
spi_flash_data.device = SpiFlashTable[0].device;
|
||||
|
||||
if (ret) {
|
||||
for (int i=0; i < ARRAYLEN(SpiFlashTable); i++) {
|
||||
for (int i = 0; i < ARRAYLEN(SpiFlashTable); i++) {
|
||||
if (SpiFlashTable[i].manufacturer_id == spi_flash_data.manufacturer_id) {
|
||||
if (SpiFlashTable[i].jedec_id == spi_flash_data.jedec_id) {
|
||||
spi_flash_pages64k = SpiFlashTable[i].pages64k;
|
||||
|
|
|
@ -142,7 +142,7 @@ typedef struct {
|
|||
uint16_t jedec_id;
|
||||
uint8_t pages64k;
|
||||
char *device;
|
||||
}spi_flash_t;
|
||||
} spi_flash_t;
|
||||
|
||||
static const spi_flash_t SpiFlashTable[] = {
|
||||
// first element is the default of 4 * 64kB pages (256kB)
|
||||
|
|
|
@ -4554,7 +4554,7 @@
|
|||
"-h, --help This help",
|
||||
"--blk <dec> Target block",
|
||||
"-b Target key B instead of default key A",
|
||||
"-c <dec> Target Auth 6x"
|
||||
"-c <dec> Target key type is key A + offset"
|
||||
],
|
||||
"usage": "hf mf darkside [-hb] [--blk <dec> ] [-c <dec>]"
|
||||
},
|
||||
|
@ -13003,6 +13003,6 @@
|
|||
"metadata": {
|
||||
"commands_extracted": 749,
|
||||
"extracted_by": "PM3Help2JSON v1.00",
|
||||
"extracted_on": "2024-11-15T13:26:34"
|
||||
"extracted_on": "2024-11-20T22:31:28"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue