Menu

#464 windows grep -b gives corrupt offsets for large files

Grep
open
nobody
None
5
2012-07-26
2009-04-05
No

I ran this on a very large (29,095,200,106 bytes) recovered tar file:

"c:\Program Files (x86)\GnuWin32\bin\grep.exe" -obEae ".{257}ustar" tarfile.tar

The output looks fine until there's a very large file in the tar archive (EncryptedVol.tc). After that, impossibly-large offsets (18446744072258709451) are reported:

386624:avid/EncryptedVol.tc^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@0000744^@0000764^@0000764^@<80>^@^@^@^@^@^@^C⌐<80>^@
^@11077010313^@013223^@ 0^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ustar
18446744072258709451:avid/.xine/^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@0000755^@0000764^@0000764^@000
00000000^@11076477221^@011471^@ 5^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ustar
18446744072258709963:avid/.xine/config^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@

The offset has a repeating binary pattern in the upper bytes, suggesting that some kind of data resizing or shifting messed up:

Dec: 1,844,674,407,225,870,945
Bin: 0001 1001 1001 1001 1001 1001 1001 1001 1001 0000 1111 0011 1100 1010 0110 0001
Hex: 1999 9999 90F3 CA61

I haven't figured out the true offsets yet.

Discussion