Commit 0563b78
authored
Rf improvement HEADLESS MODE (#2224)
* Fix buffers and clean up SMB/NTLM responder code
Adjust buffer sizes and validation, set TFT defaults, and refactor the SMB/NTLM responder for clarity and safety. Changes include:
- include/globals.h: increase timeStr to 16 to avoid truncation.
- src/core/settings.cpp: remove redundant >= 0 check for key delay validation.
- src/core/utils.cpp: enlarge local sprintf buffer for time formatting.
- src/modules/badusb_ble: set default TFT color to TFT_WHITE and ensure prints use a valid color.
- src/modules/wifi/responder.cpp: reorder includes, normalize whitespace/formatting, and refactor many SMB/NTLM routines (NetBIOS name encode, NTLM Type 2 builder, SMB1/SMB2 negotiate handlers, NTLM hash extraction, UI updates). The NTLM Type 2 assembly and AV pair handling were rewritten for clarity, offsets/lengths and NBSS length calculations were made explicit, and I/O (SD save, serial prints) preserved.
Overall these changes aim to prevent buffer issues, provide sane defaults for display calls, and improve maintainability and correctness of the SMB/NTLM responder logic.
* Fix
Fix compilation issue
* Add headless mode to RCSwitch_Read
Introduce a new bool headless parameter (default false) to RCSwitch_Read and propagate it to the header and implementation. When headless is true, UI operations (drawMainBorder, TFT prints, and display_info) are skipped so RF reads can be performed without touching the display. Update JS bindings to call RCSwitch_Read(..., headless=true) for headless operation when invoked from JavaScript.1 parent 44bcd3c commit 0563b78
3 files changed
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
715 | | - | |
| 715 | + | |
716 | 716 | | |
717 | 717 | | |
718 | 718 | | |
| |||
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
728 | 730 | | |
729 | 731 | | |
730 | 732 | | |
| |||
765 | 767 | | |
766 | 768 | | |
767 | 769 | | |
768 | | - | |
| 770 | + | |
769 | 771 | | |
770 | 772 | | |
771 | 773 | | |
| |||
790 | 792 | | |
791 | 793 | | |
792 | 794 | | |
793 | | - | |
| 795 | + | |
794 | 796 | | |
795 | 797 | | |
796 | 798 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
0 commit comments