Proxmark3 community

Research, development and trades concerning the powerful Proxmark3 device.

Remember; sharing is caring. Bring something back to the community.


"Learn the tools of the trade the hard way." +Fravia

  • Logged in as ikarus
  • Last visit: Today 11:22:42

Announcement

Time changes and with it the technology
Proxmark3 @ discord

Users of this forum, please be aware that information stored on this site is not private.

#1 2020-08-26 00:20:30

Codeplayer
Contributor
Registered: 2020-08-25
Posts: 2

Batch files for compiled Windows clients

I am sorry if this is the wrong forum where to post.

I use Andprox alot and so I have to flash ever so often, since it does not like many flavors of firmware.

I made some modifications to the batch scripts (flash , go) for compiled Windows clients.
It was too annoying to open up device manager each time. Sometimes I had Proxmark not responding, still baffled from something I tried to do to it. So I made some adjustments, added com ports listing, selected port info, flash files presence check, some warning colors and even more for Win10 users.

Any feedback is appreciated.

FLASH -All.bat :

REM Set display
MODE CON COLS=80 LINES=36
@echo off
REM detect windows version for ANSI Escape Sequences coloring in Win10 and set it to variable %msrev%
for /f "tokens=4-5 delims=. " %%i in ('ver') do set msrev=%%i.%%j
REM set path for "all files for flashing present search"
SET rawpath=%~dp0
SET mypath=%rawpath:~0,-1%
REM unREM this to turn off ANSI coloring in win10- set msrev=0
REM Draw First screen and list all populated COM ports, coloring for win10

: scan

REM Set color for all versions of Windows
color 0a

