@echo off
rem -------------------------------------------------------------------------
rem Batch file to run a Sniffer.
rem The %1 argument is the two-character network code, eg "en".
rem The %2 argument is the name of the program, eg "ensniff".
rem The %3 argument is the displayable name of the network, eg "Ethernet".
rem The %4 argument is the FIXEMM memory inclusion/exclusion parameter.
rem The next 5 arguments are passed to the Sniffer.
rem -------------------------------------------------------------------------

rem -------------------------------------------------------------------------
rem remove the monitor driver if loaded
rem -------------------------------------------------------------------------
call wchkmon en
if errorlevel 1 goto exit
call wchkmon tr
if errorlevel 1 goto exit
call wchkmon fd
if errorlevel 1 goto exit

rem -------------------------------------------------------------------------
rem invoke the Sniffer
rem -------------------------------------------------------------------------

if exist \%1cap\nul goto newdir

cd \capture
goto donecd

:newdir
cd \%1cap

:donecd

if "%1"=="PC" if exist \PCsniff\PCsniff.exe goto load
if not "%1"=="PC" if exist \%1sniff\%2.exe goto load
echo.
echo       อออออออออ  The %3 Sniffer is not installed.  อออออออออออ
echo.
pause
cls

:exit
cd \
menu

:load
snload %1 %2 %3 %4 %5 %6 %7 %8 %9
