From 03adc544df52fe7ba875678932de0ea3aa90cbe1 Mon Sep 17 00:00:00 2001 From: Antiklesys Date: Sat, 20 Jul 2024 01:42:47 +0800 Subject: [PATCH] Update util.c --- armsrc/util.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/armsrc/util.c b/armsrc/util.c index a4cef3264..a4d6f2b8b 100644 --- a/armsrc/util.c +++ b/armsrc/util.c @@ -410,8 +410,6 @@ uint8_t binaryToHex(char *binaryStr) { return (uint8_t)strtoul(binaryStr, NULL, 2); } -#define PICOPASS_BLOCK_SIZE 8 - // Function to convert an unsigned int to an array of hex values void convertToHexArray(uint8_t num, uint8_t *partialkey) { char binaryStr[25]; // 24 bits for binary representation + 1 for null terminator @@ -420,7 +418,7 @@ void convertToHexArray(uint8_t num, uint8_t *partialkey) { intToBinary(num, binaryStr, 24); // Split the binary string into groups of 3 and convert to hex - for (int i = 0; i < PICOPASS_BLOCK_SIZE; i++) { + for (int i = 0; i < 8 ; i++) { char group[4]; strncpy(group, binaryStr + i * 3, 3); group[3] = '\0'; // Null-terminate the group string