Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
iceman1001 committed Nov 20, 2024
1 parent 0a7ebcf commit 2ad635c
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion armsrc/appmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions client/src/cmdhfmf.c
Original file line number Diff line number Diff line change
Expand Up @@ -9697,8 +9697,8 @@ static int CmdHF14AMfInfo(const char *Cmd) {
}

if (fKeyType != 0xFF) {
PrintAndLogEx(SUCCESS, "Block 0.... %s | " NOLF, sprint_hex_inrow(blockdata, MFBLOCK_SIZE));
PrintAndLogEx(NORMAL, "%s", sprint_ascii(blockdata + 8, 8));
PrintAndLogEx(SUCCESS, "Block 0.... %s | " NOLF, sprint_hex_inrow(blockdata, MFBLOCK_SIZE));
PrintAndLogEx(NORMAL, "%s", sprint_ascii(blockdata + 8, 8));
}

PrintAndLogEx(NORMAL, "");
Expand Down
1 change: 0 additions & 1 deletion client/src/proxmark3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions common/commonutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -598,4 +598,4 @@ int hexstr2ByteArr(const char *hexstr, unsigned char *array, size_t asize) {
array[i >> 1] = (high << 4) | low;
}
return n >> 1;
}
}
4 changes: 2 additions & 2 deletions common/generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand All @@ -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;
}
Expand Down
22 changes: 11 additions & 11 deletions common_arm/flashmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ bool Flash_ReadID(flash_device_type_t *result, bool read_jedec) {
// 0x9F JEDEC
FlashSendByte(JEDECID);

result->manufacturer_id = (FlashSendByte(0xFF) & 0xFF);
result->manufacturer_id = (FlashSendByte(0xFF) & 0xFF);
result->device_id = (FlashSendByte(0xFF) & 0xFF);
result->device_id2 = (FlashSendLastByte(0xFF) & 0xFF);
} else {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -352,17 +352,17 @@ 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
spi_flash_data.manufacturer_id,
spi_flash_data.device_id
);
}

if (spi_flash_data.jedec_id > 0) {
Dbprintf(" JEDEC Mfr ID / Dev ID... " _YELLOW_("%02X / %04X"),
spi_flash_data.manufacturer_id,
spi_flash_data.jedec_id
spi_flash_data.manufacturer_id,
spi_flash_data.jedec_id
);
}

Expand Down Expand Up @@ -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)
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion common_arm/flashmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions doc/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -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>]"
},
Expand Down Expand Up @@ -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"
}
}

0 comments on commit 2ad635c

Please sign in to comment.