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();
|
LED_B_OFF();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (page < spi_flash_pages64k-1) {
|
if (page < spi_flash_pages64k - 1) {
|
||||||
isok = Flash_WipeMemoryPage(page);
|
isok = Flash_WipeMemoryPage(page);
|
||||||
// let spiffs check and update its info post flash erase
|
// let spiffs check and update its info post flash erase
|
||||||
rdv40_spiffs_check();
|
rdv40_spiffs_check();
|
||||||
|
|
|
@ -9697,8 +9697,8 @@ static int CmdHF14AMfInfo(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fKeyType != 0xFF) {
|
if (fKeyType != 0xFF) {
|
||||||
PrintAndLogEx(SUCCESS, "Block 0.... %s | " NOLF, sprint_hex_inrow(blockdata, MFBLOCK_SIZE));
|
PrintAndLogEx(SUCCESS, "Block 0.... %s | " NOLF, sprint_hex_inrow(blockdata, MFBLOCK_SIZE));
|
||||||
PrintAndLogEx(NORMAL, "%s", sprint_ascii(blockdata + 8, 8));
|
PrintAndLogEx(NORMAL, "%s", sprint_ascii(blockdata + 8, 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
|
|
|
@ -226,7 +226,6 @@ static void showBanner(void) {
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
PrintAndLogEx(NORMAL, " [ " _YELLOW_("%s!")" ]", get_quote());
|
PrintAndLogEx(NORMAL, " [ " _YELLOW_("%s!")" ]", get_quote());
|
||||||
PrintAndLogEx(NORMAL, " Patreon - https://www.patreon.com/iceman1001/");
|
PrintAndLogEx(NORMAL, " Patreon - https://www.patreon.com/iceman1001/");
|
||||||
PrintAndLogEx(NORMAL, " Paypal - https://www.paypal.me/iceman1001/");
|
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
// PrintAndLogEx(NORMAL, " Monero");
|
// PrintAndLogEx(NORMAL, " Monero");
|
||||||
// PrintAndLogEx(NORMAL, " 43mNJLpgBVaTvyZmX9ajcohpvVkaRy1kbZPm8tqAb7itZgfuYecgkRF36rXrKFUkwEGeZedPsASRxgv4HPBHvJwyJdyvQuP");
|
// PrintAndLogEx(NORMAL, " 43mNJLpgBVaTvyZmX9ajcohpvVkaRy1kbZPm8tqAb7itZgfuYecgkRF36rXrKFUkwEGeZedPsASRxgv4HPBHvJwyJdyvQuP");
|
||||||
|
|
|
@ -575,7 +575,7 @@ int char2int(char c) {
|
||||||
return -1; // Invalid character for hex
|
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) {
|
int hexstr2ByteArr(const char *hexstr, unsigned char *array, size_t asize) {
|
||||||
size_t n = 0;
|
size_t n = 0;
|
||||||
while (hexstr[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;
|
array[i >> 1] = (high << 4) | low;
|
||||||
}
|
}
|
||||||
return n >> 1;
|
return n >> 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
const mbedtls_md_info_t *info = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256);
|
||||||
|
|
||||||
if (keytype == 0) {
|
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 {
|
} else {
|
||||||
mbedtls_hkdf(info, bambu_salt, sizeof(bambu_salt), uid, 4, bambu_context_b, sizeof(bambu_context_b), keys, sizeof(keys));
|
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
|
// prepare hmac context
|
||||||
const mbedtls_md_info_t *info = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256);
|
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));
|
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;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ bool Flash_ReadID(flash_device_type_t *result, bool read_jedec) {
|
||||||
// 0x9F JEDEC
|
// 0x9F JEDEC
|
||||||
FlashSendByte(JEDECID);
|
FlashSendByte(JEDECID);
|
||||||
|
|
||||||
result->manufacturer_id = (FlashSendByte(0xFF) & 0xFF);
|
result->manufacturer_id = (FlashSendByte(0xFF) & 0xFF);
|
||||||
result->device_id = (FlashSendByte(0xFF) & 0xFF);
|
result->device_id = (FlashSendByte(0xFF) & 0xFF);
|
||||||
result->device_id2 = (FlashSendLastByte(0xFF) & 0xFF);
|
result->device_id2 = (FlashSendLastByte(0xFF) & 0xFF);
|
||||||
} else {
|
} else {
|
||||||
|
@ -127,7 +127,7 @@ uint16_t Flash_ReadDataCont(uint32_t address, uint8_t *out, uint16_t len) {
|
||||||
|
|
||||||
uint16_t i = 0;
|
uint16_t i = 0;
|
||||||
for (; i < (len - 1); i++) {
|
for (; i < (len - 1); i++) {
|
||||||
out[i] = ( FlashSendByte(0xFF) & 0xFF);
|
out[i] = (FlashSendByte(0xFF) & 0xFF);
|
||||||
}
|
}
|
||||||
out[i] = (FlashSendLastByte(0xFF) & 0xFF);
|
out[i] = (FlashSendLastByte(0xFF) & 0xFF);
|
||||||
return len;
|
return len;
|
||||||
|
@ -271,7 +271,7 @@ bool Flash_WipeMemory(void) {
|
||||||
|
|
||||||
// Each block is 64Kb. Four blocks
|
// Each block is 64Kb. Four blocks
|
||||||
// one block erase takes 1s ( 1000ms )
|
// 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_WriteEnable();
|
||||||
Flash_Erase64k(i);
|
Flash_Erase64k(i);
|
||||||
Flash_CheckBusy(BUSY_TIMEOUT);
|
Flash_CheckBusy(BUSY_TIMEOUT);
|
||||||
|
@ -352,17 +352,17 @@ void Flashmem_print_status(void) {
|
||||||
}
|
}
|
||||||
DbpString(" Init.................... " _GREEN_("ok"));
|
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"),
|
Dbprintf(" Mfr ID / Dev ID......... " _YELLOW_("%02X / %02X"),
|
||||||
spi_flash_data.manufacturer_id,
|
spi_flash_data.manufacturer_id,
|
||||||
spi_flash_data.device_id
|
spi_flash_data.device_id
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spi_flash_data.jedec_id > 0) {
|
if (spi_flash_data.jedec_id > 0) {
|
||||||
Dbprintf(" JEDEC Mfr ID / Dev ID... " _YELLOW_("%02X / %04X"),
|
Dbprintf(" JEDEC Mfr ID / Dev ID... " _YELLOW_("%02X / %04X"),
|
||||||
spi_flash_data.manufacturer_id,
|
spi_flash_data.manufacturer_id,
|
||||||
spi_flash_data.jedec_id
|
spi_flash_data.jedec_id
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -427,9 +427,9 @@ bool FlashDetect(void) {
|
||||||
// read using 0x9F (JEDEC)
|
// read using 0x9F (JEDEC)
|
||||||
if (Flash_ReadID(&flash_data, true)) {
|
if (Flash_ReadID(&flash_data, true)) {
|
||||||
spi_flash_data.manufacturer_id = flash_data.manufacturer_id;
|
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;
|
ret = true;
|
||||||
} else{
|
} else {
|
||||||
if (g_dbglevel > 3) Dbprintf("Flash_ReadID failed reading JEDEC (0x9F)");
|
if (g_dbglevel > 3) Dbprintf("Flash_ReadID failed reading JEDEC (0x9F)");
|
||||||
}
|
}
|
||||||
// read using 0x90 (Manufacturer / Device ID)
|
// read using 0x90 (Manufacturer / Device ID)
|
||||||
|
@ -446,7 +446,7 @@ bool FlashDetect(void) {
|
||||||
spi_flash_data.device = SpiFlashTable[0].device;
|
spi_flash_data.device = SpiFlashTable[0].device;
|
||||||
|
|
||||||
if (ret) {
|
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].manufacturer_id == spi_flash_data.manufacturer_id) {
|
||||||
if (SpiFlashTable[i].jedec_id == spi_flash_data.jedec_id) {
|
if (SpiFlashTable[i].jedec_id == spi_flash_data.jedec_id) {
|
||||||
spi_flash_pages64k = SpiFlashTable[i].pages64k;
|
spi_flash_pages64k = SpiFlashTable[i].pages64k;
|
||||||
|
|
|
@ -142,7 +142,7 @@ typedef struct {
|
||||||
uint16_t jedec_id;
|
uint16_t jedec_id;
|
||||||
uint8_t pages64k;
|
uint8_t pages64k;
|
||||||
char *device;
|
char *device;
|
||||||
}spi_flash_t;
|
} spi_flash_t;
|
||||||
|
|
||||||
static const spi_flash_t SpiFlashTable[] = {
|
static const spi_flash_t SpiFlashTable[] = {
|
||||||
// first element is the default of 4 * 64kB pages (256kB)
|
// first element is the default of 4 * 64kB pages (256kB)
|
||||||
|
|
|
@ -4554,7 +4554,7 @@
|
||||||
"-h, --help This help",
|
"-h, --help This help",
|
||||||
"--blk <dec> Target block",
|
"--blk <dec> Target block",
|
||||||
"-b Target key B instead of default key A",
|
"-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>]"
|
"usage": "hf mf darkside [-hb] [--blk <dec> ] [-c <dec>]"
|
||||||
},
|
},
|
||||||
|
@ -13003,6 +13003,6 @@
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"commands_extracted": 749,
|
"commands_extracted": 749,
|
||||||
"extracted_by": "PM3Help2JSON v1.00",
|
"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