From 48ca513a964d3d76b22f1207b37132f2e0863827 Mon Sep 17 00:00:00 2001 From: Henry Gabryjelski Date: Fri, 17 Feb 2023 17:27:07 -0800 Subject: [PATCH] updates from `make style` --- armsrc/appmain.c | 2 +- bootrom/bootrom.c | 2 +- client/src/cmdhficlass.c | 2 +- common_arm/flashmem.c | 2 +- common_arm/flashmem.h | 46 ---------------------------------------- common_arm/ticks.c | 2 +- common_arm/usb_cdc.c | 14 ++++++------ doc/commands.json | 9 ++++---- 8 files changed, 16 insertions(+), 63 deletions(-) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 90681c324..66d1380b5 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -2684,7 +2684,7 @@ void __attribute__((noreturn)) AppMain(void) { if (FlashInit()) { uint64_t flash_uniqueID = 0; if (!Flash_CheckBusy(BUSY_TIMEOUT)) { // OK because firmware was built for devices with flash - Flash_UniqueID((uint8_t*)(&flash_uniqueID)); + Flash_UniqueID((uint8_t *)(&flash_uniqueID)); } FlashStop(); usb_update_serial(flash_uniqueID); diff --git a/bootrom/bootrom.c b/bootrom/bootrom.c index c94c23481..9ca0dc430 100644 --- a/bootrom/bootrom.c +++ b/bootrom/bootrom.c @@ -225,7 +225,7 @@ static void flash_mode(void) { #ifdef WITH_FLASH if (FlashInit()) { // checks for existence of flash also ... OK because bootrom was built for devices with flash uint64_t flash_uniqueID = 0; - Flash_UniqueID((uint8_t*)&flash_uniqueID); + Flash_UniqueID((uint8_t *)&flash_uniqueID); FlashStop(); usb_update_serial(flash_uniqueID); } diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index 84a6e563d..53bb483ec 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -1407,7 +1407,7 @@ static int CmdHFiClassDecrypt(const char *Cmd) { case DES: case RFU: case None: - // Nothing to do for None anyway... + // Nothing to do for None anyway... default: continue; } diff --git a/common_arm/flashmem.c b/common_arm/flashmem.c index 0a60d43c0..a81576c5f 100644 --- a/common_arm/flashmem.c +++ b/common_arm/flashmem.c @@ -367,7 +367,7 @@ void Flashmem_print_status(void) { uint8_t uid[8] = {0, 0, 0, 0, 0, 0, 0, 0}; Flash_UniqueID(uid); - Dbprintf( " Unique ID............... " _YELLOW_("0x%02X%02X%02X%02X%02X%02X%02X%02X"), + Dbprintf(" Unique ID............... " _YELLOW_("0x%02X%02X%02X%02X%02X%02X%02X%02X"), uid[7], uid[6], uid[5], uid[4], uid[3], uid[2], uid[1], uid[0] ); diff --git a/common_arm/flashmem.h b/common_arm/flashmem.h index 3578fa933..b2456ac76 100644 --- a/common_arm/flashmem.h +++ b/common_arm/flashmem.h @@ -112,56 +112,10 @@ uint16_t FlashSendLastByte(uint32_t data); #ifndef AS_BOOTROM - // Bootrom does not require these functions. - // Wrap in #ifndef to avoid accidental bloat of bootrom - // Bootrom needs only enough to get uniqueID from flash. - // It calls three functions. Full call trees listed: - // - // FlashInit() - // | - // \____ FlashSetup() - // | \____ leaf - // | - // \____ StartTicks() - // | \____ leaf - // | - // \____ Flash_CheckBusy() [*] - // | \____ WaitUS() - // | | \____ WaitTicks() - // | | \____ leaf - // | | - // | \____ StartCountUS() - // | | \____ leaf - // | | - // | \____ GetCountUS() - // | | \____ leaf - // | | - // | \____ Flash_ReadStat1() - // | \____ FlashSendByte() - // | | \____ leaf - // | | - // | \____ FlashSendLastByte() - // | \____ FlashSendByte() - // | \____ leaf - // | - // \____ StopTicks() - // \____ leaf - // - // Flash_UniqueID() - // \____ FlashCheckBusy() (see FlashInit) - // \____ FlashSendByteByte() (see FlashInit) - // \____ FlashSendByteLastByte() (see FlashInit) - // - // - // FlashStop() [*] - - - void FlashmemSetSpiBaudrate(uint32_t baudrate); bool Flash_WaitIdle(void); void Flash_TransferAdresse(uint32_t address); - void Flash_WriteEnable(void); bool Flash_WipeMemoryPage(uint8_t page); bool Flash_WipeMemory(void); diff --git a/common_arm/ticks.c b/common_arm/ticks.c index 34c480061..342aa3cab 100644 --- a/common_arm/ticks.c +++ b/common_arm/ticks.c @@ -20,7 +20,7 @@ #include "proxmark3_arm.h" #ifndef AS_BOOTROM - #include "dbprint.h" +#include "dbprint.h" #endif diff --git a/common_arm/usb_cdc.c b/common_arm/usb_cdc.c index 82fc6d0e1..8a17c4f89 100644 --- a/common_arm/usb_cdc.c +++ b/common_arm/usb_cdc.c @@ -405,16 +405,16 @@ void usb_update_serial(uint64_t newSerialNumber) { // Descriptor is, effectively, initially identical to non-unique serial // number because it reports the shorter length in the first byte. // Convert uniqueID's eight bytes to 16 unicode characters in the - // descriptor and, finally, update the descriptor's length, which + // descriptor and, finally, update the descriptor's length, which // causes the serial number to become visible. for (uint8_t i = 0; i < 8; i++) { // order of nibbles chosen to match display order from `hw status` - uint8_t nibble1 = (newSerialNumber >> ((8*i) + 4)) & 0xFu; // bitmasks [0xF0, 0xF000, 0xF00000, ... 0xF000000000000000] - uint8_t nibble2 = (newSerialNumber >> ((8*i) + 0)) & 0xFu; // bitmasks [0x0F, 0x0F00, 0x0F0000, ... 0x0F00000000000000] - char c1 = nibble1 < 10 ? '0' + nibble1 : 'A' + (nibble1-10); - char c2 = nibble2 < 10 ? '0' + nibble2 : 'A' + (nibble2-10); - StrSerialNumber[46-(4*i)] = c1; // [ 46, 42, .., 22, 18 ] - StrSerialNumber[48-(4*i)] = c2; // [ 48, 44, .., 24, 20 ] + uint8_t nibble1 = (newSerialNumber >> ((8 * i) + 4)) & 0xFu; // bitmasks [0xF0, 0xF000, 0xF00000, ... 0xF000000000000000] + uint8_t nibble2 = (newSerialNumber >> ((8 * i) + 0)) & 0xFu; // bitmasks [0x0F, 0x0F00, 0x0F0000, ... 0x0F00000000000000] + char c1 = nibble1 < 10 ? '0' + nibble1 : 'A' + (nibble1 - 10); + char c2 = nibble2 < 10 ? '0' + nibble2 : 'A' + (nibble2 - 10); + StrSerialNumber[46 - (4 * i)] = c1; // [ 46, 42, .., 22, 18 ] + StrSerialNumber[48 - (4 * i)] = c2; // [ 48, 44, .., 24, 20 ] } StrSerialNumber[0] = USB_STRING_DESCRIPTOR_SERIAL_NUMBER_LENGTH; } diff --git a/doc/commands.json b/doc/commands.json index cb68d6069..b8e7be6be 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -3099,10 +3099,9 @@ "--fc facility code", "--cn card number", "-w, --wiegand see `wiegand list` for available formats", - "--shallow use shallow (ASK) reader modulation instead of OOK", - "-v verbose (print encoded blocks)" + "--shallow use shallow (ASK) reader modulation instead of OOK" ], - "usage": "hf iclass encode [-hv] [--bin ] --ki [--credit] [--elite] [--raw] [--enckey ] [--fc ] [--cn ] [-w ] [--shallow]" + "usage": "hf iclass encode [-h] [--bin ] --ki [--credit] [--elite] [--raw] [--enckey ] [--fc ] [--cn ] [-w ] [--shallow]" }, "hf iclass encrypt": { "command": "hf iclass encrypt", @@ -11507,7 +11506,7 @@ }, "script help": { "command": "script help", - "description": "This is a feature to run Lua/Cmd scripts. You can place scripts within the luascripts/cmdscripts folders. --------------------------------------------------------------------------------------- script list available offline: yes", + "description": "This is a feature to run Lua/Cmd/Python scripts. You can place scripts within the luascripts/cmdscripts/pyscripts folders. --------------------------------------------------------------------------------------- script list available offline: yes", "notes": [], "offline": true, "options": [], @@ -11904,6 +11903,6 @@ "metadata": { "commands_extracted": 749, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2023-02-11T10:42:29" + "extracted_on": "2023-02-18T01:26:44" } } \ No newline at end of file