carlos wrote:@einstein1969: the base used is 16 with rle that uses [number] that means repetition of characters.
Hi Carlos,
Here you can see what I mean. It 's a starting point.
einstein1969
Moderator: DosItHelp
carlos wrote:@einstein1969: the base used is 16 with rle that uses [number] that means repetition of characters.
Code: Select all
@echo off
REM creation of reply.exe a utility for get a user input key and know the value of it
setlocal enabledelayedexpansion
echo %time%
call :gen255
set "out=reply.cab"
echo creating reply.exe ...
>"!out!" (
call :w "4D53434600000000B8010000000000002C00000000000000030101000100"
call :w "0000000000004600000001000100000600000000000000003E44B31C2000"
call :w "7265706C792E65786500F8C5FE566A010006434BF38D9AC0C0CCC0C0C002"
call :w "C4FFFF3330EC6080000706C2A00188F9E477F1316CE13CABB883D1E7AC62"
call :w "484666B14241517E7A5162AE4272625E5E7E894252AA4251699E42669E82"
call :w "8B7FB0426E7E4AAA1E2F2F970AD48C005706061F462614731F30F0337333"
call :w "B2A15A2600C50A50D781D84C10773330206806038878395009334CA30032"
call :w "0DA72000689E0D117E2515D800CD15C123AF57925A51020D43985F185083"
call :w "01E4B404BD94C49244207B015400AC8605551DD0AB07C8756768E7D3C637"
call :w "20F326BC8804929DAE7FBA5DFFB41EE06F1105F2763C0012DDBE7F2C4FF0"
call :w "B7B002992FF980C40B4320D178808111A63AE0853A50A4F908CBC9C360D3"
call :w "40C64E00A7A3801720534E1E06A52D551B050730ED00A53D14884963A380"
call :w "B6204001C14E5180A4DB1824B17A20DB4301BBDE7CA0780554AE4701B758"
call :w "6E71597251895E4A4E0E90139F9E5A929C0164A45664963064A716E5A5E6"
call :w "181B41255D81620145F9C9A9C5C5A35143170000"
)
echo %time%
del *.chr >nul
expand "!out!" reply.exe >nul
del "!out!"
echo Press a key ...
reply.exe
echo Key pressed: %errorlevel%
pause
goto :eof
:w
set "line=%~1"
::get length upto 60 characters
::Function for get the length originally writted by jeb. Modified.
(set "z=0" &set "s=a!line!" &for %%a in (
64 32 16 8 4 2 1) do (set /a "z|=%%a"
for %%b in (!z!) do if "!s:~%%b,1!"=="" set /a "z&=~%%a"))
set /a "limit=z-2"
for /l %%# in (0,2,%limit%) do (set /a "chr=0x!line:~%%#,2!"
type !chr!.chr)
goto :eof
:gen255
::This code creates one single byte. Parameter: int
::This is encoded in a macro way for be called with cmd /c
::Teamwork of carlos, penpen, aGerman, dbenham
::Tested under Win8
set "genchr=if not %%#==26 (type nul >%%#.tmp"
set "genchr=%genchr% &makecab /d compress=off"
set "genchr=%genchr% /d reserveperdatablocksize=26"
set "genchr=%genchr% /d reserveperfoldersize=%%#"
set "genchr=%genchr% %%#.tmp %%#.chr >nul"
set "genchr=%genchr% &type %%#.chr"
set "genchr=%genchr% |((for /l %%_ in (1 1 38) do pause)>nul"
set "genchr=%genchr% &findstr ^^^^ >%%#.tmp)"
set "genchr=%genchr% © /y %%#.tmp /a %%#.chr /b >nul"
set "genchr=%genchr% &del %%#.tmp) else"
set "genchr=%genchr% (copy /y nul + nul /a 26.chr /a >nul)"
::end of genchr macro::
del /f /q /a *.chr >nul 2>&1
for /l %%# in (0,1,255) do start "" /b /i cmd /d /c "%genchr%"
set "check=0"
:check255
for /l %%# in (%check%,1,255) do for %%_ in (
%%#.chr) do if not "1"=="%%~z_" (
ping -l 0 -n 1 -w 100 1.0.0.0 >nul
set "check=%%#"
goto :check255)
goto :eof
foxidrive wrote:0.89 of a second.
Two more tries: 2:35 both times.
Code: Select all
@echo off
REM creation of reply.exe a utility for get a user input key and know the value of it
REM fixed bug using cmd /u
setlocal enabledelayedexpansion
echo %time%
call :gen255
set "out=reply.cab"
echo creating reply.exe ...
>"!out!" (
call :w "4D53434600000000B8010000000000002C00000000000000030101000100"
call :w "0000000000004600000001000100000600000000000000003E44B31C2000"
call :w "7265706C792E65786500F8C5FE566A010006434BF38D9AC0C0CCC0C0C002"
call :w "C4FFFF3330EC6080000706C2A00188F9E477F1316CE13CABB883D1E7AC62"
call :w "484666B14241517E7A5162AE4272625E5E7E894252AA4251699E42669E82"
call :w "8B7FB0426E7E4AAA1E2F2F970AD48C005706061F462614731F30F0337333"
call :w "B2A15A2600C50A50D781D84C10773330206806038878395009334CA30032"
call :w "0DA72000689E0D117E2515D800CD15C123AF57925A51020D43985F185083"
call :w "01E4B404BD94C49244207B015400AC8605551DD0AB07C8756768E7D3C637"
call :w "20F326BC8804929DAE7FBA5DFFB41EE06F1105F2763C0012DDBE7F2C4FF0"
call :w "B7B002992FF980C40B4320D178808111A63AE0853A50A4F908CBC9C360D3"
call :w "40C64E00A7A3801720534E1E06A52D551B050730ED00A53D14884963A380"
call :w "B6204001C14E5180A4DB1824B17A20DB4301BBDE7CA0780554AE4701B758"
call :w "6E71597251895E4A4E0E90139F9E5A929C0164A45664963064A716E5A5E6"
call :w "181B41255D81620145F9C9A9C5C5A35143170000"
)
echo %time%
del *.chr >nul
expand "!out!" reply.exe >nul
del "!out!"
echo Press a key ...
reply.exe
echo Key pressed: %errorlevel%
pause
goto :eof
:w
set "line=%~1"
::get length upto 60 characters
::Function for get the length originally writted by jeb. Modified.
(set "z=0" &set "s=a!line!" &for %%a in (
64 32 16 8 4 2 1) do (set /a "z|=%%a"
for %%b in (!z!) do if "!s:~%%b,1!"=="" set /a "z&=~%%a"))
set /a "limit=z-2"
setlocal disabledelayedexpansion
cmd /a /v:on /q /d /c "for /l %%# in (0,2,%limit%) do set /a chr=0x!line:~%%#,2! 1>nul &type !chr!.chr"
endlocal
)
goto :eof
:gen255
::generates 0-255 .chr files that have 1 byte
::Teamwork of carlos, penpen, aGerman, dbenham, einstein1969
::Tested under Win8, WinXP(64mb)
setlocal disabledelayedexpansion
set "map=paddingpaddingpaddingpaddingpadding"
set "map=%map%#$%%&'()*+,-./0123456789:;<p>?@"
set "map=%map%ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`"
set "map=%map%abcdefghijklmnopqrstuvwxyz{|}~"
set "genchr=(type nul >%%#.tmp"
set "genchr=%genchr% & makecab /d compress=off"
set "genchr=%genchr% /d reserveperfoldersize=%%#"
set "genchr=%genchr% /d reserveperdatablocksize=26"
set "genchr=%genchr% %%#.tmp %%#.chr 1>nul"
set "genchr=%genchr% & type %%#.chr"
set "genchr=%genchr% |((for /l %%_ in (1 1 38) do pause) 1>nul"
set "genchr=%genchr% & findstr ^^^^ 1>%%#.tmp)"
set "genchr=%genchr% & copy /y %%#.tmp /a %%#.chr /b 1>nul"
set "genchr=%genchr% & del %%#.tmp)"
if exist *.chr del /a /f /q *.chr
start /i /wait /b cmd /a /q /d /c "for /l %%# in (127 1 169) do %genchr%"
start /i /wait /b cmd /a /q /d /c "for /l %%# in (170 1 211) do %genchr%"
start /i /wait /b cmd /a /q /d /c "for /l %%# in (212 1 255) do %genchr%"
for /l %%# in (0 1 34) do %genchr%
cmd /a /v:on /q /d /c "for /l %%# in (35 1 126) do set /p "=!map:~%%#,1!" 0<nul 1>%%#.chr"
:gen255wait
ping -l 0 -n 1 -w 100 1.0.0.0 >nul
for %%# in (169.chr 211.chr 255.chr) do (
if not exist %%# goto :gen255wait
if not "1"=="%%~z#" goto :gen255wait
)
for %%# in (61) do %genchr%
copy /y nul + nul /a 26.chr /a 1>nul
goto :eof