title Flash Proxmark Bootrom ^& fullimage - Find COM port
cls
Echo.
if "%msrev%" == "10.0" (
echo   Find the port number of your Proxmark device here:[91m
) else (
echo   Find the port number of your Proxmark device here:
)
Echo. 
wmic path win32_pnpentity get caption /format:table | find "COM"
if "%msrev%" == "10.0" (
Echo [92m-----------------------------------------------------------------------------
) else (
Echo -----------------------------------------------------------------------------
)
REM Prompt for com number or rescan
set /p ComPortNumber=Enter the com port number (just the number will do) or [ENTER] to Rescan:
REM If a positive number was not entered, go back to beginning and rescan ports
IF 1%ComPortNumber% NEQ +1%ComPortNumber% goto scan
if "%ComPortNumber%" equ "" goto scan

REM Draw Second screen and list all chosen COM port properties, coloring for win10

: check
cls
title Flash Proxmark Bootrom ^& fullimage - Check COM port
Echo.
if "%msrev%" == "10.0" (
Echo   Please check how your chosen device is recognized:[91m
) else (
Echo   Please check how your chosen device is recognized:
)
Echo.
MODE COM%ComPortNumber%
Echo.
if "%msrev%" == "10.0" (
Echo   [92mPlease notice that after flashing, the COM port might change.
) else (
Echo   Please notice that after flashing, the COM port might change.
)
Echo.
Echo   CONTINUE ONLY IF YOUR DEVICE IS RECOGNIZED AS SERIAL DEVICE !
Echo.
REM Prompt for confrimation on go back to scanning COM ports
CHOICE /C YN /M "   Y to continue, N to go back to COM choice:" 
set chosen=%errorlevel%
IF %chosen% equ 1 GOTO flash
IF %chosen% equ 2 GOTO scan

: flash
cls
REM check all files present and in correct folders, color code for win10, if something is missing, set warning flag.
if "%msrev%" == "10.0" (
	if exist "FLASH - All.bat" (
		set "scriptlocation=CORRECT!  "
	) else (
		set scriptlocation=[91mNOT FOUND![92m
		set warning=1
	)
	if exist ..\firmware_win\bootrom\bootrom.elf (
		set bootromfile=PRESENT!
	) else (
		set bootromfile=[91mMISSING![92m
		set warning=1
	)
	if exist ..\firmware_win\fullimage.elf (
		set fullimagefile=PRESENT!
	) else (
		set fullimagefile=[91mMISSING![92m
		set warning=1
	)
	if exist flasher.exe (
		set flasherexe=PRESENT!            
	) else (
	if exist proxmark3.exe (
		set flasherexe=[93mUSING PROXMARK3.EXE![92m
	) else (
		set "flasherexe=[91mMISSING!            [92m"
		set warning=1
	)
	)
) else (
REM check all files present and in correct folders, without color code for older win
	if exist "FLASH - All.bat" (
		set "scriptlocation=CORRECT!  "
	) else (
		set scriptlocation=NOT FOUND!
		set warning=1
		color 0c
	)
	if exist ..\firmware_win\bootrom\bootrom.elf (
		set bootromfile=PRESENT!
	) else (
		set bootromfile=MISSING!
		set warning=1
		color 0c
	)
	if exist ..\firmware_win\fullimage.elf (
		set fullimagefile=PRESENT!
	) else (
		set fullimagefile=MISSING!
		set warning=1
		color 0c
	)
	if exist flasher.exe (
		set flasherexe=PRESENT!
	) else (
	if exist proxmark3.exe (
		set flasherexe=USING PROXMARK3.EXE!
	) else (
		set "flasherexe=MISSING!            "
		set warning=1
		color 0c
	)
	)
)
REM Draw the third screen and list all needed files and directories, coloring for win10
title Flash Proxmark Bootrom ^& fullimage - Ready to flash
echo.
echo.
if "%msrev%" == "10.0" (
echo                     FLASHING PROXMARK USING [91mCOM PORT [7m %ComPortNumber% [0m [92m
) else (
echo                     FLASHING PROXMARK USING COM PORT %ComPortNumber%
)
echo.
echo   ==========================================================================
echo   ©¦!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! O__O !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!©¦
echo   ©¦======================================================================©¦
echo   ©¦          BOOTROM + FULLIMAGE FLASHER BATCH INTEGRITY CHECK:          ©¦
echo   ©¦                                                                      ©¦
echo   ©¦ This batch    in      \win32 or \win64 folder : %scriptlocation%           ©¦
echo   ©¦ bootrom.elf   in \firmware_win\bootrom folder : %bootromfile%             ©¦
echo   ©¦ fullimage.elf in         \firmware_win folder : %fullimagefile%             ©¦
echo   ©¦ flasher.exe   in      \win32 or \win64 folder : %flasherexe% ©¦
echo   ©¦                                                                      ©¦
if "%msrev%" == "10.0" (
echo   ©¦          [101;93m ! FLASHING BOOTROM CAN BE EXTREMELY DANGEROUS ! [0m [92m          ©¦
) else (
echo   ©¦           ! FLASHING BOOTROM CAN BE EXTREMELY DANGEROUS !            ©¦
)
echo   ©¦                                                                      ©¦
REM If warning flag has been set, warn user with high visibility, delay and color/extra color for win10
if "%msrev%" == "10.0" (
	if "%warning%" == "1" (
		echo   ©¦ [91m[7m YOU DON'T HAVE THOSE REQUISITES! HIT [Y] TO RISK ^& FORCE CONTINUE! [0m[92m ©¦
		echo   ©¦                                                                      ©¦
		echo   ©¦----------------------------------------------------------------------©¦
		echo   ==========================================================================
		timeout /t 5 /nobreak
	) else (
		echo   ©¦  [7m YOU HAVE THOSE REQUISITES, HIT [Y] TO START FLASH IMMEDIATELY ! [0m[92m   ©¦
		echo   ©¦                                                                      ©¦
		echo   ©¦----------------------------------------------------------------------©¦
		echo   ==========================================================================
	)
) else (
	if "%warning%" == "1" (
		echo   ©¦  YOU DON'T HAVE THOSE REQUISITES! HIT [Y] TO RISK^&FORCE CONTINUE !   ©¦
		echo   ©¦                                                                      ©¦
		echo   ©¦----------------------------------------------------------------------©¦
		echo   ==========================================================================
		timeout /t 5 /nobreak
		color c0
	) else (
		echo   ©¦    YOU HAVE THOSE REQUISITES, HIT [Y] TO START FLASH IMMEDIATELY !   ©¦
		echo   ©¦                                                                      ©¦
		echo   ©¦----------------------------------------------------------------------©¦
		echo   ==========================================================================
	)
)
echo.
REM Prompt for confrimation on go back to scanning COM ports
CHOICE /C YN /M "   Press [N] to go back to COM choice:" 
set chosen=%errorlevel%
IF %chosen% equ 1 GOTO noreturn
IF %chosen% equ 2 GOTO scan

REM Flashing starts, mostly unchanged, except added variables

: noreturn
cls
echo.                
echo             ====================================================
echo             FLASHING bootrom.elf + fullimage.elf, please wait...
echo             ====================================================
echo.
REM Flash: if flasher.exe exist then with flasher, otherwise use Proxmark3.exe. Flash to port number chosen in screen 1.
if exist flasher.exe (
    flasher.exe com%ComPortNumber% -b ..\firmware_win\bootrom\bootrom.elf ..\firmware_win\fullimage.elf
) else (
    proxmark3.exe com%ComPortNumber% --flash --unlock-bootloader --image ..\firmware_win\bootrom\bootrom.elf --image ..\firmware_win\fullimage.elf
)

pause.

cls
title DONE
echo.
echo   ___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___
echo  /   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \
echo  \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/
echo  /   \___/                                                   \___/   \
echo  \___/                                                           \___/
echo  /   \                                                           /   \
echo  \___/                                                           \___/
echo  /   \       FLASHING OPERATION SUCCESSFUL ! Enjoy it !          /   \
echo  \___/                                                           \___/
echo  /   \                                                           /   \
echo  \___/                                                           \___/
echo  /   \                                BATCH FILE BY ASPER        /   \
echo  \___/                                                           \___/
echo  /   \                                     CODEPLAYER MOD        /   \
echo  \___/                                                           \___/
echo  /   \___                                                     ___/   \
echo  \___/   \___     ___     ___     ___     ___     ___     ___/   \___/
echo  /   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \
echo  \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/
echo      \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/

echo.
pause.
cls
MODE CON COLS=130 LINES=36
cmd.exe

Go.bat :

REM Set display
MODE CON COLS=80 LINES=36
@echo off
REM Set color for all versions of Windows
color 0a
REM detect windows version for ANSI Escape Sequences coloring in Win10 and set it to variable %msrev%
for /f "tokens=4-5 delims=. " %%i in ('ver') do set msrev=%%i.%%j

REM Draw First screen and list all populated COM ports, coloring for win10

: scan
title Run Proxmark - Find COM port
cls
Echo.
if "%msrev%" == "10.0" (
echo   Find the port number of your Proxmark device here:[91m
) else (
echo   Find the port number of your Proxmark device here:
)
Echo. 
wmic path win32_pnpentity get caption /format:table | find "COM"
if "%msrev%" == "10.0" (
Echo [92m-----------------------------------------------------------------------------
) else (
Echo -----------------------------------------------------------------------------
)
REM Prompt for com number or rescan
set /p ComPortNumber=Enter the com port number (just the number will do) or [ENTER] to Rescan:
REM If a positive number was not entered, go back to beginning and rescan ports
IF 1%ComPortNumber% NEQ +1%ComPortNumber% goto scan
if "%ComPortNumber%" equ "" goto scan

REM Draw Second screen and list all chosen COM port properties, coloring for win10

: check
cls
title Run Proxmark - Check COM port
Echo.
if "%msrev%" == "10.0" (
Echo   Please check how your chosen device is recognized:[91m
) else (
Echo   Please check how your chosen device is recognized:
)
Echo.
MODE COM%ComPortNumber%
Echo.
if "%msrev%" == "10.0" (
Echo   [92mCONTINUE ONLY IF YOUR DEVICE IS RECOGNIZED AS SERIAL DEVICE !
) else (
Echo   CONTINUE ONLY IF YOUR DEVICE IS RECOGNIZED AS SERIAL DEVICE !
)
Echo.
REM Prompt for confrimation on go back to scanning COM ports
CHOICE /C YN /M "   Y to continue, N to go back to COM choice:" 
set chosen=%errorlevel%
IF %chosen% equ 1 GOTO proxmark
IF %chosen% equ 2 GOTO scan

: proxmark
REM Run proxmark with chosen com port
Echo.
Echo -----------------------------------------------------------------------------
Echo  Starting Proxmark 3...                             Batch file by Codeplayer 
Echo -----------------------------------------------------------------------------
Echo.
proxmark3 COM%ComPortNumber%
pause.
cls
MODE CON COLS=130 LINES=36
cmd.exe

FLASH - Bootrom.bat :

REM Set display
MODE CON COLS=80 LINES=36
@echo off
REM detect windows version for ANSI Escape Sequences coloring in Win10 and set it to variable %msrev%
for /f "tokens=4-5 delims=. " %%i in ('ver') do set msrev=%%i.%%j
REM set path for "all files for flashing present search"
SET rawpath=%~dp0
SET mypath=%rawpath:~0,-1%
REM unREM this to turn off ANSI coloring in win10- set msrev=0
REM Draw First screen and list all populated COM ports, coloring for win10

: scan
REM Set color for all versions of Windows
color 0a

title Flash Proxmark Bootrom - Find COM port
cls
Echo.
if "%msrev%" == "10.0" (
echo   Find the port number of your Proxmark device here:[91m
) else (
echo   Find the port number of your Proxmark device here:
)
Echo. 
wmic path win32_pnpentity get caption /format:table | find "COM"
if "%msrev%" == "10.0" (
Echo [92m-----------------------------------------------------------------------------
) else (
Echo -----------------------------------------------------------------------------
)
REM Prompt for com number or rescan
set /p ComPortNumber=Enter the com port number (just the number will do) or [ENTER] to Rescan:
REM If a positive number was not entered, go back to beginning and rescan ports
IF 1%ComPortNumber% NEQ +1%ComPortNumber% goto scan
if "%ComPortNumber%" equ "" goto scan

REM Draw Second screen and list all chosen COM port properties, coloring for win10

: check
cls
title Flash Proxmark Bootrom - Check COM port
Echo.
if "%msrev%" == "10.0" (
Echo   Please check how your chosen device is recognized:[91m
) else (
Echo   Please check how your chosen device is recognized:
)
Echo.
MODE COM%ComPortNumber%
Echo.
if "%msrev%" == "10.0" (
Echo   [92mPlease notice that after flashing, the COM port might change.
) else (
Echo   Please notice that after flashing, the COM port might change.
)
Echo.
Echo   CONTINUE ONLY IF YOUR DEVICE IS RECOGNIZED AS SERIAL DEVICE !
Echo.
REM Prompt for confrimation on go back to scanning COM ports
CHOICE /C YN /M "   Y to continue, N to go back to COM choice:" 
set chosen=%errorlevel%
IF %chosen% equ 1 GOTO flash
IF %chosen% equ 2 GOTO scan

: flash
cls
REM check all files present and in correct folders, color code for win10, if something is missing, set warning flag.
if "%msrev%" == "10.0" (
	if exist "FLASH - All.bat" (
		set "scriptlocation=CORRECT!  "
	) else (
		set scriptlocation=[91mNOT FOUND![92m
		set warning=1
	)
	if exist ..\firmware_win\bootrom\bootrom.elf (
		set bootromfile=PRESENT!
	) else (
		set bootromfile=[91mMISSING![92m
		set warning=1
	)
	if exist flasher.exe (
		set flasherexe=PRESENT!            
	) else (
	if exist proxmark3.exe (
		set flasherexe=[93mUSING PROXMARK3.EXE![92m
	) else (
		set "flasherexe=[91mMISSING!            [92m"
		set warning=1
	)
	)
) else (
REM check all files present and in correct folders, without color code for older win
	if exist "FLASH - All.bat" (
		set "scriptlocation=CORRECT!  "
	) else (
		set scriptlocation=NOT FOUND!
		set warning=1
		color 0c
	)
	if exist ..\firmware_win\bootrom\bootrom.elf (
		set bootromfile=PRESENT!
	) else (
		set bootromfile=MISSING!
		set warning=1
		color 0c
	)
	if exist flasher.exe (
		set flasherexe=PRESENT!
	) else (
	if exist proxmark3.exe (
		set flasherexe=USING PROXMARK3.EXE!
	) else (
		set "flasherexe=MISSING!            "
		set warning=1
		color 0c
	)
	)
)
REM Draw the third screen and list all needed files and directories, coloring for win10
title Flash Proxmark Bootrom - Ready to flash
echo.
echo.
if "%msrev%" == "10.0" (
echo                     FLASHING PROXMARK USING [91mCOM PORT [7m %ComPortNumber% [0m [92m
) else (
echo                     FLASHING PROXMARK USING COM PORT %ComPortNumber%
)
echo.
echo   ==========================================================================
echo   ©¦!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! O__O !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!©¦
echo   ©¦======================================================================©¦
echo   ©¦                BOOTROM FLASHER BATCH INTEGRITY CHECK:                ©¦
echo   ©¦                                                                      ©¦
echo   ©¦ This batch    in      \win32 or \win64 folder : %scriptlocation%           ©¦
echo   ©¦ bootrom.elf   in \firmware_win\bootrom folder : %bootromfile%             ©¦
echo   ©¦ flasher.exe   in      \win32 or \win64 folder : %flasherexe% ©¦
echo   ©¦                                                                      ©¦
if "%msrev%" == "10.0" (
echo   ©¦           [101;93m! FLASHING BOOTROM CAN BE EXTREMELY DANGEROUS ![0m [92m           ©¦
) else (
echo   ©¦           ! FLASHING BOOTROM CAN BE EXTREMELY DANGEROUS !            ©¦
)
echo   ©¦                                                                      ©¦
REM If warning flag has been set, warn user with high visibility, delay and color/extra color for win10
if "%msrev%" == "10.0" (
	if "%warning%" == "1" (
		echo   ©¦ [91m[7m YOU DON'T HAVE THOSE REQUISITES! HIT [Y] TO RISK ^& FORCE CONTINUE! [0m[92m ©¦
		echo   ©¦                                                                      ©¦
		echo   ©¦----------------------------------------------------------------------©¦
		echo   ==========================================================================
		timeout /t 5 /nobreak
	) else (
		echo   ©¦  [7m YOU HAVE THOSE REQUISITES, HIT [Y] TO START FLASH IMMEDIATELY ! [0m[92m   ©¦
		echo   ©¦                                                                      ©¦
		echo   ©¦----------------------------------------------------------------------©¦
		echo   ==========================================================================
	)
) else (
	if "%warning%" == "1" (
		echo   ©¦  YOU DON'T HAVE THOSE REQUISITES! HIT [Y] TO RISK^&FORCE CONTINUE !   ©¦
		echo   ©¦                                                                      ©¦
		echo   ©¦----------------------------------------------------------------------©¦
		echo   ==========================================================================
		timeout /t 5 /nobreak
		color c0
	) else (
		echo   ©¦    YOU HAVE THOSE REQUISITES, HIT [Y] TO START FLASH IMMEDIATELY !   ©¦
		echo   ©¦                                                                      ©¦
		echo   ©¦----------------------------------------------------------------------©¦
		echo   ==========================================================================
	)
)
echo.
REM Prompt for confrimation on go back to scanning COM ports
CHOICE /C YN /M "   Press [N] to go back to COM choice:" 
set chosen=%errorlevel%
IF %chosen% equ 1 GOTO noreturn
IF %chosen% equ 2 GOTO scan

REM Flashing starts, mostly unchanged, except added variables

: noreturn
cls
echo.                
echo             ====================================
echo             FLASHING bootrom.elf, please wait...
echo             ====================================
echo.
REM Flash: if flasher.exe exist then with flasher, otherwise use Proxmark3.exe. Flash to port number chosen in screen 1.
if exist flasher.exe (
    flasher.exe com%ComPortNumber% -b ..\firmware_win\bootrom\bootrom.elf
) else (
    proxmark3.exe com%ComPortNumber% --flash --unlock-bootloader --image ..\firmware_win\bootrom\bootrom.elf
)

pause.

cls
title DONE
echo.
echo   ___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___
echo  /   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \
echo  \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/
echo  /   \___/                                                   \___/   \
echo  \___/                                                           \___/
echo  /   \                                                           /   \
echo  \___/                                                           \___/
echo  /   \       FLASHING OPERATION SUCCESSFUL ! Enjoy it !          /   \
echo  \___/                                                           \___/
echo  /   \                                                           /   \
echo  \___/                                                           \___/
echo  /   \                                BATCH FILE BY ASPER        /   \
echo  \___/                                                           \___/
echo  /   \                                     CODEPLAYER MOD        /   \
echo  \___/                                                           \___/
echo  /   \___                                                     ___/   \
echo  \___/   \___     ___     ___     ___     ___     ___     ___/   \___/
echo  /   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \
echo  \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/
echo      \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/

echo.
pause.
cls
MODE CON COLS=130 LINES=36
cmd.exe

FLASH - Fullimage.bat :

REM Set display
MODE CON COLS=80 LINES=36
@echo off
REM detect windows version for ANSI Escape Sequences coloring in Win10 and set it to variable %msrev%
for /f "tokens=4-5 delims=. " %%i in ('ver') do set msrev=%%i.%%j
REM set path for "all files for flashing present search"
SET rawpath=%~dp0
SET mypath=%rawpath:~0,-1%
REM unREM this to turn off ANSI coloring in win10- set msrev=0
REM Draw First screen and list all populated COM ports, coloring for win10

: scan
REM Set color for all versions of Windows
color 0a

title Flash Proxmark fullimage - Find COM port
cls
Echo.
if "%msrev%" == "10.0" (
echo   Find the port number of your Proxmark device here:[91m
) else (
echo   Find the port number of your Proxmark device here:
)
Echo. 
wmic path win32_pnpentity get caption /format:table | find "COM"
if "%msrev%" == "10.0" (
Echo [92m-----------------------------------------------------------------------------
) else (
Echo -----------------------------------------------------------------------------
)
REM Prompt for com number or rescan
set /p ComPortNumber=Enter the com port number (just the number will do) or [ENTER] to Rescan:
REM If a positive number was not entered, go back to beginning and rescan ports
IF 1%ComPortNumber% NEQ +1%ComPortNumber% goto scan
if "%ComPortNumber%" equ "" goto scan

REM Draw Second screen and list all chosen COM port properties, coloring for win10

: check
cls
title Flash Proxmark fullimage - Check COM port
Echo.
if "%msrev%" == "10.0" (
Echo   Please check how your chosen device is recognized:[91m
) else (
Echo   Please check how your chosen device is recognized:
)
Echo.
MODE COM%ComPortNumber%
Echo.
if "%msrev%" == "10.0" (
Echo   [92mPlease notice that after flashing, the COM port might change.
) else (
Echo   Please notice that after flashing, the COM port might change.
)
Echo.
Echo   CONTINUE ONLY IF YOUR DEVICE IS RECOGNIZED AS SERIAL DEVICE !
Echo.
REM Prompt for confrimation on go back to scanning COM ports
CHOICE /C YN /M "   Y to continue, N to go back to COM choice:" 
set chosen=%errorlevel%
IF %chosen% equ 1 GOTO flash
IF %chosen% equ 2 GOTO scan

: flash
cls
REM check all files present and in correct folders, color code for win10, if something is missing, set warning flag.
if "%msrev%" == "10.0" (
	if exist "FLASH - All.bat" (
		set "scriptlocation=CORRECT!  "
	) else (
		set scriptlocation=[91mNOT FOUND![92m
		set warning=1
	)
	if exist ..\firmware_win\fullimage.elf (
		set fullimagefile=PRESENT!
	) else (
		set fullimagefile=[91mMISSING![92m
		set warning=1
	)
	if exist flasher.exe (
		set flasherexe=PRESENT!            
	) else (
	if exist proxmark3.exe (
		set flasherexe=[93mUSING PROXMARK3.EXE![92m
	) else (
		set "flasherexe=[91mMISSING!            [92m"
		set warning=1
	)
	)
) else (
REM check all files present and in correct folders, without color code for older win
	if exist "FLASH - All.bat" (
		set "scriptlocation=CORRECT!  "
	) else (
		set scriptlocation=NOT FOUND!
		set warning=1
		color 0c
	)
	if exist ..\firmware_win\fullimage.elf (
		set fullimagefile=PRESENT!
	) else (
		set fullimagefile=MISSING!
		set warning=1
		color 0c
	)
	if exist flasher.exe (
		set flasherexe=PRESENT!
	) else (
	if exist proxmark3.exe (
		set flasherexe=USING PROXMARK3.EXE!
	) else (
		set "flasherexe=MISSING!            "
		set warning=1
		color 0c
	)
	)
)

REM Draw the third screen and list all needed files and directories, coloring for win10
title Flash Proxmark fullimage - Ready to flash
echo.
echo.
if "%msrev%" == "10.0" (
echo                     FLASHING PROXMARK USING [91mCOM PORT [7m %ComPortNumber% [0m [92m
) else (
echo                     FLASHING PROXMARK USING COM PORT %ComPortNumber%
)
echo.
echo   ==========================================================================
echo   ©¦!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! O__O !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!©¦
echo   ©¦======================================================================©¦
echo   ©¦          BOOTROM + FULLIMAGE FLASHER BATCH INTEGRITY CHECK:          ©¦
echo   ©¦                                                                      ©¦
echo   ©¦ This batch    in      \win32 or \win64 folder : %scriptlocation%           ©¦
echo   ©¦ fullimage.elf in         \firmware_win folder : %fullimagefile%             ©¦
echo   ©¦ flasher.exe   in      \win32 or \win64 folder : %flasherexe% ©¦
echo   ©¦                                                                      ©¦
echo   ©¦                                                                      ©¦
REM If warning flag has been set, warn user with high visibility, delay and color/extra color for win10
if "%msrev%" == "10.0" (
	if "%warning%" == "1" (
		echo   ©¦ [91m[7m YOU DON'T HAVE THOSE REQUISITES! HIT [Y] TO RISK ^& FORCE CONTINUE! [0m[92m ©¦
		echo   ©¦                                                                      ©¦
		echo   ©¦----------------------------------------------------------------------©¦
		echo   ==========================================================================
		timeout /t 5 /nobreak
	) else (
		echo   ©¦  [7m YOU HAVE THOSE REQUISITES, HIT [Y] TO START FLASH IMMEDIATELY ! [0m[92m   ©¦
		echo   ©¦                                                                      ©¦
		echo   ©¦----------------------------------------------------------------------©¦
		echo   ==========================================================================
	)
) else (
	if "%warning%" == "1" (
		echo   ©¦  YOU DON'T HAVE THOSE REQUISITES! HIT [Y] TO RISK^&FORCE CONTINUE !   ©¦
		echo   ©¦                                                                      ©¦
		echo   ©¦----------------------------------------------------------------------©¦
		echo   ==========================================================================
		timeout /t 5 /nobreak
		color c0
	) else (
		echo   ©¦    YOU HAVE THOSE REQUISITES, HIT [Y] TO START FLASH IMMEDIATELY !   ©¦
		echo   ©¦                                                                      ©¦
		echo   ©¦----------------------------------------------------------------------©¦
		echo   ==========================================================================
	)
)
echo.
REM Prompt for confrimation on go back to scanning COM ports
CHOICE /C YN /M "   Press [N] to go back to COM choice:" 
set chosen=%errorlevel%
IF %chosen% equ 1 GOTO noreturn
IF %chosen% equ 2 GOTO scan

REM Flashing starts, mostly unchanged, except added variables

: noreturn
cls
echo.                
echo             ======================================
echo             FLASHING fullimage.elf, please wait...
echo             ======================================
echo.
REM Flash: if flasher.exe exist then with flasher, otherwise use Proxmark3.exe. Flash to port number chosen in screen 1.
if exist flasher.exe (
    flasher.exe com%ComPortNumber% -b ..\firmware_win\fullimage.elf
) else (
    proxmark3.exe com%ComPortNumber% --flash --unlock-bootloader --image ..\firmware_win\fullimage.elf
)

pause.

cls
title DONE
echo.
echo   ___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___
echo  /   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \
echo  \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/
echo  /   \___/                                                   \___/   \
echo  \___/                                                           \___/
echo  /   \                                                           /   \
echo  \___/                                                           \___/
echo  /   \       FLASHING OPERATION SUCCESSFUL ! Enjoy it !          /   \
echo  \___/                                                           \___/
echo  /   \                                                           /   \
echo  \___/                                                           \___/
echo  /   \                                BATCH FILE BY ASPER        /   \
echo  \___/                                                           \___/
echo  /   \                                     CODEPLAYER MOD        /   \
echo  \___/                                                           \___/
echo  /   \___                                                     ___/   \
echo  \___/   \___     ___     ___     ___     ___     ___     ___/   \___/
echo  /   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \
echo  \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/
echo      \___/   \___/   \___/   \___/   \___/   \___/   \___/   \___/

echo.
pause.
cls
MODE CON COLS=130 LINES=36
cmd.exe

Last edited by Codeplayer (2020-08-26 10:10:51)

Offline

Quick reply

Write your message and submit

Board footer

Powered by FluxBB