| 3944 | } |
| 3945 | |
| 3946 | void BleSuiteMenu() { |
| 3947 | showWelcomeScreen(); |
| 3948 | |
| 3949 | const int MENU_ITEMS = 11; |
| 3950 | const char *menuItems[] = { |
| 3951 | "Quick Vulnerability Scan", |
| 3952 | "Deep Device Profiling", |
| 3953 | "FastPair Attack Suite", |
| 3954 | "HFP (Hands-Free) Suite", |
| 3955 | "Audio Suite", |
| 3956 | "HID Attack Suite", |
| 3957 | "Memory Corruption Suite", |
| 3958 | "DoS Attacks", |
| 3959 | "Payload Delivery", |
| 3960 | "Testing Tools", |
| 3961 | "Universal Attack Chain" |
| 3962 | }; |
| 3963 | |
| 3964 | int selected = 0, scrollOffset = 0; |
| 3965 | int lastSelected = -1, lastScrollOffset = -1; |
| 3966 | int maxVisible = (tftHeight - 80) / 25; |
| 3967 | |
| 3968 | while (true) { |
| 3969 | if (selected != lastSelected || scrollOffset != lastScrollOffset) { |
| 3970 | tft.fillScreen(bruceConfig.bgColor); |
| 3971 | tft.drawRect(5, 5, tftWidth - 10, tftHeight - 10, TFT_WHITE); |
| 3972 | |
| 3973 | tft.setTextColor(TFT_WHITE, bruceConfig.bgColor); |
| 3974 | tft.setTextSize(2); |
| 3975 | tft.setCursor((tftWidth - tft.textWidth("BLE SUITE")) / 2, 15); |
| 3976 | tft.print("BLE SUITE"); |
| 3977 | tft.setTextSize(1); |
| 3978 | |
| 3979 | for (int i = 0; i < maxVisible && (scrollOffset + i) < MENU_ITEMS; i++) { |
| 3980 | int idx = scrollOffset + i; |
| 3981 | int yPos = 60 + (i * 25); |
| 3982 | |
| 3983 | if (idx == selected) { |
| 3984 | tft.fillRect(20, yPos, tftWidth - 40, 20, TFT_WHITE); |
| 3985 | tft.setTextColor(TFT_BLACK, TFT_WHITE); |
| 3986 | tft.setCursor(25, yPos + 5); |
| 3987 | tft.print("> "); |
| 3988 | } else { |
| 3989 | tft.fillRect(20, yPos, tftWidth - 40, 20, bruceConfig.bgColor); |
| 3990 | tft.setTextColor(TFT_WHITE, bruceConfig.bgColor); |
| 3991 | tft.setCursor(25, yPos + 5); |
| 3992 | tft.print(" "); |
| 3993 | } |
| 3994 | tft.print(String(idx + 1) + ". " + menuItems[idx]); |
| 3995 | } |
| 3996 | |
| 3997 | if (MENU_ITEMS > maxVisible) { |
| 3998 | tft.setTextColor(TFT_CYAN, bruceConfig.bgColor); |
| 3999 | tft.setCursor(tftWidth - 25, 65); |
| 4000 | if (scrollOffset > 0) tft.print("^"); |
| 4001 | tft.setCursor(tftWidth - 25, 65 + (maxVisible * 25) - 10); |
| 4002 | if (scrollOffset + maxVisible < MENU_ITEMS) tft.print("v"); |
| 4003 | } |
no test coverage detected