2

Is it possible to make batch file or vbs that read few bytes from binary file and saves them to another file as readable text? (eg read 4E 50 44 -> save NPD)

Exapmple file bin

[start of file]8bytes of rubbish 24 bytes THAT I NEED (readable text) rest of file[eof]

user2247084
  • 29
  • 1
  • 3
  • [look here](http://stackoverflow.com/questions/4495576/echo-e-equivalent-in-windows) – Endoro Apr 04 '13 at 23:42
  • Excuse me. The 24 bytes you need are hexadecimal representations of Ascii characters using two Ascii digits from 0 to F? For example, if you TYPE your file, appear this on screen: `8bytes of rubbish4E5044etc.until48hexaDigits... rest of file`? – Aacini Apr 05 '13 at 14:49
  • Linux has a `strings` utility that allows extraction of text from binaries. See [this SuperUser thread](http://superuser.com/questions/124081/is-there-a-windows-equivalent-of-the-unix-strings-command) for similar Windows tools. – rojo Apr 05 '13 at 15:58
  • @Aacini - I thought of that as well, but in practice it didn't work as well as I would've liked. I tried to read "JFIF" from the header of a jpeg using a `for /f` loop and `type jpegfile`, but unfortunately `JFIF` was preceded by a null character which the `for` loop treated it as end-of-line. I guess. In any case, I couldn't extract any text from the header in my brief experiments. – rojo Apr 05 '13 at 16:10

1 Answers1

0

you can try with Frank's hex editor: https://groups.google.com/forum/?fromgroups=#!searchin/alt.msdos.batch.nt/hexeditor/alt.msdos.batch.nt/q84l84C2Q8Q/CjBkaDIKxfcJ

with this command cerutil -decodehex myfile myfile.hex you can see your file in hex , and then process it.With encodehex you can convert a hex data into text.

npocmaka
  • 55,367
  • 18
  • 148
  • 187