Page 1 of 1

Find files with binary content?

Posted: Fri Apr 05, 2024 10:08 am
by meteorquake
Could someone suggest the most efficient way to search within files for binary content? basically a handy way to test for corruption of non-binary files, as often null or other characters will be written - any unexpected character below ascii 32 is ideal to trigger it (so not \r \n \t). I tried something with no luck.
Probably not as efficient as having a dedicated boolean function to test for the presence of such things ("contenthasbinary:").
Many thanks!
David

Re: Find files with binary content?

Posted: Fri Apr 05, 2024 10:15 am
by void
regex:binary:content:[\x00-\x08\x0b-\x0c\x0e-\x1f]

regex: = enable regular expressions.
binary: = treat the search as binary and the content as binary.

binary:

Re: Find files with binary content?

Posted: Fri Apr 05, 2024 10:41 am
by meteorquake
Cheers, that's very helpful! Found a few with it adjusted :)
I'm away from my backups and there was a rapid sequence of power fluctuations, a reboot and another set that wrecked the OS and impacted my documents partitions.
When I get back I'll MD5 all the files on these drives and the backups and spot any Modified-Size combinations that have multiple MD5s, which indicates a corruption (content changes but Modified-Size attribute stays the same), so I can pick off the uncorrupted ones to rewrite over the corrupted ones.
d