From 336c53a163d05573d538e8c6691f88f45c30e446 Mon Sep 17 00:00:00 2001 From: moscow chill Date: Wed, 29 Oct 2025 20:16:34 +0100 Subject: [PATCH] Fix ANSI escape codes displaying as literal text in winPEAS.bat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script was setting E=0x1B[ as a literal string instead of the actual ESC character (ASCII 27), causing color codes to display as text like "0x1B[33m[+]0x1B[97m" instead of rendering as colors. Changed the SetOnce subroutine to properly capture the ESC character using the 'prompt $E' technique before building the ANSI escape sequence prefix. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- winPEAS/winPEASbat/winPEAS.bat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winPEAS/winPEASbat/winPEAS.bat b/winPEAS/winPEASbat/winPEAS.bat index ac79951..fdf176d 100755 --- a/winPEAS/winPEASbat/winPEAS.bat +++ b/winPEAS/winPEASbat/winPEAS.bat @@ -707,7 +707,8 @@ EXIT /B :SetOnce REM :: ANSI escape character is set once below - for ColorLine Subroutine -SET "E=0x1B[" +for /F %%a in ('echo prompt $E ^| cmd') do set "ESC=%%a" +SET "E=%ESC%[" SET "PercentageTrack=0" EXIT /B