Código
@echo off rem dump.bat setlocal enabledelayedexpansion set byte= set offset= set op1= set op2= if %1==/p (set op1=%1 shift) if %1==/pp (set op2=%1 shift) if not exist %1 ( set errorlevel=1 echo no se encuentra el archivo %1 goto end ) ( Echo;E %~z1 "%~s1" Echo;D 0 %~z1 Echo;Q )>d debug %~s1<d>dmp del d if not defined op1 if not defined op2 (type dmp del dmp goto end) if not defined op1 goto op2 for /f "tokens=*" %%x in (dmp) do (set unformatted=%%x set formatted=!unformatted: = ; ! echo !formatted!>>dig) for /f "eol=; tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15" %%a in (dig) do (set offset=%%a %%b %%c %%d %%e %%f %%g %%h %%i %%j %%k %%l %%m %%n set offset=!offset:;=! echo !offset:-= ! ) del dmp del dig goto end :op2 for /f "tokens=*" %%x in (dmp) do (set unformatted=%%x set formatted=!unformatted: = ; ! echo !formatted!>>dig) for /f "eol=; tokens=2,3,4,5,6,7,8,9,10,11,12,13,14,15" %%a in (dig) do (set offset=%%a %%b %%c %%d %%e %%f %%g %%h %%i %%j %%k %%l %%m set offset=!offset:;=! echo !offset:-= ! ) del dmp del dig :end set byte= set offset=