This commit is contained in:
iceman1001 2024-11-20 23:32:02 +01:00
commit 2ad635ce57
8 changed files with 21 additions and 22 deletions

View file

@ -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();

View file

@ -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, "");

View file

@ -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");

View file

@ -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') {
@ -598,4 +598,4 @@ int hexstr2ByteArr(const char *hexstr, unsigned char *array, size_t asize) {
array[i >> 1] = (high << 4) | low;
}
return n >> 1;
}
}

View file

@ -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;
}

View file

@ -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 {
@ -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,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
);
}
@ -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;

View file

@ -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)

View file

@ -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"
}
}