but I tried to convert my 25GB of pictures, but it fails at the <NUL> bytes
But I remember that I wrote a simple solution to read binary data with batch files.\[url=http://example.com\]my Example\[/url\]
Code: Select all
@echo off
SETLOCAL EnableDelayedExpansion
set filesize=%~z1
set "hexVal=41"
set "x10=AAAAAAAAAA"
set /a chunks=1+filesize / 10
del dummy.txt 2>nul > nul
for /L %%n in (0,1,%chunks%) DO (
<nul >> dummy.txt set /p ".=%x10%"
)
set /a expectedNum=0
for /F "eol=F usebackq tokens=1,2 skip=1 delims=:[] " %%A in (`fc /b "%~dpf1" dummy.txt`) DO (
set /a num=0x%%A && (
set /a numDec=num-1
set "hex=%%B"
for /L %%n in (!expectedNum!=,=1 !numDec!) DO (
echo %hexVal%
)
set /a expectedNum=num+1
echo !hex!
)
)
The idea is to use the hex-output of FC (file compare).
First I create a file with (nearly) the same length, and then I compare them with FC in binary mode (/B), the output is scanned and if a line missings are detected, they are filled with the hexVal of the x10 string (in this case 0x41='A').
Perhaps you can enhance your rot13 encoder a bit
jeb@texel